//<![CDATA[ 
  // i've sorted these alphabeticly for ease of maintenance
  function popup(url, winName, id){
     var parms='width=610,height=475,fullscreen=no,toolbar=no,status=yes,menubar=no,scrollbars=no,resizable=no,directories=no,location=no';
     var win=windowOpener(uniqueUrl(url + "?id=" + id), winName, parms);
  }
  function procLink(x){
    document.forms['frm'].proc.value=x;
    document.forms['frm'].time.value=xtime;
    xsubmit(document.forms['frm']);
    //return true;
  }
  function procSearch(x,y){
    document.forms['frm'].idx.value=y;
    return procLink(x);
  }
  function procSite(x,y){
    var win=windowOpener(x,y,'');
  }
  function windowOpener(url, winName, parms){
    var tmp=window.open(url, winName, parms);
    if(!tmp.opener){tmp.opener = self; } // is this correct?
    tmp.name=winName;
    return tmp;
  }
/*
* adds timestamp to URLs to make them unique
* @param URL String
*/
function uniqueUrl(x){
  var xx=urlAppender(x,'time',xmillis())
  return urlAppender(xx,'zzz',zzz);
}
  function xallow(formObj){
    xexit = false;
    xID = xclear(xID);
    xcursor();
  }
  function xbig(){
    var xurl="../big/" + document.getElementById('imagename').innerHTML + "_big.jpg";
    var x=window.open(xurl,'myWin','fullscreen=no,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no');
  }
  function xclear(x){
    if(x) {
      clearTimeout(x);
      x = 0;
    }
    return x;
  }
  function xclose(){
    xID = xclear(xID);
    var rc = true;
    if(xexit) {
      //rc = alert("Good Bye!");
    }
    return rc;
  }
  function xcursor(){
    document.body.style.cursor = 'wait'; // 'default' to return
  }
  function xlink(x){
    return xlinkObj(null,x);
  }
  function xlinkObj(obj,x){
    xallow();
    window.name=xmillis();
    //window.location.replace(uniqueUrl(x));
    //return true;
	return xlinkFrm(obj,x);
  }
  function xloadtime(){
    var win=window.name;
    var rc='';
    if(win!=''){
      rc=((xmillis()-win)/1000);
    }
    window.name='';
    return rc;
  }
  function xrestart(){
    xclear(xID);
    timerStop();
    xsettimeout();
  }
  function xstat(x){
    xrestart();
    self.status = x;
    return true;
  }
  function xsubmit(formObj){
    xallow();
    if(formObj.zzz != null)
    {
      formObj.zzz.value=zzz;
    }
    formObj.submit();
  }
  function xtimeout(x,minutes){
    return setTimeout(x,minutes*60000);
  }
  function timerUpdate(){
    timerID = xclear(timerID);
    if(!tStart) {
      tStart   = new Date();
    }
    var tDate = new Date();
    var tDiff = tDate.getTime() - tStart.getTime();
    tDate.setTime(tDiff);
    zzz = zeroPad(tDate.getMinutes()) + ":" + zeroPad(tDate.getSeconds());
    top.window.defaultStatus = build + " " + zzz;
    timerID = setTimeout("timerUpdate()", 1000);
  }
  function zeroPad(x){
    x = x + "";
    if (x.length == 1)
    {
       x = "0" + x;
    }
    return x;
  }
  function timerStop(){
    xclear(timerID);
    tStart = null;
  }
/*
* uses a FORM for the requested URL, could be POSTed!
* This is a simple solution, more complex solution COULD build the FORM and then parse attributes into INPUT's
* NOTE: you probably SHOULD NOT use this for external links, unless you intend for them to receive your params!
* @param obj Object clicked (NOT USED in this Example)
* @param x URL
*/
function xlinkFrm(obj,x){
var url=uniqueUrl(x);
var frmObj=xlinkFrmHelp(url);
if(frmObj!=null){
frmObj.submit();
}else{
alert('ERROR!');
}
return false;
}
/*
* Expects URL with queryString as param href
* @param x URL
* @return obj Object of the generated FORM
*/
function xlinkFrmHelp(x){
var rc=null;
try{
var ar = x.split("?");
var act = ar[0];
var str = ar[1];
var id="frm" + xmillis();
var oFORM=document.createElement("form");
oFORM.setAttribute("id",id);
oFORM.setAttribute("method","post");
oFORM.setAttribute("action",act);
if(str!=null){
var parms=str.split('&');
for(i=0; i < parms.length; i++){
var parm=parms[i];
var pair=parm.split('=');
var oINPUT=document.createElement("input");
oINPUT.setAttribute("type","hidden");
oINPUT.setAttribute("name",pair[0]);
oINPUT.setAttribute("value",pair[1]);
oFORM.appendChild(oINPUT);
}
}
var oBODY=document.getElementsByTagName("body")[0];
oBODY.appendChild(oFORM);
rc=oFORM;
}catch(e){
alert("Error"+e);
}
return rc;
}
/*
* generates a timestamp as a number
*/
function xmillis(){
return new Date().getTime();
}
/*
* helps to add parms to the url
* @param URL String
* @param aname String
* @param avalue String
*/
function urlAppender(x,aname,avalue){
var delim = "?";
if(x.indexOf("?") >=0) { delim = "&"; }
return x + delim + aname + '=' + avalue;
}
//]]>
