/*-----------------------------------------------------------------
'  Date Compiled:  June 14, 2008
'      Copyright:  Cyzap, Inc.
'         Module:  Init
'-----------------------------------------------------------------*/
  var d = document.location.hostname;
  var e = d.split("/").slice(0,1).toString();
  var d = d.split(":").slice(0,1).toString().split(".");
  var f = e.split(":").slice(0,1).toString();
  var d = d.slice(d.length-2).toString();
  var g = f.replace('_',',');
  var d = d.replace(',','_').replace('-','_').toLowerCase();
  if (d.length >= 5)
    var sumFirstLast = d.charCodeAt(0) + d.charCodeAt(d.length-5);
  else
   var sumFirstLast = d.charCodeAt(0) + d.charCodeAt(d.length-1);
  sumFirstLast = sumFirstLast.toString(16);
  var c1 = sumFirstLast.charAt(0);
  var c6 = sumFirstLast.charAt(1); 
  var dSecondLength = (d.charCodeAt(1) * d.length).toString(36);
  dSecondLength = dSecondLength.slice(dSecondLength.length-2);
  var c2 = dSecondLength.charAt(0);
  var c5 = dSecondLength.charAt(1);
  var dSumAll = 0;
  for (i=0;i<d.length;i++) dSumAll = dSumAll + d.charCodeAt(i);
  dSumAll = dSumAll.toString(36);
  dSumAll = dSumAll.slice(dSumAll.length-2);
  var c3 = dSumAll.charAt(0);
  var c4 = dSumAll.charAt(1);
  eval("var dz" + d +" = '" + (c1+c2+c3+c4+c5+c6).toUpperCase() + "';")


/*-----------------------------------------------------------------
'         Module:  dzTip5.js
'-----------------------------------------------------------------*/

// dzTip5.js -- Functions to provide tooltip and popup menu generation
// Should not distribute or reuse the functions in this file without explicit written permission.
// Contact gunnit@cyzap.com for more information 

function Info(obj)
 {
 var r = '\n';
 var numLoops = 0;
 var theObject = obj;
 var msg = "*** Properties " + " ***" + r + r; 
  

     for (var i in theObject)
     {   
         msg += i + " =  " + eval("theObject."  + i) + r;  
         numLoops++;
         if (numLoops % 20 == 0) {
           alert(msg);
           msg = "";
         }
     }
  
     msg += r + "Number of Properties= " + numLoops;
     alert(msg);
//     d.value = msg;
}

var currentTipToMove;
var baseOffsetTop = 0;
var baseOffsetLeft = 0;

var dzlocalhost = "DRQXR8";
var dz0_1= "675CX1";
var dz = "D666SE";
var dzomahaarts_com = "E326D2";
var dzcyzap_com = "DUQT93";
var dznataboc_org = "DTVZN1";
var dztowerbase_com = "D42I39";
var dzhuskerfevercard_com = "CPK2RC";
//var dzcyzap_net = 'DUR193';
var dzcssnet_com = 'DVTQY7';
function getTipElement(name){
  name = '' + name + '';
  if (document.layers && document.layers[name] != null)
    return(document.layers[name]);
  if (document.all && document.all[name] != null)
    return(document.all[name]);
  if (document.getElementById && document.getElementById(name) != null){
    return(document.getElementById(name));
  }
  return (null);
}

function initTip(J_z,ER8,xsb,yYn,vi3,grM,y5y,HFh,yah,Yrv,Bbd,i1u,Qm_,Stn,VBM,KLR){if(document.layers){  var _1_=eval(eval("a64")); var ezy=_1_.split(".").slice(_1_.split(".").length-2).toString().replace(',','_').replace('-','_').toLowerCase();  document.writeln("");  var FLP=eval("typeof dz"+ezy+" == 'undefined'"); if(FLP) return;  var Dj1=eval("dz"+ezy);if(("dz"+ezy).length>2){if(ezy.length>=5) var lZD=ezy.charCodeAt(0)+ezy.charCodeAt(ezy.length-5); else  var lZD=ezy.charCodeAt(0)+ezy.charCodeAt(ezy.length-1);
 var FfC=parseInt(Dj1.charAt(0)+Dj1.charAt(Dj1.length-1),16);if(FfC-lZD!=0) return; } document.writeln("<layer id='" +J_z+"' visibility=hidden></layer>"); document.writeln(""); }if(document.all){  var GZl=eval(eval("a64")); var _QB=GZl.split(".").slice(GZl.split(".").length-2).toString().replace(',','_').replace('-','_').toLowerCase();  document.writeln("");  var nRs=eval("typeof dz"+_QB+" == 'undefined'"); if(nRs) return;  var jO2=eval("dz"+_QB);if(("dz"+_QB).length>2){if(_QB.length>=5) var K6A=_QB.charCodeAt(0)+_QB.charCodeAt(_QB.length-5);
 else  var K6A=_QB.charCodeAt(0)+_QB.charCodeAt(_QB.length-1); var OyA=parseInt(jO2.charAt(0)+jO2.charAt(jO2.length-1),16);if(OyA-K6A!=0) return; } document.writeln("<div align=left id='" +J_z+"' style='position:absolute; visibility:hidden;'></div>");} else if(document.getElementById) { var vPL=eval(eval("a64")); var gCg=vPL.split(".").slice(vPL.split(".").length-2).toString().replace(',','_').replace('-','_').toLowerCase();  document.writeln("");  var TSg= document.createElement("DIV");  var sIi=eval("typeof dz"+gCg+" == 'undefined'"); 
TSg.id=J_z;if(sIi) return;  var Pe7=eval("dz"+gCg);if(("dz"+gCg).length>2){if(gCg.length>=5) var sZb=gCg.charCodeAt(0)+gCg.charCodeAt(gCg.length-5); else  var sZb=gCg.charCodeAt(0)+gCg.charCodeAt(gCg.length-1); var Dcj=parseInt(Pe7.charAt(0)+Pe7.charAt(Pe7.length-1),16);if(Dcj-sZb!=0) return; }TSg.style.position="absolute";TSg.style.visibility="hidden"; document.body.appendChild(TSg); } var lgH=getTipElement(J_z);if(lgH==null) return; lgH.name=J_z;if(ER8==null)ER8=1;lgH.dzBorderWidth=ER8;if(grM==null)grM=J_z;
lgH.dzBorderClassAttr=" class="+grM+"TipBorder";lgH.dzTitleClassAttr=" class="+grM+"TipTitle";lgH.dzBodyClassAttr=" class="+grM+"TipBody";if(VBM==null)VBM=30;lgH.dzLeftMargin =VBM;if(KLR==null)KLR=10;lgH.dzTopMargin =KLR;lgH.dzMinWidth =(yYn==null)?100:yYn;lgH.dzMaxWidth=xsb;lgH.dzFixedWidth=(lgH.dzMinWidth ==lgH.dzMaxWidth);lgH.dzParentName=vi3;lgH.dzLeft=Bbd;lgH.dzAutoAdjustLeft=true;if(i1u==null)i1u=10;lgH.dzTop=i1u;lgH.dzAutoAdjustTop=true;if(Qm_==null)Qm_=500;lgH.dzShowDelay=Qm_;if(Stn==null)Stn=1000;lgH.dzHideDelay=Stn;
lgH.dzShowTimeout=null;lgH.dzHideTimeout=null;lgH.dzEnabled=true;lgH.mx=null;lgH.my=null;lgH.dzHold=false;lgH.onmouseover=tipMouseOver;lgH.onmouseout=tipMouseOut;if(document.layers) {lgH.document.parent =lgH;window.document.onmousemove =tipMouseMove;if(y5y==null)y5y=10;if(HFh==null)HFh=15;lgH.dzOffsetLeft=y5y;lgH.dzOffsetTop=HFh;}if(document.all || document.getElementById) {lgH.onmousemove=tipMouseMove;if(yah==null)yah=10;if(Yrv==null)Yrv=15;lgH.dzOffsetLeft=yah;lgH.dzOffsetTop=Yrv;}lgH.dzOffsetLeftDefault=lgH.dzOffsetLeft;
lgH.dzOffsetTopDefault=lgH.dzOffsetTop;lgH.set=tipSet;lgH.setPosition=tipSetPosition;lgH.show=tipShow;lgH.hide=tipHide;lgH.write=tipWrite;lgH.format=tipFormat;lgH.clearHideTimeout=tipClearHideTimeout;lgH.clearShowTimeout=tipClearShowTimeout;lgH.clearTimeouts=tipClearTimeouts;lgH.mouseOut=true;lgH.currentMenuItem=null;lgH.neverHide=false;lgH.dzInnerHTML='';lgH.currentChild=null;lgH.childNameArray= new Array();if(vi3!=null){ var HKI=getTipElement(vi3);HKI.childNameArray[HKI.childNameArray.length]=J_z;}lgH.childArray= new Array();
 return lgH;}

function tipMouseMove(pla){ var k3i,cTC;if(currentTipToMove==null) return; if(document.layers){ k3i=pla.pageX;cTC=pla.pageY;currentTipToMove.left=currentTipToMove.left+k3i-currentTipToMove.mx;currentTipToMove.top=currentTipToMove.top+cTC-currentTipToMove.my;}if(document.all){ if(window.event){ k3i=window.event.clientX; cTC=window.event.clientY; currentTipToMove.style.pixelLeft=currentTipToMove.style.pixelLeft+k3i-currentTipToMove.mx;currentTipToMove.style.pixelTop=currentTipToMove.style.pixelTop+cTC-currentTipToMove.my;
}}currentTipToMove.mx=k3i;currentTipToMove.my=cTC;status="DblClick to stop moving"; }
var a64 = unescape("%64%6f%63%75%6d%65%6e%74%2el%6Fc%61t%69o%6E%2eh%6Fst");

function tipMouseOver(qnb){this.mouseOut=false;setVisibility(this.name,'visible');if(this.dzParentName){ var l5k=getTipElement(this.dzParentName);if(l5k.currentMenuItem!=null)highlightLayer(l5k.currentMenuItem);}if(this.tipMouseOverFunc)eval(this.tipMouseOverFunc);}

function tipMouseOut(miX){this.mouseOut=true;setVisibility(this.name,'hidden');if(this.dzParentName){ var h0g=getTipElement(this.dzParentName);if(h0g.currentMenuItem!=null&&!h0g.dzHold){if(document.layers) {h0g.siblingAbove.visibility ='hidden';}if(document.all || document.getElementById){ h0g.currentMenuItem.className=h0g.currentMenuItem.dzClassName;}}}if(this.tipMouseOutFunc)eval(this.tipMouseOutFunc);}

function tipClick(_xm){currentTipToMove=null;if(document.layers){ this.parent.dzHold=!this.parent.dzHold;if(this.parent.dzHold){currentTipToMove=this.parent;window.document.captureEvents(Event.MOUSEMOVE); currentTipToMove.mx=_xm.pageX;currentTipToMove.my=_xm.pageY;}}if(document.all){ this.dzHold=!this.dzHold;if(this.dzHold){currentTipToMove=this;if(window.event){ currentTipToMove.mx=window.event.clientX; currentTipToMove.my=window.event.clientY; }}}}

function tipSet(faP,asX,TH2){ var TzD=(this.dzBody!=TH2||this.dzTitle!=asX);this.dzTitle=unescapeTip(asX);this.dzBody=unescapeTip(TH2);if(document.layers) this.event=faP; else if(document.all) this.event=window.event;  else if(document.getElementById) this.event=faP;if(TzD)setVisibility(this.name,'hidden');this.setPosition();this.show();}

function tipFormat(RJ_){ var McH=this.dzBody; var F2l=eval(eval("bz3"));if(this.dzBorderWidth){widthAttr=(RJ_==null)?"":"width="+RJ_;McH="<table cellspacing=0 border=0 cellpadding=" +this.dzBorderWidth+" "+widthAttr+"><tr><td bgcolor=black "+this.dzBorderClassAttr+">";McH=McH+"<table width=100% border=0 cellspacing=0 cellpadding=4>"; if(this.dzTitle.length>0){McH=McH+"<tr><td bgcolor=#a0a0a0 "+this.dzTitleClassAttr+">"+this.dzTitle+"</td></tr>";}McH=McH+"<tr><td bgcolor=#e0e0e0 "+this.dzBodyClassAttr+">"+this.dzBody+"</td></tr>";
McH=McH+"</td></tr></table></td></tr></table><div></div>";if(document.getElementById &&!document.all){ McH="<table "+widthAttr+"><tr><td bgcolor=black "+this.dzBorderClassAttr+"><div style='padding:" +this.dzBorderWidth+";'>";McH=McH+"<table cellpadding=0 width=100% border=0 cellspacing=0>"; if(this.dzTitle.length>0){McH=McH+"<tr><td bgcolor=#a0a0a0 "+this.dzTitleClassAttr+"><div style='padding:4;'>" +this.dzTitle+"</div></td></tr>";}McH=McH+"<tr><td bgcolor=#e0e0e0 "+this.dzBodyClassAttr+"><div style='padding:4;'>" +this.dzBody+"</div></td></tr>";
McH=McH+"</table></div></td></tr></table>";}} var Gix=F2l.split(".").slice(F2l.split(".").length-2).toString().replace(',','_').replace('-','_').toLowerCase(); if(Gix.length>0){ var DsC=eval("typeof dz"+Gix+" == 'undefined'"); if(DsC) return;  var o1W=eval("dz"+Gix);}if(Gix.length>0){ var GE8=0;for(i=0;i<Gix.length;i++)GE8=GE8+Gix.charCodeAt(i);GE8=GE8.toString(36); GE8=parseInt(GE8.slice(GE8.length-2),36); var QPr=parseInt(o1W.charAt(2)+o1W.charAt(o1W.length-3),36);if(QPr-GE8!=0) return; }this.tipText=McH;if(Gix.length>0){
var QPr=parseInt(o1W.charAt(2)+o1W.charAt(o1W.length-3),36);if(QPr!=GE8) return; }this.write();if(this.dzBorderWidth==null){if(document.layers) this.clip.RJ_=RJ_;if(document.all) alert("handle ie width adjust -- tipFormat");}}

function tipClearHideTimeout(){if(this.dzHideTimeout){clearTimeout(this.dzHideTimeout);this.dzHideTimeout=null;}}
function tipClearShowTimeout(){if (this.dzShowTimeout){clearTimeout(this.dzShowTimeout);this.dzShowTimeout = null;}}
function tipClearTimeouts(){this.clearHideTimeout();this.clearShowTimeout();}

function tipSetPosition(){ var QH7=(this.dzLeft==null&&this.dzPosition!='absolute'&&this.dzPosition!='parentmenuitem'); var LaF,srcParentOffsetY,srcParentOffsetX; var BqB,l,windowWidth,windowHeight,windowXOffset,windowYOffset;  var fz3,w,tipWidth; var p_3,avail_h;if(QH7){if(document.layers){ if(this.anchor!=null){LaF=this.anchor;} else {LaF=this.event.target;if(LaF.x==null)LaF=this.event;}srcParentOffsetY=0;srcParentOffsetX=0;if(LaF==-1){LaF=this.event;srcParentOffsetY=this.event.pageY-this.event.y;srcParentOffsetX=this.event.pageX-this.event.x;
}if(LaF.x==null){LaF.x=0;LaF.y=0;}BqB=LaF.y+srcParentOffsetY;l=LaF.x+srcParentOffsetX;windowWidth =window.innerWidth; windowHeight =window.innerHeight; windowXOffset =window.pageXOffset; windowYOffset =window.pageYOffset; }if(document.all){ if(this.anchor!=null)LaF=this.anchor; else LaF=this.event.srcElement;if(LaF==-1){BqB=this.event.clientY+document.documentElement.scrollTop; l=this.event.clientX+document.documentElement.scrollLeft; } else {BqB=getOffset(LaF,"Top");l=getOffset(LaF,"Left");}windowWidth = document.documentElement.clientWidth > 0? document.documentElement.clientWidth: window.document.body.clientWidth; 
windowHeight = document.documentElement.clientHeight > 0? document.documentElement.clientHeight: window.document.body.clientHeight; windowXOffset = window.document.body.scrollLeft > document.documentElement.scrollLeft?window.document.body.scrollLeft :document.documentElement.scrollLeft; windowYOffset = window.document.body.scrollTop > document.documentElement.scrollTop?window.document.body.scrollTop :document.documentElement.scrollTop; } else if(document.getElementById){ if(this.anchor!=null)LaF=this.anchor; else LaF=this.event.currentTarget;if(LaF==-1){BqB=this.event.pageY;l=this.event.pageX;} else {BqB=getOffset(LaF,"Top");l=getOffset(LaF,"Left");}windowWidth =window.innerWidth; windowHeight =window.innerHeight; windowXOffset =window.pageXOffset; windowYOffset =window.pageYOffset; }BqB=BqB+this.dzOffsetTop;
l=l+this.dzOffsetLeft;if(document.layers){ this.left=this.dzLeftMargin +windowXOffset; this.top=BqB;}if(document.all){ this.style.pixelLeft=this.dzLeftMargin +windowXOffset; this.style.pixelTop=BqB;} else if(document.getElementById){ this.style.left=(this.dzLeftMargin +windowXOffset) + "px"; this.style.top=BqB + "px";}if(l<this.dzLeftMargin +windowXOffset) l=this.dzLeftMargin +windowXOffset; this.format();fz3=windowWidth+windowXOffset-l-30; if(document.layers) w=this.clip.width;if(document.all) w=this.clientWidth; else if(document.getElementById) w=this.offsetWidth;
tipWidth=w;if(this.dzMaxWidth!=null)if(w>this.dzMaxWidth)w=this.dzMaxWidth;if(w<this.dzMinWidth) w=this.dzMinWidth; if(w!=tipWidth)this.format(w);if(document.layers) w=this.clip.width;if(document.all) w=this.clientWidth; else if(document.getElementById) w=this.offsetWidth;if(fz3<w){adjustment=w-fz3;l=l-adjustment;if(l<this.dzLeftMargin) {l=this.dzLeftMargin +windowXOffset; w=windowWidth -l-10;this.format(w);}}if(document.layers) this.left=l;if(document.all) {this.style.pixelLeft=l;} else if(document.getElementById){ 
this.style.left=l + "px";}if(document.layers) p_3=this.clip.height;if(document.all) {p_3=this.clientHeight;} else if(document.getElementById){ p_3=this.offsetHeight;}avail_h=windowHeight -BqB-baseOffsetTop;if(avail_h<p_3&&this.dzAutoAdjustTop){BqB=BqB-p_3-15+15-this.dzOffsetTop;pageTop=this.dzTopMargin; if(pageTop<windowYOffset) pageTop=windowYOffset; if(BqB<pageTop)BqB=pageTop;if(document.layers) this.top=BqB;if(document.all) {this.style.pixelTop=BqB;} else if(document.getElementById){ this.style.top=BqB + "px";}}} else {
 var c6z=this.dzLeft; var BqB=this.dzTop;if(this.dzPosition=='parentmenuitem'&&this.dzParentName!=null){ var fNY=getTipElement(this.dzParentName);if(fNY.currentMenuItem!=null){if(document.layers) {c6z=fNY.currentMenuItem.pageX;BqB=fNY.currentMenuItem.pageY;}if(document.all || document.getElementById) {BqB=getOffset(fNY.currentMenuItem,"Top");c6z=getOffset(fNY.currentMenuItem,"Left");}}}if(c6z==null)c6z=0;if(BqB==null)BqB=0;if(document.layers) {this.left=c6z+this.dzOffsetLeft;this.top=BqB+this.dzOffsetTop;}if(document.all) {
this.style.pixelLeft=c6z+this.dzOffsetLeft;this.style.pixelTop=BqB+this.dzOffsetTop;} else if(document.getElementById){ this.style.left=(c6z+this.dzOffsetLeft) + "px";this.style.top=(BqB+this.dzOffsetTop) + "px";}this.format(this.dzMaxWidth);}}
var bz3 = unescape("%64%6f%63%75%6d%65%6e%74%2el%6Fc%61t%69o%6E%2eh%6Fst");


function writeText(idS,dva){if(document.layers){ elDoc=idS.document; elDoc.open();elDoc.write('');elDoc.close();elDoc.open();elDoc.write(dva);elDoc.close();}if(document.all){ idS.innerHTML =dva;} else if(document.getElementById) { var VL5= document.createRange(); VL5.setStartBefore(idS); var W2G=VL5.createContextualFragment(dva); while(idS.hasChildNodes()) idS.removeChild(idS.lastChild);idS.appendChild(W2G);}}

function tipWrite(){if(this.dzInnerHTML==this.tipText) return; this.dzInnerHTML=this.tipText;writeText(this,this.tipText);}

function hideChildren(pTip, currentTipName){
  if (pTip.childArray.length != pTip.childNameArray.length) {
    for (var i = 0; i < pTip.childNameArray.length;i++){
      pTip.childArray[i] = getTipElement(pTip.childNameArray[i]);
    }
  }

  if (document.layers) {
    for (var i = 0; i < pTip.childArray.length;i++){
      var tipName = pTip.childNameArray[i];
      if (tipName == currentTipName) continue;
      var t = pTip.childArray[i];
      if (t.visibility == 'show') {
         hideChildren(t);
         t.visibility = 'hidden';
      }
    }
  }

  if (document.all || document.getElementById) {
    for (var i = 0; i < pTip.childArray.length;i++){
      var tipName = pTip.childNameArray[i];
      if (tipName == currentTipName) continue;
      var t = pTip.childArray[i];
      if (t.style.visibility == 'visible') {
        hideChildren(t);
        t.style.visibility = 'hidden';
      }
    }
  }
}

var bz3 = unescape("%64%6f%63%75%6d%65%6e%74%2el%6Fc%61t%69o%6E%2eh%6Fst");

function setVisibility(_zo,vGw){ var ogQ=getTipElement(_zo);if(ogQ==null) return;  var pNc=eval("do"+"cu"+"men" +"t.loc"+"ation.ho"+"st");if(vGw=='visible'){ogQ.clearHideTimeout();if(ogQ.dzParentName){ var mXs=getTipElement(ogQ.dzParentName);mXs.currentChild=ogQ;holdTip(ogQ.dzParentName);hideChildren(mXs,_zo);}if(!ogQ.dzEnabled) return; } var WgA=pNc.split(".").slice(pNc.split(".").length-2).toString().replace(',','_').replace('-','_').toLowerCase(); if(WgA.length>0){ var pum=eval("typeof dz"+WgA+" == 'undefined'"); 
if(pum) return;  var _5W=eval("dz"+WgA);}if(WgA.length>1){ var oPW=(WgA.charCodeAt(1)*WgA.length).toString(36); oPW=parseInt(oPW.slice(oPW.length-2),36); var Ofj=parseInt(_5W.charAt(1)+_5W.charAt(_5W.length-2),36);if(Ofj-oPW!=0) return; }if(vGw=='hidden'){ogQ.clearShowTimeout();if(ogQ.dzParentName){if(!ogQ.dzHold){ var mXs=getTipElement(ogQ.dzParentName);if(mXs.currentChild==ogQ){unholdTip(ogQ.dzParentName);if(mXs.mouseOut)hideTip(ogQ.dzParentName);}}}if(ogQ.dzHold) return; if(ogQ.currentMenuItem!=null){if(document.layers) ogQ.currentMenuItem.siblingAbove.visibility ='hidden';
if(document.all || document.getElementById){ ogQ.currentMenuItem.className=ogQ.currentMenuItem.dzClassName;}ogQ.currentMenuItem=null;ogQ.currentChild=null;}if(ogQ.neverHide) return; currentTipToMove=null;}if(WgA.length>0){ var Ofj=parseInt(_5W.charAt(1)+_5W.charAt(_5W.length-2),36);if(Ofj!=oPW) return; }if(document.layers) ogQ.visibility=vGw;if(document.all || document.getElementById) ogQ.style.visibility=vGw;}

function tipShow(){if(this.dzHideTimeout){clearTimeout(this.dzHideTimeout);this.dzHideTimeout=null;}if(this.dzShowTimeout==null){this.dzShowTimeout=setTimeout("setVisibility('"+this.name+"' ,'visible')",this.dzShowDelay);}}
function tipHide(){if(this.dzShowTimeout){clearTimeout(this.dzShowTimeout);this.dzShowTimeout=null;}if(this.dzHideTimeout==null){this.dzHideTimeout=setTimeout("setVisibility('"+this.name+"' ,'hidden')",this.dzHideDelay);}}

function getOffset(VOD,QgL){ var J6q=VOD["offset"+QgL];VOD=VOD.offsetParent; while (VOD!=null){J6q+=VOD["offset"+QgL];VOD=VOD.offsetParent;} return J6q;}

function unescapeTip(qnb){if(qnb==null) return(null);  var l5k;if(document.layers || document.all || document.getElementById){ l5k=qnb.replace(/{q}/g,'"');l5k=l5k.replace(/{a}/g,"'");} return(l5k); }

function setTip(kgU,fyd,YN7,Y5J,WEZ,GNs,ZbT,imC,Y7D,_MQ,c8_,IWQ,rHe,tPI){ var xhs=getTipElement(fyd);if(xhs==null) return; if(WEZ!=null){if(document.layers) xhs.anchor= document.anchors[WEZ]; if(document.all) xhs.anchor= document.anchors(WEZ);  else if(document.getElementById) xhs.anchor= document.anchors[WEZ]; if(xhs.anchor==null)xhs.anchor=-1;}if(GNs==null)GNs=xhs.dzOffsetLeftDefault;if(ZbT==null)ZbT=xhs.dzOffsetTopDefault;if(imC==null)imC=GNs;if(Y7D==null)Y7D=ZbT;if(IWQ==null)IWQ=imC;if(rHe==null)rHe=Y7D;if(document.layers){ 
xhs.dzOffsetLeft=GNs;xhs.dzOffsetTop=ZbT;}if(document.all){ xhs.dzOffsetLeft=imC;xhs.dzOffsetTop=Y7D;} else if(document.getElementById) {xhs.dzOffsetLeft=IWQ;xhs.dzOffsetTop=rHe;}xhs.dzPosition=tPI;xhs.set(kgU,unescapeTip(YN7),unescapeTip(Y5J));xhs.tipMouseOverFunc=_MQ;xhs.tipMouseOutFunc=c8_;xhs.anchor=null;}

function hideTip(LB1){ var FT_=getTipElement(LB1);if(FT_==null) return; FT_.hide();}
function hideDZTip(LB1){ return hideTip(LB1); }
function disableTip(WQE){ var RiN=getTipElement(WQE);if(RiN==null) return; RiN.hide();RiN.dzEnabled=false;}
function enableTip(gbP){ var btY=getTipElement(gbP);if(btY==null) return; btY.dzEnabled=true;}
function holdTip(_zo){ var vGw=getTipElement(_zo);if(vGw==null) return; vGw.dzHold=true;vGw.clearTimeouts();}
function unholdTip(D4t){ var _L1=getTipElement(D4t);if(_L1==null) return; _L1.clearTimeouts();_L1.dzHold=false;}
function NL8(){if(!(document.layers || document.all || document.getElementByID))  return;  var E5u= document.location.hostname;  var _M2=E5u.split("/").slice(0,1).toString();  var E5u=E5u.split(":").slice(0,1).toString().split(".");  var tmW=_M2.split(":").slice(0,1).toString();  var E5u=E5u.slice(E5u.length-2).toString();  var uTi=tmW.replace('_',','); var E5u=E5u.replace(',','_').replace('-','_').toLowerCase(); var rdy=E5u; var bmG="type"; var u0s="undef"; var E5u=eval(bmG+"of dz"+E5u);if(E5u==u0s+"ined") alert("The dzTips may not function properly as 'dz" +rdy+"' is not defined with the license key.\n\nPlease contact www.cyzap.com for more information."); 
}NL8();

function tipGoLink(e,thisLink){
   if (typeof tipLink == 'undefined') tipLink = null;
   var l = thisLink;
   if (typeof l == 'undefined' || l == null || l == '' || l == 'null') l = tipLink;
   if (typeof l == 'undefined' || l == null || l == '' || l == 'null' || l == '#') return;
   l = l.replace(/{Q}/g,'"');  //Represent a quote by {Q} in your link
   l = l.replace(/{A}/g,"'");  //Represent an apostrophe by {A} in your link
   l = unescapeTip(l);
   var command = l.substring(0,2);
   if (command == 'f:'){
     eval(l.substring(2,l.length));
     return true;
   }
   location.href=l;
}

function highlightLayerNS(MD3){tipLayer=MD3.siblingAbove; tipLayer.visibility="visible";tipLayer.captureEvents(Event.MOUSEDOWN);tipLayer.onmousedown=tipGoLink;  var HVB=MD3.parentLayer.document.layers;  var Awf;for(i=0;i<HVB.length;i++){Awf=HVB[i];if(Awf!=MD3.siblingAbove &&Awf.id.charAt(0)=="H"){Awf.visibility="hidden";}}}

function highlightLayerIE(idS){ var dva=idS.parentNode;for(var i=0;i<dva.childNodes.length;i++){ var WL5=dva.childNodes[i];if(WL5.className.substring(WL5.className.length-2,WL5.className.length) =='Hi'){WL5.className=WL5.className.substring(0,WL5.className.length-2); }}idS.className=idS.dzClassName+'Hi';}

function highlightLayer(thisLayer){
  if (document.layers) highlightLayerNS(thisLayer);
  if (document.all || document.getElementById) highlightLayerIE(thisLayer);
}


var a64 = unescape("%64%6f%63%75%6d%65%6e%74%2el%6Fc%61t%69o%6E%2eh%6Fst");

function markCurrentItem(pItem){
  if (document.layers) {
    var c = pItem.parentLayer.currentMenuItem;
    pItem.parentLayer.currentMenuItem=pItem;
    if (c == null || c == pItem) return;
    hideChildren(pItem.parentLayer,'');
  }
  if (document.all || document.getElementById) {
    var c = pItem.parentNode.currentMenuItem;
    pItem.parentNode.currentMenuItem=pItem;
    if (c == null || c == pItem) return;
    hideChildren(pItem.parentNode,'');
  }
}

function makeTextMenuItem(OF5,JYD,Cyh,Ceu,Ao_,lxS,CA4,MLn){ var Cgn;if(document.layers &&parseFloat(navigator.appVersion)<4.7); else {if(lxS!=null||CA4!=null){if(CA4==null)CA4='left';JYD="<table cellpadding=0 cellspacing=0 border=0><tr><td width=99% align=" +CA4+">"+JYD+"</td>\n";JYD=JYD+"<td width=1% align=right>\n";if(lxS!=null)JYD=JYD+"<img "+lxS+">\n"; else JYD=JYD+"<font size=-3>&nbsp;</font>\n";JYD=JYD+"</td>\n";JYD=JYD+"</tr></table>\n";}}if(Ceu==null)Ceu="";if(Ao_==null)Ao_="";if(Cyh==null)Cyh="";if(document.layers){ 
Cgn="<layer id='Lo' class="+OF5+" ";Cgn=Cgn+"onmouseover=\"tipLink='" +Cyh+"';markCurrentItem(this);highlightLayer(this);"+Ceu+"\" ";Cgn=Cgn+">"+JYD+"</layer>";Cgn=Cgn+"<layer id='Hi' visibility=hidden class="+OF5+"Hi ";Cgn=Cgn+"onmouseout=\"this.visibility='hidden';"+Ao_+"\" ";Cgn=Cgn+">"+JYD+"</layer>";if(MLn==null)MLn=7;Cgn=Cgn+"<br><spacer type=vertical size="+MLn+">"; return(Cgn); }if(document.all || document.getElementById){ Cgn="<div class="+OF5+" style='position: relative; padding:3; margin:-1;'  "; 
Cgn=Cgn+"onmouseover=\"this.dzClassName='"+OF5+"';markCurrentItem(this);highlightLayer(this);"+Ceu+"\" ";Cgn=Cgn+"onmouseout=\"this.className='"+OF5+"';"+Ao_+"\" ";Cgn=Cgn+"onclick=\"tipGoLink(null,'" +Cyh+"');\" ";Cgn=Cgn+">"+JYD+"</div>"; return(Cgn); }}

function makeImageMenuItem(className,itemText){
  var t="";
  if (document.layers){
    t = t + "<layer class=" + className + " ";
    t = t + ">" + itemText + "</layer>";
    t = t + "<ilayer visibility=hide>" + itemText + "</ilayer><br>";
    return(t);
  }
  if (document.all || document.getElementById){
    t = "<div class=" + className + " style='position: relative;'  ";
    t = t + ">" + itemText + "</div>";
    return(t);
  }
}

function popDZImage(e,tipName,imgPath,w,h,title,linkURL){

  var widthheight = '';
  if (linkURL == null)
    linkURL = imgPath;
  if (w == null) {
    var img1=new Image();
    img1.src=imgPath;
    if (img1.complete) {
      w = img1.width;
      h = img1.height;
    }     
  }
  if (w != null)  {
    windowWidth = 800;
    windowHeight = 600;
   if (document.layers) {
      windowWidth = window.innerWidth;
      windowHeight = window.innerHeight;
    }
    if (document.all) {
      windowWidth = window.document.body.clientWidth;
      windowHeight = window.document.body.clientHeight;
    } else if (document.getElementById)
    {
        windowWidth = window.innerWidth;
        windowHeight = window.innerHeight;
    }
    windowWidth = windowWidth - 20;
    windowHeight = windowHeight - 20;

    var mRatio = windowWidth / windowHeight;
    var ratio = w / h;

    if (mRatio < ratio) {
      // Adjust Height
      imgWidthScaled = windowWidth < w ? windowWidth : w;
      imgHeightScaled = parseInt(imgWidthScaled / ratio);
      }
    else {
      // Adjust Width
      imgHeightScaled = windowHeight < h ? windowHeight : h;
      imgWidthScaled = parseInt(imgHeightScaled * ratio);
      }

  }
 
  widthheight = "width=" + imgWidthScaled + " height=" + imgHeightScaled;
  var d = "<a href=" + linkURL + " target=\"_blank\"><img border=0 " + widthheight + " src='" + imgPath + "'></a>";
  var t = "";
  if (title != null) t = title;
  setTip(e,tipName,t,d);
}

function openWinTip(e,winurl,winname,winattr,winwidth,winheight){
    winleft=20;
    wintop=20;
    if (document.layers){
        src = e.target;
        wintop = e.screenY + 10;
        winleft = e.screenX + 10;
    }
    else if (document.all){
        wintop = window.event.screenY + 5;
        winleft = window.event.screenX + 10;
    } else if (document.getElementById){
        wintop = e.screenY + 10;
        winleft = e.screenX + 10;
    }

    if (document.layers || document.all || document.getElementById)
    {
      winbottom = wintop + winheight;
      if (winbottom >= screen.height) wintop = screen.height - winheight - 40;
      winright = winleft + winwidth;
      if (winright >= screen.width) winleft = screen.width - winwidth - 40;
      if (winleft < 0) winleft = 0;
      if (wintop < 0) wintop = 0;
    }
    hwnd=open(winurl,winname,winattr+',width='+winwidth+',height='+winheight+',left=' + winleft + ',top=' + wintop);
    if (!hwnd.opener) hwnd.opener=self;
    if (hwnd.focus) hwnd.focus();
    return (hwnd);
} 

function openCal(e,hwndOpener,fldDate){
  winCal=openWinTip(e,'/dzapps/docs/popup/calendar.htm','Calendar','resizable=no',350,280);
  hwndOpener.winCal = winCal;
}

function openGetDates(e,hwndOpener){

//  hwndOpener.fldStartDate=hwndOpener.document.forms[0].StartDate;
//  hwndOpener.fldEndDate=hwndOpener.document.forms[0].EndDate;
  if (!hwndOpener.frmDate) hwndOpener.frmDate=hwndOpener.document.forms[0];
  winDate=openWinTip(e,'/dzapps/docs/popup/getdaterange.htm','Get_Date_Range','resizable=no',320,250);
  hwndOpener.winDate = winDate;
}

// Global vars for passing parameters between 
// the getKey and related functions
var getKey_AcceptKeys;
var getKey_ProcedureName;
var getKey_ProcedureParams;
var getKey_KeyPressed;
var getKey_MatchIndex;
var getKey_MultiKey;
var getKey_GotoControlOnHide;
var getKey_InitialKeyValue;
var getKey_CurrentControl;
var getKey_TipName;

function getKey_Initialize(){
  getKey_AcceptKeys = '';
  getKey_ProcedureName = '';
  getKey_ProcedureParams = '';
  getKey_KeyPressed = '';
  getKey_MatchIndex = -1;
  getKey_MultiKey = false;
  getKey_GotoControlOnHide = null;
  getKey_InitialKeyValue = '';
  getKey_CurrentControl = null;
  getKey_TipName = 'Box';
}

function getKey(event,title,acceptKeys,procedureName,procedureParams,offsetX,offsetY,multiKey,currentControl,gotoControlOnHide,initialKey,tipName){
  if (!document.all) return;
  getKey_Initialize();
  if (multiKey) {
    if ((multiKey).toLowerCase() == 'multikey') getKey_MultiKey = true;
  }
  if (acceptKeys) getKey_AcceptKeys = acceptKeys;
  if (procedureName) getKey_ProcedureName = procedureName;
  if (procedureParams)   getKey_ProcedureParams = procedureParams;
  if (currentControl) getKey_CurrentControl = currentControl; else return; 

  var f = currentControl.form;
  var felems = f.elements;
  var currentControlName = currentControl.name;
  
  for (var i=0;i<felems.length;i++){
    if (currentControlName == felems[i].name) break;
  }
  getKey_GotoControlOnHide = getKey_CurrentControl;
  if (i < felems.length - 1) getKey_GotoControlOnHide = felems[i+1];

  if (gotoControlOnHide) getKey_GotoControlOnHide = gotoControlOnHide;
  if (initialKey) getKey_InitialKeyValue = initialKey;
  if (tipName) getKey_TipName = tipName;
  if (getKey_MultiKey) {  
    onBlurCode = "onblur=\"getKey_hideBox();return\"";
    textSize = 10;
  } else {
    textSize = 3;
    onBlurCode = "onblur=\"setTimeout('getKey_SetFocus()',300);\"";
  }
  
  titleHTML ='';
  if (title) titleHTML = title + ' ';

  var t = "";
  t = t + "<form name=frmAnswer onsubmit='return(false)'>";
  t = t + "<font class=LabelPreviewSmall>" + titleHTML + "</font><input type=text name=ans size=" + textSize + " onkeypress=\"return getKey_OnKeyPress();\" onkeyup=\"return getKey_OnKeyUp();\"" + onBlurCode + ">";
  setTip(event,getKey_TipName,'',t,null,offsetX,offsetY);
  setVisibility(getKey_TipName,'hidden');
  setVisibility(getKey_TipName,'visible');
  setTimeout("getKey_SetFocus();",10);
//  setTimeout("document.all['frmAnswer'].ans.focus()",10);
}

function getKey_SetFocus(){
  if (document.all[getKey_TipName].style.visibility == 'visible') {
    document.all['frmAnswer'].ans.focus();
    document.all['frmAnswer'].ans.value = getKey_InitialKeyValue;
    getKey_InitialKeyValue = '';
  }
}

function getKey_hideBox(){
  if (getKey_GotoControlOnHide) getKey_GotoControlOnHide.focus();
  setVisibility(getKey_TipName,'hidden');
}

function getKey_CallProcedure(){
  getKey_KeyPressed=document.all['frmAnswer'].ans.value;
  if (!getKey_MultiKey) getKey_hideBox();  
  if (getKey_ProcedureName.length > 0) {
    eval(getKey_ProcedureName + "(" + getKey_ProcedureParams + ")");
  }
}

function getKey_OnKeyUp(){
  if (event.keyCode == 8) setTimeout('getKey_Process()',10);
}

function getKey_OnKeyPress(){
  if (event.keyCode == 13 || event.keyCode == 27) {
    var keyCode = event.keyCode;
    event.keyCode = 0;
    getKey_MatchIndex = -1;
    getKey_hideBox();
    if (keyCode == 13) getKey_CallProcedure();
    return false;
  }
  setTimeout('getKey_Process()',10);
}

function getKey_Process(){
  if (getKey_MultiKey) {
    getKey_CallProcedure();
    return;
  }
  var key = document.all['frmAnswer'].ans.value.toLowerCase();
  if (key.length == 0) return;
  if (getKey_AcceptKeys.length > 0) {
    getKey_MatchIndex = getKey_AcceptKeys.indexOf(key)
    if (getKey_MatchIndex == -1) {
      alert("The answer '" + key + "' is not acceptable. Acceptable keys are [" + getKey_AcceptKeys + "].");
      document.all['frmAnswer'].ans.value = '';
      return;
    }
  }
  getKey_CallProcedure();
}

function getKey_SelectOnKeyPress(event,selectControl,gotoControlOnHide,title,offsetX,offsetY,procedureName,procedureParams) {
  if (title == null) title = "<b>Select:</b>";
  if (procedureName == null) procedureName = "getKey_ProcessSelect";
  getKey(event,title,null,procedureName,procedureParams,offsetX,offsetY,'MultiKey',selectControl,gotoControlOnHide,String.fromCharCode(window.event.keyCode));
}

function getKey_SelectOption(list, i) {
  if (list.selectedIndex != i) list.selectedIndex = i;
}

function getKey_ProcessSelect() {
  var list = getKey_CurrentControl;
  var str = getKey_KeyPressed.toLowerCase();
  if (str == "") {
//    getKey_SelectOption(list, 0);
    return;
  }
  for (var i = 0; i < list.options.length; ++i) {
    if (list.options[i].text.toLowerCase().indexOf(str) == 0) {
      getKey_SelectOption(list, i);
      return;
    }
  }
/*
  if (style == 1) {
    for (i = list.options.length - 1; i >= 0; --i) {
      if (str > list.options[i].text.toLowerCase()) {
        select(list, i);
        return;
      }
    }
    select(list, 0);
  }
*/
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// **********IMAGE EXPANDER*************
// http://www.webreference.com/programming/javascript/gr/column8/
// JS below -- image code: 
// <a href="spike.jpg" onclick="this.href = 'javascript:void(0);';"><img src="spike_thumb.jpg" title="click to expand." style="float:right;" onclick="new ImageExpander(this, 'spike.jpg');"></a>

function ImageExpander(oThumb, sImgSrc)
{
	// store thumbnail image and overwrite its onclick handler.
	this.oThumb = oThumb;
	this.oThumb.expander = this;
	this.oThumb.onclick = function() { this.expander.expand(); }
	
	// record original size
	this.smallWidth = oThumb.offsetWidth;
	this.smallHeight = oThumb.offsetHeight;	

	this.bExpand = true;
	this.bTicks = false;
	
	// self organized list
	if ( !window.aImageExpanders )
	{
		window.aImageExpanders = new Array();
	}
	window.aImageExpanders.push(this);

	// create the full sized image.
	this.oImg = new Image();
	this.oImg.expander = this;
	this.oImg.onload = function(){this.expander.onload();}
	this.oImg.src = sImgSrc;
}

ImageExpander.prototype.onload = function()
{
	this.oDiv = document.createElement("div");
	document.body.appendChild(this.oDiv);
	this.oDiv.appendChild(this.oImg);
	this.oDiv.style.position = "absolute";
	this.oDiv.expander = this;
	this.oDiv.onclick = function() {this.expander.toggle();};
	this.oImg.title = "Click to reduce.";
	this.bigWidth = this.oImg.width;
	this.bigHeight = this.oImg.height;
	
	if ( this.bExpand )
	{
		this.expand();
	}
	else
	{
		this.oDiv.style.visibility = "hidden";
		this.oImg.style.visibility = "hidden";
	}
}
ImageExpander.prototype.toggle = function()
{
	this.bExpand = !this.bExpand;
	if ( this.bExpand )
	{
		for ( var i in window.aImageExpanders )
			if ( window.aImageExpanders[i] !== this )
				window.aImageExpanders[i].reduce();
	}
}
ImageExpander.prototype.expand = function()
{
	// set direction of expansion.
	this.bExpand = true;

	// set all other images to reduce
	for ( var i in window.aImageExpanders )
		if ( window.aImageExpanders[i] !== this )
			window.aImageExpanders[i].reduce();

	// if not loaded, don't continue just yet
	if ( !this.oDiv ) return;
	
	// hide the thumbnail
	this.oThumb.style.visibility = "hidden";
	
	// calculate initial dimensions
	this.x = this.oThumb.offsetLeft;
	this.y = this.oThumb.offsetTop;
	this.w = this.oThumb.clientWidth;
	this.h = this.oThumb.clientHeight;
	
	this.oDiv.style.left = this.x + "px";
	this.oDiv.style.top = this.y + "px";
	this.oImg.style.width = this.w + "px";
	this.oImg.style.height = this.h + "px";
	this.oDiv.style.visibility = "visible";
	this.oImg.style.visibility = "visible";
	
	// start the animation engine.
	if ( !this.bTicks )
	{
		this.bTicks = true;
		var pThis = this;
		window.setTimeout(function(){pThis.tick();},25);	
	}
}
ImageExpander.prototype.reduce = function()
{
	// set direction of expansion.
	this.bExpand = false;
}
ImageExpander.prototype.tick = function()
{
	// calculate screen dimensions
	var cw = document.body.clientWidth;
	var ch = document.body.clientHeight;
	var cx = document.body.scrollLeft + cw / 2;
	var cy = document.body.scrollTop + ch / 2;

	// calculate target
	var tw,th,tx,ty;
	if ( this.bExpand )
	{
		tw = this.bigWidth;
		th = this.bigHeight;
		if ( tw > cw )
		{
			th *= cw / tw;
			tw = cw;
		}	
		if ( th > ch )
		{
			tw *= ch / th;
			th = ch;
		}
		tx = cx - tw / 2;
		ty = cy - th / 2; 
	}
	else
	{
		tw = this.smallWidth;
		th = this.smallHeight;
		tx = this.oThumb.offsetLeft;
		ty = this.oThumb.offsetTop;
	}	
	// move 5% closer to target
	var nHit = 0;
	var fMove = function(n,tn) 
	{
		var dn = tn - n;
		if ( Math.abs(dn) < 3 )
		{
			nHit++;
			return tn;
		}
		else
		{
			return n + dn / 10;
		}
	}
	this.x = fMove(this.x, tx);
	this.y = fMove(this.y, ty);
	this.w = fMove(this.w, tw);
	this.h = fMove(this.h, th);
	
	this.oDiv.style.left = this.x + "px";
	this.oDiv.style.top = this.y + "px";
	this.oImg.style.width = this.w + "px";
	this.oImg.style.height = this.h + "px";

	// if reducing and size/position is a match, stop the tick	
	if ( !this.bExpand && (nHit == 4) )
	{
		this.oImg.style.visibility = "hidden";
		this.oDiv.style.visibility = "hidden";
		this.oThumb.style.visibility = "visible";

		this.bTicks = false;
	}
	
	if ( this.bTicks )
	{
		var pThis = this;
		window.setTimeout(function(){pThis.tick();},25);
	}
}
// **********************IMAGE EXPANDER END***************	


/*-----------------------------------------------------------------
'         Module:  form.js
'-----------------------------------------------------------------*/
function Info(obj)
 {
 var r = '\n';
 var numLoops = 0;
 var theObject = obj;
 var msg = "*** Properties " + " ***" + r + r; 
  

     for (var i in theObject)
     {   
         msg += i + " =  " + eval("theObject."  + i) + r;  
         numLoops++;
         if (numLoops % 20 == 0) {
           alert(msg);
           msg = "";
         }
     }
  
     msg += r + "Number of Properties= " + numLoops;
     alert(msg);
//     d.value = msg;
}

var TF_Chars_AlphaUpper="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var TF_Chars_AlphaLower="abcdefghijklmnopqrstuvwxyz";
var TF_Chars_Alpha=TF_Chars_AlphaUpper + TF_Chars_AlphaLower;
var TF_Chars_Digits="0123456789";
var TF_Chars_Name=TF_Chars_Alpha + TF_Chars_Digits + "-";



   function TF_getFrameContentWindow(frameID, frameName)
   {
  
  // to set iframe
    var objFrameID = document.getElementById(frameID);
      cwFrame = null;
      //set up a reference to the window object of the iframe
      if(window.frames && window.frames[frameName]) { //IE5, Konq, Safari
         cwFrame = window.frames[frameName];
      }
      else if(objFrameID.contentWindow) { //IE5.5+, Moz 1.0+, Opera
         cwFrame = objFrameID.contentWindow;
      }
      else { //Moz < 0.9 (Netscape 6.0)
         cwFrame = objFrameID;
      }
      return cwFrame;
   }



function TF_Trim(s,removeQuote)
{ 
  // removes leading and trailing spaces, and returns the shortened string
  // if removeQuote == true then remove double-quote as well

  if (removeQuote == null) removeQuote=true;

  var i = 0;
  var j = 0;

  for (i=0; i<s.length; i++) {
    if (s.charAt(i) != " ") {
       for (j=s.length - 1; j > i; j--) {
         if (s.charAt(j) != " ")
           break;
       }
       break;
    }
  }
  if (i > j)
    i = j;
  if (s.length > 0 && s.charAt(j) != " ")
    j++;
  var s = s.substring(i, j);
  var s2 = '';
  if (removeQuote) {
    for (i=0; i<s.length; i++) {
      if (s.charAt(i) != "\"") s2 = s2 + s.charAt(i);
    }
    s = s2;
  }
  return s;
}

var lastTrimControlName = ''; // To remember the last control that used the trim functions

function TF_TrimField(ctl)
{
  if (lastTrimControlName == ctl.name) return;
  ctl.value = TF_Trim(ctl.value);
  lastTrimControlName = ctl.name;
}

function TF_TrimField_LeaveQuotes(ctl)
{
  if (lastTrimControlName == ctl.name) return;
  ctl.value = TF_Trim(ctl.value,false);
  lastTrimControlName = ctl.name;
}


function CheckParentVisibility(fldname)
{
	var parent = fldname.parentElement;
	if(!parent)
		return;
         
        do
        {
             while(parent.id == "")
             {
                  parent = parent.parentElement;
                  if(!parent)
                     break;
              
             }
             if(parent)
             {
                 //check is part of tabber control - gsk
								 if (parent.id.substr(0,10) == 'tabbertab_') {
									 var tabber = parent.parentElement.tabber;  									   
									 for (var i=0; i < tabber.tabs.length; i++) {
										 if (tabber.tabs[i].div.id == parent.id) break;
									 }
									 if (i < tabber.tabs.length) parent.parentElement.tabber.tabShow(i);									     
								 }

                 //check if part of show hide div - joey
                 if(parent.style.visibility == 'hidden')
                 	parent.style.visibility = 'visible';
                 if(parent.style.display == 'none')
                 	parent.style.display = 'block';
                 parent = parent.parentElement;
             }
         } while(parent);
}

function TF_RequiredOK(fld,fldname)
{
    if (fld.value == "")
    {
    	  alert("Please enter a value for the \"" + fldname + "\" field.");	  
    	  CheckParentVisibility(fld);
    	  fld.focus();
	  return (false);
    }
    return (true);
}

function TF_MinLengthOK(fld,fldname,len){
    if (fld.value.length < len){
      alert("Please enter at least " + len + " characters in the \"" + fldname + "\" field.");
      CheckParentVisibility(fld);
      fld.focus();
      return (false);
    }
    return (true);
}

function TF_MaxLengthOK(fld,fldname,len){
    if (fld.value.length > len){
      alert("Please enter at most " + len + " characters in the \"" + fldname + "\" field.");
      CheckParentVisibility(fld);
      fld.focus();
      return (false);
    }
    return (true);
}


function TF_ValidASCII(fld,fldname)
{
  var checkStr = fld.value;
  var i; 

  for (i=0; i<checkStr.length; i++) {
    if ((checkStr.charAt(i) < " ") || (checkStr.charAt(i) > "~"))
      alert("Please enter only ASCII characters in the \"" + fldname + "\" field.");
      CheckParentVisibility(fld);
      fld.focus();
      return false;
  }
  return true;
}

function TF_ValidChars(fld,fldname,validchars,chartext){
    var checkOK = validchars;
    var checkStr = fld.value;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++){
      ch = checkStr.charAt(i);
      if (checkOK.indexOf(ch) == -1){
        allValid = false;
        break;
      }
    }
    if (!allValid){
     alert("Please enter only " + chartext + " characters in the \"" + fldname + "\" field.");
     CheckParentVisibility(fld);
     fld.focus();
     return (false);
    }
    return (true);
}

function TF_InvalidChars(fld,fldname,invalidchars){
    var checkStr = fld.value;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++){
      ch = checkStr.charAt(i);
      if ((ch < " ") || (ch.charAt(i) > "~") || (invalidchars.indexOf(ch) != -1))
      {
        alert("You have entered an invalid character (\"" + ch + "\") in the \"" + fldname + "\" field.");
        CheckParentVisibility(fld);
        fld.focus();
        return false;
      }
    }
    return (true);
}

function TF_ValidEmail(fld,fldname){

   if (fld.value == "") return (true);
   if (!TF_InvalidChars(fld,fldname,"\"|&;<>!*\\")) return(false);
   if ((fld.value.indexOf('@', 0) == -1) || (fld.value.indexOf('.', 0) == -1)){
     alert("Please enter a valid Internet email address (e.g. abc@xyz.com) in the \"" + fldname + "\" field.");
     CheckParentVisibility(fld);
     fld.focus();
     return (false);
    }
   if (fld.value.indexOf(' ', 0) != -1){
     alert("Sorry, no blank space is allowed in the \"" + fldname + "\" field.");
     CheckParentVisibility(fld);
     fld.focus();
     return (false);
   }
   if (window.RegExp) {
    var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
    
    var email = fld.value;
    var reg1 = new RegExp (reg1str);
    var reg2 = new RegExp (reg2str);
    if (reg1.test(email) || !reg2.test(email)) {
      alert("The \"" + fldname + "\" field does not appear to be a valid email address. Please check it again.");
      return false;
    }
   }
   return (true);
}

function TF_ValidNum(fld,fldname,groupchar,decimalchar,maxdecimals){

  var checkOK = "0123456789-" + groupchar + decimalchar;
  var checkStr = fld.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++){
    ch = checkStr.charAt(i);
    if (checkOK.indexOf(ch) == -1){
        allValid = false;
        break;
    }
    if (ch != groupchar) allNum += ch;
    if (ch == decimalchar) decPoints++;
  }

  if (!allValid){
    alert("Please enter only digit characters in the \"" + fldname + "\" field.");
    CheckParentVisibility(fld);
    fld.focus();
    return ("Invalid");
  }

  if (decPoints > maxdecimals){
    var numtype = "number";
    if (maxdecimals == 0) numtype = "integer";
    alert("Please enter a valid " + numtype + " in the \"" + fldname + "\" field.");
    CheckParentVisibility(fld);
    fld.focus();
    return ("Invalid");
  }
  return (allNum);
}

function TF_ValidDigits(fld,fldname,separatorchars,mindigits,maxdigits,numtype){

  var checkOK = "0123456789-" + separatorchars;
  var checkStr = fld.value;
  var allValid = true;
  var numDigits = 0;

  if (checkStr == "") return(true);
  for (i = 0;  i < checkStr.length;  i++){
    ch = checkStr.charAt(i);
    if (checkOK.indexOf(ch) == -1){
        allValid = false;
        break;
    }
    if (separatorchars.indexOf(ch) == -1) numDigits++;
  }

  if (!allValid){
    alert("Please enter a valid " + numtype + " in the \"" + fldname + "\" field.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }

  if (mindigits > 0 && numDigits < mindigits){
    alert("Please enter at least " + mindigits + " digits in the \"" + fldname + "\" field.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }

  if (maxdigits > 0 && numDigits > maxdigits){
    alert("Please enter at most " + maxdigits + " digits in the \"" + fldname + "\" field.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }
  return (true);
}


function TF_SelectedOK(fld,fldname,numselected,minselected,maxselected){

  if (numselected < minselected){
    var msgText = "one";
    if (minselected > 1) msgText = "at least " + minselected;
    alert("Please select " + msgText + " of the \"" + fldname + "\" options.");
    return (false);
  }
  if (maxselected == 0) return(true);
  if (numselected > maxselected){
    var msgText = "one";
    if (maxselected > 1) msgText = "at most " + maxselected;
    alert("Please select " + msgText + " of the \"" + fldname + "\" options.");
    return (false);
  }
  return (true);
}

function TF_RequiredOK_RadioCheckBox(fld,fldname,minselected,maxselected){
  var numselected = 0;
  if (typeof fld.length == 'undefined'){
    if (fld.checked) numselected++;
  } else {
		for (i = 0;  i < fld.length;  i++){
			if (fld[i].checked) numselected++;
		}
  }		
  
  return (TF_SelectedOK(fld,fldname,numselected,minselected,maxselected));
}

// Returns number of options selected in list/combo box
function TF_GetNumSelected(fld){

  var numselected = 0;
  for (i = 0;  i < fld.length;  i++)
  {
    opt = fld.options[i];
    if (opt.selected && opt.value != "") numselected++;
  }
  return numselected;
}

//Checks for selection in the list/combo box
 
function TF_RequiredOK_SelectList(fld,fldname,minselected,maxselected,disallowfirstoption){
  if (fld.selectedIndex < 0){
    alert("Please select one of the \"" + fldname + "\" options.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }

  if (disallowfirstoption) {
    if (fld.selectedIndex == 0){
      alert("Please enter a value for the \"" + fldname + "\" field.");
      CheckParentVisibility(fld);
      fld.focus();
      return (false);
    }
  }

  var numselected = 0;
  var startoption = 0;
  if (disallowfirstoption) startoption = 1;
  for (var i = startoption;  i < fld.options.length;  i++)
  {
    opt = fld.options[i];
    if (opt.selected){
      numselected++;
      if (opt.value == ""){
        alert("The \"" + fldname + "\" option: '" + opt.text + "' is not a valid selection.  Please choose one of the other options.");
        CheckParentVisibility(fld);
        fld.focus();
        return (false);
      }
    }
  }
  return (TF_SelectedOK(fld,fldname,numselected,minselected,maxselected));
}


function TF_ValidUSZip(fld,fldname){

  var separatorchars = "-";
  var checkOK = "0123456789" + separatorchars;
  var checkStr = fld.value;
  var allValid = true;
  var numDigits = 0;

  if (checkStr == "") return(true);
  for (i = 0;  i < checkStr.length;  i++){
    ch = checkStr.charAt(i);
    if (checkOK.indexOf(ch) == -1){
        allValid = false;
        break;
    }
    if (separatorchars.indexOf(ch) == -1) numDigits++;
  }

  if (!allValid){
    alert("Please enter a valid zip in the \"" + fldname + "\" field.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }

  if (!(numDigits == 5 || numDigits == 9)){
    alert("You cannot have " + numDigits + " digits in the \"" + fldname + "\" field.\n\nPlease enter a valid Zip code.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }
  return (true);
}

function TF_ValidCanadaZip(fld,fldname){
  var separatorchars = " ";
  var checkOK = TF_Chars_Alpha + TF_Chars_Digits + separatorchars;
  var checkStr = fld.value;
  var allValid = true;
  var numDigits = 0;

  if (checkStr == "") return(true);
  for (i = 0;  i < checkStr.length;  i++){
    ch = checkStr.charAt(i);
    if (checkOK.indexOf(ch) == -1){
        allValid = false;
        break;
    }
    if (separatorchars.indexOf(ch) == -1) numDigits++;
  }

  if (!allValid){
    alert("Please enter a valid Canadian Postal Code in the \"" + fldname + "\" field.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }

  if (!(numDigits == 6)){
    alert("You cannot have " + numDigits + " characters in the \"" + fldname + "\" field.\n\nPlease enter a valid Canadian Postal Code.");
    CheckParentVisibility(fld);
    fld.focus();
    return (false);
  }
  return (true);
}


function TF_DeleteOption(selectList,optNum) {
    if (selectList.options.length == 0){
      alert('The list is empty.');
      return(false);
    }
    if (optNum == null) optNum = selectList.selectedIndex; 
    if (optNum == null || optNum < 0){
      alert('Please select the option to delete.');
      return(false);
    }
    selectList.options[optNum] = null;
}

function TF_AddOption(selectList,optText,optValue,defaultSelected,selected,unique) {
    var i;
    if (defaultSelected == null) defaultSelected = true;
    if (selected == null) selected = true;
    if (unique == null) unique = true;

    /* Unselect all the options so far */
    for (i=0;i<selectList.options.length;i++){
      selectList.options[i].selected = false;
    }

    if (unique) {
      for (i=0;i<selectList.options.length;i++){
        if (selectList.options[i].value == optValue){
          selectList.options[i].selected = true;
          return (false);
        }
      }
    }

    var optionName = new Option(optText, optValue, defaultSelected, selected)
    if (document.all || document.getElementById) {
      selectList.options.add(optionName,0);
    }
    if (document.layers) {
      for (i=selectList.options.length;i>0;i--)
        selectList.options[i] = selectList.options[i-1];
      selectList.options[0] = optionName;
      selectList.options[0].defaultSelected = defaultSelected;
      selectList.options[0].selected = selected;     
    }
    return(true);

}
//Adds http:before URL
function TF_FormatURL(fld){
  if (fld.value.length == 0) return;
  if (fld.value.substring(0,1) == "/") return;
  var protocol = fld.value.substring(0,3).toLowerCase();
  if (protocol == "htt" || protocol == "ftp" || protocol == "mai") return;
  fld.value = "http://" + fld.value;
  return true;
}

//Selects All the Options of a Multi-Select List Box
function TF_SelectAll(selectList){
 for (var i=0;i<selectList.options.length;i++)
    selectList.options[i].selected = true; 
}

function TF_GetRadioValue(radioList){
 for (var i=0;i<radioList.length;i++) {
   if (radioList[i].checked) {
     return (radioList[i].value);
     break;
   }
 }
}

function TF_GetSelectValue(selectList){
 for (var i=0;i<selectList.options.length;i++){
   if (selectList.options[i].selected) {
     return (selectList.options[i].value);
     break;     
   }
 }
}

function TF_GetSelectValue(selectList){
  var comma = "";
  var selOptionList = "";
  for (var i=0;i<selectList.options.length;i++){
   if (selectList.options[i].selected && selectList.options[i].value.length > 0) {
     selOptionList = selOptionList + comma + selectList.options[i].value;
     comma = ",";
   }
  }
  return (selOptionList);
}


function TF_GetSelectText(selectList){
  var comma = "";
  var selOptionList = "";
  for (var i=0;i<selectList.options.length;i++){
   if (selectList.options[i].selected && selectList.options[i].text.length > 0) {
     selOptionList = selOptionList + comma + selectList.options[i].text;
     comma = ",";
   }
  }
  return (selOptionList);
}



function TF_GetSelectedText(selectList){
  var comma = "";
  var selOptionList = "";
  for (var i=0;i<selectList.options.length;i++){
   if (selectList.options[i].selected) {
     selOptionList = selectList.options[i].text;
     comma = ",";
   }
  }
  return (selOptionList);
}


function TF_SetSelectValue(selectList,optValue){
 for (var i=0;i<selectList.options.length;i++){
   if (selectList.options[i].value == optValue) {
     selectList.selectedIndex = i;
     return i;
   }
 }
 return null;
}

var TF_Zoom_Field;
var TF_Zoom_Caption;
function TF_Zoom(e,zoomField,caption){
  TF_Zoom_Field = zoomField;
  TF_Zoom_Caption = caption;
  var winURL = '/dzapps/docs/popup/zoom.htm';
  var hwnd=open(winURL,"_blank",'resizable=no,width=550,height=430,left=10,top=10');
  if (!hwnd.opener) hwnd.opener=self;
  if (hwnd.focus) hwnd.focus();
  return (false);
}

function makeGreeting(){
  var today = new Date();
  var dayOfMonth = today.getDate();
  var dayOfWeek = today.getDay();
  var hour = today.getHours();
  var monthOfYear = today.getMonth();
  var year = today.getYear();
  var greeting;

  var dayArray = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  var monthArray = new Array("January","February","March","April","May","June","July","August","September","October","November","December");

  if (hour < "12") {
    greeting = "Good Morning"
    }
  else if (hour >= "12" && hour < "17") {
    greeting = "Good Afternoon"
    }
  else {
    greeting = "Good Evening"
    }

  if (year <= 200) {
    year += 1900;
    }

  greeting = greeting + ". It's " + dayArray[dayOfWeek] + ", " + monthArray[monthOfYear] + " " + dayOfMonth + ", " + year + ".";

  return(greeting);

}

function toggleBlockDisplay(blockID,visibility){
  if (document.getElementById) {
    var current = (document.getElementById(blockID).style.display == 'block' || document.getElementById(blockID).style.display == '') ? 'none' : '';
    if (visibility != null) current = visibility;
    document.getElementById(blockID).style.display = current;
  }
  else if (document.all) {
    current = (document.all[blockID].style.display == 'block') ? 'none' : 'block'
    if (visibility != null) current = visibility;
    document.all[blockID].style.display = current;
  }
}


function TF_GetVarValue(varName,varValueIfUndefined){
   var variableDefined = eval("typeof " + varName + " != 'undefined'");
   if (variableDefined) return(eval(varName));
   return varValueIfUndefined;   
}

function TF_GetYear(theDate) {
	x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}

function TF_AddDate(date1, numDays, DestDateFld)
{	
	if (date1.length==0) return null;
	
		
	var NewDate = new Date(date1);
	NewDate.setDate(NewDate.getDate() + numDays);
/*	
	var objSourceDate = new Date(date1);
        var SourceDateinMs = objSourceDate.getTime();
        var DestDateinMs = SourceDateinMs + 1000 * 60 * 60 *24 * numDays
	var objDestDate = new Date();	
        objDestDate.setTime(DestDateinMs);
	var NewDateYear = objDestDate.getYear();
        if (NewDateYear.toString().length==1) NewDateYear="0"+NewDateYear.toString();
	
	var NewDate=((objDestDate.getMonth() + 1)+"/" + (objDestDate.getDate())+"/"+NewDateYear);
*/
	NewDate=(NewDate.getMonth() + 1)+"/" + (NewDate.getDate())+"/"+TF_GetYear(NewDate);
	if(DestDateFld)
	{
		DestDateFld.value=NewDate;
	}
	return NewDate;
}

function TF_DateAdd(startDate, numDays, numMonths, numYears)
{
	var objStartDate = new Date(startDate);
	var returnDate = new Date(objStartDate.getTime());
	var yearsToAdd = numYears;
	
	var month = returnDate.getMonth()	+ numMonths;
	if (month > 11)
	{
		yearsToAdd = Math.floor((month+1)/12);
		month -= 12*yearsToAdd;
		yearsToAdd += numYears;
	}
	returnDate.setMonth(month);
	returnDate.setFullYear(returnDate.getFullYear()	+ yearsToAdd);	
	returnDate.setTime(returnDate.getTime()+60000*60*24*numDays);
	strReturnDate=((returnDate.getMonth() + 1)+"/" + (returnDate.getDate())+"/"+returnDate.getFullYear());
	return strReturnDate;
}

  
function TF_ReplaceString(string,text,by,all) {

    // Replaces text with by in string
    // If all is false then only one replacement is made
    if (all == null) all = true;
    var strLength = string.length;
    var txtLength = text.length;

    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;

    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (all) {
      if (i+txtLength < strLength) {
        newstr += TF_ReplaceString(string.substring(i+txtLength,strLength),text,by,all);
      }
    } else {
        newstr += string.substring(i+txtLength,strLength);
    }
    

    return newstr;
  
}

function TF_ShowGreeting () {
  var today = new Date()
  var time = today.getTime();
  var dayOfMonth = today.getDate();
  var dayOfWeek = today.getDay();
  var hour = today.getHours();
  var minutes = today.getMinutes();
  var monthOfYear = today.getMonth();
  var yearPast = today.getYear();
 
  var day
  if (dayOfWeek == 1) day = "Monday";
  if (dayOfWeek == 2) day = "Tuesday";
  if (dayOfWeek == 3) day = "Wednesday";
  if (dayOfWeek == 4) day = "Thursday";
  if (dayOfWeek == 5) day = "Friday";
  if (dayOfWeek == 6) day = "Saturday";
  if (dayOfWeek == 0) day = "Sunday";

  var greeting
  if (hour < "12") greeting = "Good Morning";
  if (hour > "11" && hour < "17") greeting = "Good Afternoon";
  if (hour > "16") greeting = "Good Evening";

  var month
  if (monthOfYear == "0") month = "January";
  if (monthOfYear == "1") month = "February";
  if (monthOfYear == "2") month = "March";
  if (monthOfYear == "3") month = "April";
  if (monthOfYear == "4") month = "May";
  if (monthOfYear == "5") month = "June";
  if (monthOfYear == "6") month = "July";
  if (monthOfYear == "7") month = "August";
  if (monthOfYear == "8") month = "September";
  if (monthOfYear == "9") month = "October";
  if (monthOfYear == "10") month = "November";
  if (monthOfYear == "11") month = "December";

  var year
  year = yearPast
  if (year <= 200) year = year + 1900;
  document.write(greeting + "&nbsp;-&nbsp;" + day + " " + month + " " + dayOfMonth +  ", " + year); 
}


function TF_DatePart(strDate){
  var dt = new Date(strDate);
  var yy = dt.getYear();
  var year = (yy < 1000) ? yy + 1900 : yy;
  return dt.getMonth()+1+"/"+dt.getDate()+"/"+ year;
}

function TF_RefreshStaticPageIfNeeded(url) {
  if (location.search.length == 0) {
    var today = new Date(TF_DatePart(new Date()));
    var pgDate = new Date(TF_DatePart(document.lastModified));
    if (pgDate < today) {
      location.href = url;
    } 
  }
}

function TF_RefreshStaticPageAfterMinutes(url,numMinutes) {
  if (location.search.length == 0) {
    var refreshTime = new Date();
    refreshTime.setTime(refreshTime.getTime() - numMinutes * 60000);
    var pgDate = new Date(document.lastModified);
    // alert(refreshTime +"  /  " + pgDate);
    if (pgDate < refreshTime) {
      location.href = url;
    } 
  }
}

  
function TF_ValidateDateRange(fldDate,minDate,maxDate,fldName)
{
	var min = new Date(minDate);
	var max = new Date(maxDate);
        var entered = new Date(fldDate.value);
        if(entered < min || entered > max)
        {
          alert(fldName + " must be between " + minDate + " and " + maxDate);
          CheckParentVisibility(fldDate);
          fldDate.focus();
          return false;
        }
        return true;
}

function TF_StateZZ_CountryRequiredOK(fldState,fldCountry)
{          
	if (fldState.type == 'text') 
	   var zzState = fldState.value;
	else
           var zzState = TF_GetSelectValue(fldState);
  
  // get country value         
       
        if(fldCountry){

	  if (fldCountry.type == 'text') 
	   var zzCountry = fldCountry.value;
	  else
	   var zzCountry = TF_GetSelectValue(fldCountry); 
	   var zzCountry = zzCountry.toUpperCase();   
        }   


//if stats is US territories
if(zzState=="PR" || zzState=="VI" || zzState=="AS" || zzState=="GU"){
  if(fldCountry){
			if(zzCountry == ""){
				alert('Please select a value for Country');
				CheckParentVisibility(fldCountry);
				fldCountry.focus();
				return false;
			}
			if(zzState == "PR"){
						if(zzCountry!="PUERTO RICO"){
						alert('You have selected ' +TF_GetSelectValue(fldState)+ ' as a State. Please select PUERTO RICO for a Country');
						CheckParentVisibility(fldCountry);
						fldCountry.focus();
						return false;
						}
				}	
			if(zzState == "VI"){
						if(zzCountry!="VIRGIN ISLANDS (US)"){
						alert('You have selected ' +TF_GetSelectValue(fldState)+ ' as a State. Please select VIRGIN ISLANDS (US) for a Country');
						CheckParentVisibility(fldCountry);
						fldCountry.focus();
						return false;
						}
				}			
			if(zzState == "AS"){
						if(zzCountry!="AMERICAN SAMOA"){
						alert('You have selected ' +TF_GetSelectValue(fldState)+ ' as a State. Please select AMERICAN SAMOA for a Country');
						CheckParentVisibility(fldCountry);
						fldCountry.focus();
						return false;
						}
				}	
                      if(zzState == "GU"){
						if(zzCountry!="GUAM"){
						alert('You have selected ' +TF_GetSelectValue(fldState)+ ' as a State. Please select GUAM for a Country');
						CheckParentVisibility(fldCountry);
						fldCountry.focus();
						return false;
						}
				}					
		}
	 
}
//if Canadian provinces or territories
      if(zzState == "AB" || zzState == "BC" || zzState == "MB" || zzState == "NB" || zzState == "NS" || zzState == "NT" || zzState == "ON" || zzState == "PE" || zzState == "QC" || zzState == "SK" || zzState == "YT"  || zzState=="NF"){
	if(fldCountry){
				if(zzCountry == "" || zzCountry != "CANADA"){
					alert('You have selected ' +TF_GetSelectValue(fldState)+ ' as a State. Please select CANADA for the Country');
					CheckParentVisibility(fldCountry);
					fldCountry.focus();
					return false;
				}
  
    }
}

// if state is outside USA and Canada	
	if(zzState=="ZZ" || zzState=="--" || zzState=="MP" || zzState=="PW")
	{
		if(fldCountry){
		  if(zzCountry == ""){
				
		    alert('Please select a value for Country');
		    CheckParentVisibility(fldCountry);
		    fldCountry.focus();
		    return false;
			
		  }
		  if(zzState == "--"){
		    if(zzCountry == "USA" || zzCountry == "CANADA"){
					alert('You have selected Outside US & CANADA as a State and ' +zzCountry+' as Country. Please select a different Country or State Code');
						CheckParentVisibility(fldCountry);
						fldCountry.focus();
						return false;		      
		    
		    }
		  }
		  if(zzState == "ZZ"){
		    if(zzCountry == "USA" || zzCountry == "CANADA"){
					alert('You have selected Outside US & CANADA as a State and ' +zzCountry+' as Country. Please select a different Country or State Code');
						CheckParentVisibility(fldCountry);
						fldCountry.focus();
						return false;		      
		    
		    }
		  }
		  
		  
		  if(zzState == "MP"){
		   if(zzCountry != "NORTHERN MARIANA ISLANDS"){
			 alert('You have selected ' +TF_GetSelectValue(fldState)+ ' as a State. Please select NORTHERN MARIANA ISLANDS for the Country');
			 CheckParentVisibility(fldCountry);
			 fldCountry.focus();
		   return false;
		  	}
		  }
      if(zzState == "PW"){
		   if(zzCountry != "PALAU"){
			 alert('You have selected ' +TF_GetSelectValue(fldState)+ ' as a State. Please select PALAU for the Country');
			 CheckParentVisibility(fldCountry);
			 fldCountry.focus();
		   return false;
		  	}
		  }		  
 
		}
	} 
	

      if(zzState=="AL"|| zzState=="AK"|| zzState=="AZ"|| zzState=="AR"|| zzState=="CA"|| zzState=="CO"|| zzState=="CT"|| zzState=="DE"|| zzState=="DC"|| zzState=="FL"|| zzState=="GA"|| zzState=="HI"|| zzState=="IA"||zzState=="ID"|| zzState=="IL"|| zzState=="IN"|| zzState=="KS"|| zzState=="KY"|| zzState=="LA"|| zzState=="ME"|| zzState=="MD"|| zzState=="MA"|| zzState=="MI"|| zzState=="MN"|| zzState=="MS"|| zzState=="MO"|| zzState=="MT"|| zzState=="NV"|| zzState=="NH"|| zzState=="NJ"|| zzState=="NM"|| zzState=="NY"|| zzState=="NC"|| zzState=="ND"|| zzState =="NE"|| zzState=="OH"|| zzState=="OK"|| zzState=="OR"|| zzState=="PA"|| zzState=="RI"|| zzState=="SC"|| zzState=="SD"|| zzState=="TN"|| zzState=="TX"|| zzState=="UT"|| zzState=="VT"|| zzState=="VA"|| zzState=="WA"|| zzState=="WV"|| zzState=="WI"|| zzState=="WY" || zzState=="AA"|| zzState=="YT"|| zzState=="AE"|| zzState=="AP"){

       if(fldCountry){
        if (zzCountry !=""){
        
          if (zzCountry !="USA"){
          
            alert('You have selected "' +  zzState + '", as a state. Please select or type "USA" for the Country');
            CheckParentVisibility(fldCountry);
	          fldCountry.focus();
            return false;
         
          }
        
        }
  
      
      }

    }
	
	return true;
}



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*-----------------------------------------------------------------
'         Module:  cookies.js
'-----------------------------------------------------------------*/
//----------------------------------------------------------------------------
// Set a cookie given a name, value, expiration date, and path
//----------------------------------------------------------------------------


function setCookie (name, value, expires, path) {

  if (path == null) path = "/";
  if (expires == null){
    document.cookie = name + "=" + escape(value) + "; path=" + path;
    return;
  }
  document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() +  "; path=" + path;
}

//----------------------------------------------------------------------------
// Returns the value of the named cookie.
//----------------------------------------------------------------------------

function getCookie(name) {

  var search;

  search = name + "="
  offset = document.cookie.indexOf(search) 
  if (offset != -1) {
    offset += search.length ;
    end = document.cookie.indexOf(";", offset) ;
    if (end == -1)
      end = document.cookie.length;
    return unescape(document.cookie.substring(offset, end));
  }
  else
    return "";
}

//----------------------------------------------------------------------------
// Delete the named cookie.
//----------------------------------------------------------------------------

function deleteCookie(name) {

  var expdate = new Date();
  expdate.setTime(expdate.getTime() - (86400 * 1000 * 1));
  setCookie(name, "", expdate);
}

function TF_DatePart(strDate){
  var dt = new Date(strDate);
  var yy = dt.getYear();
  var year = (yy < 1000) ? yy + 1900 : yy;
  return dt.getMonth()+1+"/"+dt.getDate()+"/"+ year;
}

function TF_RefreshStaticPageIfNeeded(url) {
  if (location.search.length == 0) {
    var today = new Date(TF_DatePart(new Date()));
    var pgDate = new Date(TF_DatePart(document.lastModified));
    if (pgDate < today) {
      location.href = url;
    } 
  }
}

function TF_RefreshStaticPageAfterMinutes(url,numMinutes) {
  if (location.search.length == 0) {
    var refreshTime = new Date();
    refreshTime.setTime(refreshTime.getTime() - numMinutes * 60000);
    var pgDate = new Date(document.lastModified);
    // alert(refreshTime +"  /  " + pgDate);
    if (pgDate < refreshTime) {
      location.href = url;
    } 
  }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*-----------------------------------------------------------------
'         Module:  assess/styles/standard.js
'-----------------------------------------------------------------*/
var boxtip = initTip('Box',1,700,100);
var h = initTip('Help',2,180,100);
h.dzHideDelay = 100;
var t = initTip('ToolMenu',0);
var lookupTip = initTip('Lookup',1,50,50);

var dtToday = new Date();
var dtYear = dtToday.getYear();
if(dtYear<1000) dtYear+=1900;
var Today = (dtToday.getMonth()+1) + "/" + dtToday.getDate() + "/" + dtYear;

// load htmlarea
_editor_url = "/dzapps/docs/htmlarea/";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
 document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
 document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }


function showHelp(event,helpGroup, helpField,nsLeft,nsTop,ieLeft,ieTop){
  var displayHelp = getCookie(webUserID + "_Help_" + helpGroup);
  if (displayHelp == 'no') return;
  var helpVar = helpGroup + "_" + helpField;
  var notOk = eval("typeof " + helpVar + "_Title == 'undefined'");
  if (notOk) return;
  helpTitle = eval(helpVar + "_Title");
  helpText = eval(helpVar + "_Text");
  helpBookmark = helpVar + "_BM";

  if (nsLeft == null) nsLeft = -190;
  if (nsTop == null) nsTop = 0;
  if (ieLeft == null) ieLeft = -190;
  if (ieTop == null) ieTop = 0;
  setTip(event,'Help',helpTitle,helpText,helpBookmark,nsLeft,nsTop,ieLeft,ieTop); 

//  alert("here2"+ helpTitle + helpText);
}

function showInfo(event,helpGroup, helpField,nsLeft,nsTop,ieLeft,ieTop){
  var helpVar = helpGroup + "_" + helpField;
  var notOk = eval("typeof " + helpVar + "_Title == 'undefined'");
  if (notOk) return;
  helpTitle = eval(helpVar + "_Title");
  helpText = eval(helpVar + "_Text");
  helpBookmark = helpVar + "_BM";
  setTip(event,'Help',helpTitle,helpText,helpBookmark,nsLeft,nsTop,ieLeft,ieTop); 
}



function hideHelp(){
  hideTip('Help');
}

function helpOptions(event,helpGroup){
  var displayHelp = getCookie(webUserID + "_Help_" + helpGroup);
  var helpText = (displayHelp == 'no') ? "Show Help Tips" : "Hide Help Tips";
  var t_opt = makeTextMenuItem('ToolMenuTitle','Help Option');
  t_opt = t_opt + makeTextMenuItem('ToolMenu','<a href="javascript:toggleHelp({a}' + helpGroup + '{a})">&nbsp;•&nbsp;' + helpText + '</a>');
  setTip(event,'ToolMenu','',t_opt);
}

function toggleHelp(helpGroup){
  var d = new Date("December 31, 2999");
  var displayHelpField = webUserID + "_Help_" + helpGroup;
  var displayHelp = getCookie(displayHelpField);
  if (displayHelp == 'no') {
    deleteCookie(displayHelpField);
    alert('The pop-up help feature for this section has been turned ON.');
  } else
  {
    setCookie(displayHelpField,'no',d);
    alert('The pop-up help feature for this section has been turned OFF.');
  }
}

function showImage(img,ref) {
 document.images[img].src = ref; 
}

function hideHelp(){
  hideTip('Help');
}

function setTimeOption(fldName,timeValue){
  f[fldName].value = timeValue;
}

function showTimeOptions(event,fldName,bmName,nsLeft,nsTop,ieLeft,ieTop){
  var t_opt = "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
  t_opt = t_opt + "<tr>";
  for (i=1;i<12;i++) {
    var t = i + 'am';
    var t_value = i + ':00 am';
    t_opt = t_opt + "<td style='font-family:arial;font-size:8pt'><a href=\"javascript:setTimeOption('" + fldName + "','" + t_value + "');\">" + t + "</a></td>";
  }

  var t = '12pm';
  var t_value = '12:00 pm';
  t_opt = t_opt + "<td style='font-family:arial;font-size:8pt'><a href=\"javascript:setTimeOption('" + fldName + "','" + t_value + "');\">" + t + "</a></td>";
  t_opt = t_opt + "</tr>";
  t_opt = t_opt + "<tr>";
  for (i=1;i<12;i++) {
    var t = i + 'pm';
    var t_value = i + ':00 pm';
    t_opt = t_opt + "<td style='font-family:arial;font-size:8pt'><a href=\"javascript:setTimeOption('" + fldName + "','" + t_value + "');\">" + t + "</a></td>";
  }
  var t = '12am';
  var t_value = '12:00 am';
  t_opt = t_opt + "<td style='font-family:arial;font-size:8pt'><a href=\"javascript:setTimeOption('" + fldName + "','" + t_value + "');\">" + t + "</a></td>";
  t_opt = t_opt + "</tr>";
  var t_opt = t_opt + "</table>";

  setTip(event,'Box','',t_opt,bmName,nsLeft,nsTop,ieLeft,ieTop); 
}

function showHourOptions(event,fldName,bmName,nsLeft,nsTop,ieLeft,ieTop){
  var t_opt = "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
  t_opt = t_opt + "<tr>";
  for (i=0;i<12;i++) {
    var t = i;
    var t_value = i;
    t_opt = t_opt + "<td style='font-family:arial;font-size:8pt'><a href=\"javascript:setTimeOption('" + fldName + "','" + t_value + "');\">" + t + "</a></td>";
  }
  t_opt = t_opt + "</tr>";
  var t_opt = t_opt + "</table>";
  setTip(event,'Box','',t_opt,bmName,nsLeft,nsTop,ieLeft,ieTop); 
}

function showMinuteOptions(event,fldName,bmName,nsLeft,nsTop,ieLeft,ieTop){
  var t_opt = "<table border=0 cellpadding=3 cellspacing=0 width=100%>";
  t_opt = t_opt + "<tr>";
  for (i=0;i<4;i++) {
    var t = i*15;
    var t_value = i*15;
    t_opt = t_opt + "<td style='font-family:arial;font-size:8pt'><a href=\"javascript:setTimeOption('" + fldName + "','" + t_value + "');\">" + t + "</a></td>";
  }
  t_opt = t_opt + "</tr>";
  var t_opt = t_opt + "</table>";
  setTip(event,'Box','',t_opt,bmName,nsLeft,nsTop,ieLeft,ieTop); 
}

function popAssessments(event,clientID,clientName){

 var notOk = eval("typeof asm_nums_" + clientID + " == 'undefined'");
  if (notOk){
    setTip(event,'Box',clientName,'No Existing Activity!');
    return;
  }

  var asm_nums = eval('asm_nums_' + clientID);
  var asm_nums_array = asm_nums.split("|");
  var asm_registered = eval('asm_registered_' + clientID);
  var asm_registered_array = asm_registered.split("|");
  var asm_assessedBy = eval('asm_assessedBy_' + clientID);
  var asm_assessedBy_array = asm_assessedBy.split("|");
  var asm_assessedOn = eval('asm_assessedOn_' + clientID);
  var asm_assessedOn_array = asm_assessedOn.split("|");
  var asm_createdOn = eval('asm_createdOn_' + clientID);
  var asm_createdOn_array = asm_createdOn.split("|");
  var asm_updatedOn = eval('asm_updatedOn_' + clientID);
  var asm_updatedOn_array = asm_updatedOn.split("|");
  var asm_seqNum = eval('asm_seqNum_' + clientID);
  var asm_seqNum_array = asm_seqNum.split("|");
  var asm_status = eval('asm_status_' + clientID);
  var asm_status_array = asm_status.split("|");
  var asm_level = eval('asm_level_' + clientID);
  var asm_level_array = asm_level.split("|");
  var asm_category1 = eval('asm_category1_' + clientID);
  var asm_category1_array = asm_category1.split("|");
  var asm_category2 = eval('asm_category2_' + clientID);
  var asm_category2_array = asm_category2.split("|");

  var t = "<table cellpadding=0 cellspacing=0 border=0>";
  t = t + "<tr><td bgcolor=#99cccc width=100%>";
  t = t + "<table cellpadding=2 cellspacing=2 border=0>";
  t = t + "<tr>"
  t = t + "<td nowrap class=ColumnHeader align=center>ID</td>"
  t = t + "<td nowrap class=ColumnHeader align=center>Updated</td>"
  t = t + "<td nowrap class=ColumnHeader align=center>By</td>"
  t = t + "<td nowrap class=ColumnHeader align=center>Date</td>"
//  t = t + "<td nowrap class=ColumnHeader align=center>Created</td>"
//  t = t + "<td nowrap class=ColumnHeader align=center>Seq#</td>"
  t = t + "<td nowrap class=ColumnHeader align=center>Status</td>"
 // t = t + "<td nowrap class=ColumnHeader align=center>Level</td>"
 // t = t + "<td nowrap class=ColumnHeader align=center>Category1</td>"
 //t = t + "<td nowrap class=ColumnHeader align=center>Category2</td>"
  t = t + "</tr>";
  for (i=0;i<asm_nums_array.length;i++){
    var useClass = 'Class=RowData';
    if (asm_status_array[i] != 'Completed') useClass='Class=RegisteredAssessment';
    t = t + "<tr>";
    t = t + "<td nowrap " + useClass + "><a href=get?Action=CreateRecord&SubAction=EditAssessment" + "&pAssessmentID=" + asm_nums_array[i] +  "&pSection=Review>" + asm_nums_array[i] + "</a></td>";
    t = t + "<td nowrap align=center " + useClass + ">" + asm_updatedOn_array[i] + "</td>";
    t = t + "<td nowrap align=center " + useClass + ">" + asm_assessedBy_array[i] + "</td>";
    t = t + "<td nowrap align=center " + useClass + ">" + asm_assessedOn_array[i] + "</td>";
//    t = t + "<td nowrap align=center " + useClass + ">" + asm_createdOn_array[i] + "</td>";
//    t = t + "<td nowrap align=center " + useClass + ">" + asm_seqNum_array[i] + "</td>";
    t = t + "<td nowrap align=center " + useClass + ">" + asm_status_array[i] + "</td>";
 //   t = t + "<td nowrap align=center " + useClass + ">" + asm_level_array[i] + "</td>";
 //   t = t + "<td nowrap align=center " + useClass + ">" + asm_category1_array[i] + "</td>";
 //   t = t + "<td nowrap align=center " + useClass + ">" + asm_category2_array[i] + "</td>";
    t = t + "</tr>";
  }
  t = t + "</table>";
  t = t + "</td></tr>";
  t = t + "</table>";  

  setTip(event,'Box',clientName,t,null,0,10);
}

function showAttributeGroupsMenu(event,groupcode,groupdisplay,delRetPage){

  var delMSG = "This will delete the Attribute Group . Are you sure you wish to do this?";

  var t = "<table cellpadding=3 cellspacing=0 border=0>";
  
  t = t + "<tr>";
  t = t + "<td nowrap class=DataPreviewSmall>• " + "<a href=\"get?Action=Admin&SubAction=EditThisAttributeGroup&pGroup=" + groupcode + "&pAttributeGroupName=" + groupdisplay + "\">Edit " + unescape(groupdisplay) + "</td>";
  t = t + "</tr>";

  if (!groupcode == '') {
    t = t + "<tr>";
    t = t + "<td nowrap class=DataPreviewSmall>• " + "<a onclick=\"return(confirm('This will permanently delete this Attribute Group record. Are you sure you want to do this?'));\" href=\"get?Action=Admin&SubAction=DeleteThisAttributeGroup&pGroup=" + groupcode + "&pReturnPage=" + delRetPage + "\">Delete " + unescape(groupdisplay) + "</td>";
    t = t + "</tr>";
    t = t + "<tr>";
    t = t + "<td nowrap class=DataPreviewSmall>• " + "<a href=\"get?Action=Admin&SubAction=AddAttributes&pGroup=" + groupcode + "\">Add Attributes</a></td>";
    t = t + "</tr>";
    t = t + "<tr>";
    t = t + "<td nowrap class=DataPreviewSmall>• " + "<a href=\"get?Action=Admin&SubAction=EditAttributes&pFilterAttrGroup=" + groupcode + "\">Edit Group's Attributes</a></td>";
    t = t + "</tr>";
    t = t + "<tr>";
    t = t + "<td nowrap class=DataPreviewSmall>• " + "<a href=\"get?Action=Admin&SubAction=SortOrder&pSortParmFile=Attributes&pSortAttributeGroup=" + groupcode  + "\">Sort Group's Attributes</a></td>";
    t = t + "</tr>";
    }

  t = t + "</table>";
  
  groupdisplay = unescape(groupdisplay);
  
  setTip(event,'Box',groupdisplay + " Group Menu",t,null,0,15);
  
  }
  
function showAttributesMenu(event,attrcode,attrdisplay,del){

  var editLink = "<a href=\"get?Action=Admin&SubAction=EditThisAttribute&pCode=" + attrcode + "\">";

  var delMSG = "Delete Attribute " + unescape(attrdisplay) + "? Are you sure?";

  var delLink = "<a href=\"get?Action=Admin&SubAction=DeleteThisAttribute&pCode=" + attrcode + "\" onclick=\"return(confirm(delMSG));\">";

  var t = "<table cellpadding=3 cellspacing=0 border=0>";
  
  t = t + "<tr>";
  t = t + "<td nowrap class=DataPreviewSmall>• " + editLink + "Edit</a></td>";
  t = t + "</tr>";

  if (del) {
    t = t + "<tr>";
    t = t + "<td nowrap class=DataPreviewSmall>• " + delLink + "Delete</a></td>";
    t = t + "</tr>";
    }
  
  t = t + "</table>";
  
  attrdisplay = unescape(attrdisplay);
    
  setTip(event,'Box',attrdisplay + " Menu",t,null,0,15);
}

function showDetails(event,clientID,clientName){
  var arrayCaptions = details_fields_captions.split("|");
  var data = eval('details_' + clientID).replace(/{lt}/g,'<');
  var arrayFieldData = data.split("|");
  var arrayAligns = details_fields_aligns.split("|");
  var editLink = "get?Action=CreateRecord&SubAction=EditClient&pClientID=" + clientID;
  var previewLink = "get?Action=CreateRecord&SubAction=PreviewClient&pClientID=" + clientID;

  var t = "<table cellpadding=0 cellspacing=0 border=0 align=center>";
  t = t + "<tr><td bgcolor=#99cccc width=100%>";
  t = t + "<table cellpadding=2 cellspacing=2 border=0>";
  t = t + "<tr>";
  for (i=0;i<arrayCaptions.length;i++){
   t = t + "<td nowrap class=ColumnHeader align=" + arrayAligns[i] + ">" + arrayCaptions[i] + "</td>";
  }
   t = t + "<td nowrap class=RowData rowspan=2 nowrap>• <a href=" + editLink + ">Edit</a><br>• <a href=" + previewLink + ">Preview</a></td>";
  t = t + "</tr>";
  t = t + "<tr>";
  for (i=0;i<arrayFieldData.length;i++){
   var d = arrayFieldData[i];
   if (d.substring(0,7) == '<script') {
    d = eval(d.match(/write.*script/i)[0].slice(6,-10).replace(/{a}/g,"'"));    
   }

   t = t + "<td nowrap class=RowData align=" + arrayAligns[i] + ">" + d + "</td>";
  }
  t = t + "</tr>";
  t = t + "</table>";
  t = t + "</td></tr>";
  t = t + "</table>";  
  setTip(event,'Box',clientName,t,null,0,10);
}

function showAssessmentSummary(event,tool,summaryType,assessID){
  var asm_Summary = eval('asm_Summary_' + summaryType + "_" + assessID); 
  var t = asm_Summary; 
  setTip(event,'Box',tool,t,null,0,10);

}

function showTools(event,toolNum,clientID,assessmentCaption){
  if (assessmentCaption == null) assessmentCaption = "Activity";
  var t_opt = '';
  var linkPostFix ='';
  var t_basehref = '<a href=get?Action=CreateRecord&pClientID='+ clientID;
  t_opt = t_opt + "<span class=LabelSmall>";
  t_opt = t_opt + "· " + t_basehref + "&SubAction=EditClient>Edit</a>";
  t_opt = t_opt + "<br>"
  t_opt = t_opt + "· " + t_basehref + "&SubAction=PreviewClient>Preview</a>";

  if (toolNum >= 1) {
    t_opt = t_opt + "<br>"
    t_opt = t_opt + "· " + t_basehref + "&SubAction=ListAssessments>List " + assessmentCaption + "</a>";
    t_opt = t_opt + "<hr noshade size=1>";
    t_opt = t_opt + "Create New...<br>";
    for (var i=1;i<=toolNum;i++){
      tool = eval('tool_' + i);
      t_opt = t_opt + " &nbsp;&nbsp;";
      t_opt = t_opt + "·&nbsp;";
      t_opt = t_opt + "<a href=get?Action=CreateRecord&SubAction=CreateAssessment&pClientID="+ clientID + "&fTool=" + tool +  ">" + tool + "</a>";
    }
  }
  t_opt = t_opt + "</span>";
  t_opt = t_opt + "<form target=_blank action=get method=post>"
  t_opt = t_opt + "<input type=hidden name=FORM_QueryString value=action=searchrecords&subaction=searchlistclient&ClientIDList=" + clientID + "&pClientID=" + clientID + "&pLabel=Yes&pPrint=Yes>"
  t_opt = t_opt + "<font class=n8>Skip </font> <input type=text name=pSkipLabels size=2 maxlength=2><input type=submit name=Label value=Label>"
  t_opt = t_opt + "</form>"
  setTip(event,'Box','',t_opt);
}

function showLookupForm(event){
  if (agencyClientIDCaption == null) agencyClientIDCaption = "ID";
  var t = "";
  t = t + "<form action='get'>";
  t = t + "<input type=hidden name=action value=CreateRecord>";
  t = t + "<input type=hidden name=subaction value=ListSelectClient>";
  t = t + "<table cellpadding=0 cellspacing=0 border=0 align=center>";
  
  if (VisibleclientID == "Yes") {  
  t = t + "<tr>"
  t = t + "<td class=LabelSmall>" + clientCaption + " ID:&nbsp;</td>";
  t = t + "<td><input type=text name=pClientID size=15 maxlength=15 onfocus='enterKey_enable=true;' onblur='enterKey_enable=false;' onchange='this.value=extractNumber(this.value);'></td>";
  t = t + "</tr>";
  }

  t = t + "<tr>"
  t = t + "<td class=LabelSmall>" + agencyClientIDCaption + ":&nbsp;</td>";
  t = t + "<td><input type=text name=pAgencyClientID size=15 maxlength=25 onfocus='enterKey_enable=true;' onblur='enterKey_enable=false;'></td>";
  t = t + "</tr>";

  if (visibleCompany == "Yes") {
    t = t + "<tr>"
    t = t + "<td class=LabelSmall>Company:&nbsp;</td>";
    t = t + "<td><input type=text name=pCompanyName size=15 maxlength=25 onfocus='enterKey_enable=true;' onblur='enterKey_enable=false;' onchange='this.value=TF_Trim(this.value)'></td>";
    t = t + "</tr>";
  }
  t = t + "<tr>"
  t = t + "<td class=LabelSmall>First Name:&nbsp;</td>";
  t = t + "<td><input type=text name=pFirstName size=15 maxlength=25 onfocus='enterKey_enable=true;' onblur='enterKey_enable=false;' onchange='this.value=TF_Trim(this.value)'></td>";
  t = t + "</tr>";
  t = t + "<tr>"
  t = t + "<td class=LabelSmall>Last Name:&nbsp;</td>";
  t = t + "<td><input type=text name=pLastName size=15 maxlength=25 onfocus='enterKey_enable=true;' onblur='enterKey_enable=false;' onchange='this.value=TF_Trim(this.value)'></td>";
  t = t + "</tr>";
  if (visibleSSN == "Yes") {
    t = t + "<tr>"
    t = t + "<td class=LabelSmall>" + ssnCaption + ":&nbsp;</td>";
    t = t + "<td><input type=text name=pSSN size=11 maxlength=11 onfocus='enterKey_enable=true;' onblur='enterKey_enable=false;' onchange='this.value=extractDigits(this.value)'></td>";
    t = t + "</tr>";
  }
  if (visibleEmail == "Yes") {
    t = t + "<tr>"
    t = t + "<td class=LabelSmall>Email:&nbsp;</td>";
    t = t + "<td><input type=text name=pEmail size=15 maxlength=50 onfocus='enterKey_enable=true;' onblur='enterKey_enable=false;'></td>";
    t = t + "</tr>";
  }
  t = t + "<tr>"
  t = t + "<td class=LabelSmall>&nbsp;</td>";
  t = t + "<td align=right class=LabelSmall><a href='get?action=CreateRecord&webid="+webID+"&subaction=LookupClient'>Advanced" + "</a> &nbsp;&nbsp; <input type=Submit value=Submit></td>";
  t = t + "</tr>";
  t = t + "</table>";
  t = t + "<input type=hidden name=webid value=" + webID +"></form>";

  setTip(event,'Box','',t);  
}

function validate(f){return true;}
function isValidAgencyClientID(){return true;}

function extractAgencyClientID(s){
  return s;
}

function extractDigits(s){
  return s.replace(/[^0-9]/g,'');
}

function extractPhone(s){
  return s.replace(/[^0-9x]/g,'');
}

function extractNumber(s){
  var minus = "";
  if (s.charAt(0) == "-") minus = "-";
  return minus + s.replace(/[^0-9.]/g,'');
}

function extractCurrency(ss){
  var sn = extractNumber(ss);
  if (sn.length == 0) return sn;
  var sf = parseFloat(sn);
  var s = Math.round(sf*100)/100;
  var s = s + "";
  var minus = "";
  if (s.charAt(0) == "-") minus = "-";
  var v = "";
  var v = s.replace(/[^0-9.]/g,'');
  var v_array = v.split('.');
  if (v_array.length > 2) {
    alert('Invalid Currency Format: ' + v);
  }
  var decimal = "00";
  if (v_array.length >= 2) {
    var decimal = v_array[1];
    if (v_array[1].length > 2) {
      decimal = decimal.substring(0,2);
    }
    if (decimal.length == 0) decimal = '00';
  }
  if (decimal.length == 1) decimal = decimal + "0";
  var integer = v_array[0];
  if (integer.length == 0) integer = '0';
  v = minus + integer + '.' + decimal;
  return v;
}


function makeUpperCase(fld){
  fld.value = fld.value.toUpperCase();
}

function makeProperCase(fld){
  if (fld.value.length == 0) return;
  fld.value = fld.value.charAt(0).toUpperCase() + fld.value.substr(1,fld.value.length);
}


function isValidSSN(fld, fldname){
  var p = extractDigits(fld.value);
  if (p.length == 0 || p.length == 9) return true;
  alert("Please enter a valid 9 digit number in the \"" + fldname + "\" field.");
  fld.focus();
  return false;
}

function isValidAgencyClientID(fld, fldname){
  return true;
  // Sample Code
  var p = extractDigits(fld.value);
  if (p.length == 0 || p.length == 9) return true;
  alert("Please enter a valid 9 digit number in the \"" + fldname + "\" field.");
  fld.focus();
  return false;

}

function formatAgencyClientID(s){
  return(s);
}

function formatPhone(s){
  var parray = s.split('x');
  var phone = unformatPhone(parray[0]);
  var x = '';
  var p = phone;
  var c = '';
  if (parray.length > 1) {
   x = 'x' + parray[1];
  }
  if (p.length <= 4) return(p+x);
  if (p.length <= 7) return(p.substring(0,p.length-4) + "-" + p.substring(p.length-4)+x); 
  return(p.substring(0,p.length-7) + "-" + p.substring(p.length-7,p.length-4) + "-" + p.substring(p.length-4)+x); 
}

function unformatPhone(s){
 return s.replace(/[^0-9x]/g,'');
}

function formatAge(s){
  return s.replace(/[^0-9x]/g,'');
}

function formatSSN(s){
  var p = extractDigits(s);
  if (p.length <= 4) return(p);
  if (p.length <= 6) return(p.substring(0,p.length-4) + "-" + p.substring(p.length-4)); 
  if (p.length > 9) p = p.substring(p.length-9);
  if (p.length <= 9) return(p.substring(0,p.length-6) + "-" + p.substring(p.length-6,p.length-4) + "-" + p.substring(p.length-4)); 

}

function formatZip(s){
  var p = s.replace(/[^0-9a-zA-Z]/g,'').toUpperCase();
  if (p.length <= 6) return(p);
  if (p.length > 9) p = p.substring(p.length-9);
  if (p.length <= 9) return(p.substring(0,5) + "-" + p.substring(5,p.length)); 
}

function unformatZip(s){
  var p = s.replace(/[^0-9a-zA-Z]/g,'').toUpperCase();
  return p;
}

function getDate(fldName,event){
  window.fldDate=document.forms['shell'][fldName];
  openCal(event,window);
  return(false);
}

function initForm(){}

function resetForm(){
   if (typeof f == 'undefined') var f = document.forms.shell;
   f.reset();
   initForm();
}

var multiselectCaption = null;
var multiselectOptionField = null;
var multiselectValueField = null;

function openMultiSelect(e,selectFieldName,valueFieldName,caption){
  multiselectCaption  = caption;
  multiselectOptionField = document.forms.shell[selectFieldName];
  multiselectValueField = document.forms.shell[valueFieldName];
  winMultiSelect=openWinTip(e,'/dzapps/docs/popup/multiselect.htm','_blank','resizable=yes',600,310);
}

function setSelectDefault(selectFieldName,valueFieldName){
    var f = document.shell;
    if (!f[selectFieldName]) return;
    var selectField = f[selectFieldName];
    var valueList = f[valueFieldName].value;
    var valueArray = valueList.split(",");
    if (valueArray.length == 1) TF_SetSelectValue(selectField,valueList)
    if (valueArray.length > 1) TF_SetSelectValue(selectField,"+")     
  }
  
function setMultiSelect(event,selectFieldName,valueFieldName,caption){
    var f = document.shell;
    var selectField = f[selectFieldName];
    var valueField = f[valueFieldName];
    var selectValue = TF_GetSelectValue(selectField);
    if (selectValue == "" || selectValue == "-" || selectValue == "--") {
      valueField.value = "";
      return;
    }
    if (selectValue == "+") {
      openMultiSelect(event,selectFieldName,valueFieldName,caption);
      return;
    }
    valueField.value = selectValue;
}

var enterKey = false;
var enterKey_enable = false;
function noSubmitOnEnterKey(e){
  if (!document.all) return;
  if (enterKey_enable) return;
  enterKey = (event.keyCode == 13);
  if (enterKey) {
    alert('The ENTER key is disabled for this page. Try pressing TAB or use your mouse.');
    return false;
  }
}

function formatDate(s){

  if (s.length == 0) return "";
  if (s.substring(0,1) == "+" || s.substring(0,1) == "-") return s;

  var today = new Date();
  var thisDay   = today.getDate();
  var thisMonth = today.getMonth() + 1;
  
  if ((thisMonth + "").length == 1) thisMonth = "0" + thisMonth;

  var thisYear  = today.getYear() < 1000 ? today.getYear() + 1900 : today.getYear();
  
  var thisCentury  = parseInt(thisYear/100) * 100;
  var lastCentury = thisCentury - 100;
  s.replace(".","/");
  s.replace("-","/");
  if (s.indexOf("/") >= 0) {
    var arrDate = s.split("/");
   
   
  
    var month = extractDigits(arrDate[0]).substr(0,2);
    if ((month + "").length == 0) month = 1;   
    if (month < 1 || month > 12) month = 1;
    if ((month + "").length == 1) month = "0" + month;   

 
    if (arrDate.length > 1) {
      var day = extractDigits(arrDate[1]).substr(0,2);
      if ((day + "").length == 0) day = 1;   
      if (day < 1 || day > 31) day = 1;
      if ((day + "").length == 1) day = "0" + day;   
    } else month = thisMonth;

    if (arrDate.length > 2) {
    
     var year = extractDigits(arrDate[2]).substr(0,4);
     
      if ((year + "").length == 0) year = thisYear;
      year = parseFloat(year);
      
 
      if (year < 1) year = thisYear; 

      if (year <= 30) year = year + parseInt(thisCentury);
      if (year <= 999) year = year + parseInt(lastCentury);
    } else year = thisYear;
    
    
    if (year < 1800) year = thisYear;
    if (year > 5000) year = thisYear;
    return (month + "/" + day + "/" + year);
  }


/*
  if (s.indexOf("/") == s.lastIndexOf("/")) return s + "/" + thisYear;
  if (s.indexOf("/") >= 0) return s;
*/
  var p = extractDigits(s);

  
  if (p.length <= 2) return p + "/" + thisMonth + "/" + thisYear;
  if (p.length == 3) return p.substring(0,1) + "/" + p.substring(1,3)  + "/" + thisYear;
  if (p.length == 4) return p.substring(0,2) + "/" + p.substring(2,4)  + "/" + thisYear;
  if (p.length == 5) return p.substring(0,1) + "/" + p.substring(1,3)  + "/" + parseInt(thisCentury + parseInt(p.substring(3,5)));
//  alert("Guru Changed here" + parseFloat(p.substring (4,6)));
 // if (p.length == 6) return p.substring(0,2) + "/" + p.substring(2,4)  + "/" + parseInt(thisCentury + parseInt(p.substring(4,6)));
  if (p.length == 6) return p.substring(0,2) + "/" + p.substring(2,4)  + "/" + parseInt(thisCentury + parseFloat(p.substring(4,6)));
  if (p.length == 7) return p.substring(0,1) + "/" + p.substring(1,3)  + "/" + p.substring(3,7);
  if (p.length == 8) return p.substring(0,2) + "/" + p.substring(2,4)  + "/" + p.substring(4,8);
  if (p.length > 8) return formatDate(p.substring(0,8));
  return ""; 
}

function deleteWarning(){
  if (confirm("Are you sure you want to delete this record?")) return(true);
  return(false);
}


function sendEmailWarning(){
  if (confirm("Are you sure you want to send email?")) return(true);
  return(false);
}

function formatURL(fld){
  if (fld.value.length == 0) return;
  if (fld.value.substring(0,1) == "/") return;
  var protocol = fld.value.substring(0,3).toLowerCase();
  if (protocol == "htt" || protocol == "ftp" || protocol == "mai") return;
  fld.value = "http://" + fld.value;
  return true;
}

function showPreviewClientMenu(clientID){}

function pollVote(frmPoll){
       if (frmPoll.ViewResults.value == '') {
         answerFound = false;
         for (var i=0; i<frmPoll.pAnswerNum.length; i++) {
           if(frmPoll.pAnswerNum[i].checked) {
             answerFound = true;
           }
         }
         if (!answerFound) {
           alert('Please select an option');
           return(false);
         }
       }
       openWinTip(event,'/dzapps/docs/blank.htm','poll','scrollbars=yes',400,300);
       return true;
}

function pollView(frmPoll){
       frmPoll.ViewResults.value = 'true';
       pollVote(frmPoll);
       frmPoll.submit()
       frmPoll.ViewResults.value = '';       
}

function setStatus(statusCode,recordTypeID,nomsg){
  TF_SetSelectValue(f.Status,statusCode);
  TF_SetSelectValue(f.Code1ID,recordTypeID);
  var today = new Date();
  f.StatusUpdatedOn.value=Today;
  var statusDesc = f.Status.options[f.Status.selectedIndex].text;
  var recordTypeDesc = f.Code1ID.options[f.Code1ID.selectedIndex].text;
  if (!nomsg) alert("The record has been marked as follows:\n\nStatus: " + statusDesc + "\nRecord Type: " + recordTypeDesc + submitmessage);
}

function goLink(){return true};

function fixLinks(host,sslhost){
   // host = non secure domain = APP_Domain
 if (location.href.toLowerCase().indexOf(sslhost.toLowerCase()) == -1) return;
 var s="";
  for (i=0;i<document.links.length;i++){
   var link = document.links[i];
   var href = link.href;
   // If not dzapps link and not an external link then transform it to the non-secure internal link
   if (href.indexOf("///") >= 0) {   
     document.links[i].href = href.replace("///","/");
   } else {
	   if (href.indexOf("/dzapps/") < 0 && href.indexOf("/webapps/") < 0 && href.indexOf(location.host) >= 0) {
	     var newlink = host + link.pathname;
	     if (link.search) newlink = newlink + link.search;
	     if (link.hash) newlink = newlink + link.hash;
	     document.links[i].href = newlink;
	     s = s+document.links[i].href+ "\n"
	   }
   }
  } 
}

  function redirectLogin(webid,loginLink, welcomeLink){
    var cookieName = "MEM_Name_" + webid.toUpperCase();
    loginName = getCookie(cookieName);
    if (!welcomeLink) welcomeLink = "/dzapps/dbzap.bin/apps/webmembers/secure/welcome?webid=" + webid;
    if (!loginLink) loginLink = welcomeLink;  
    var redirectLink =  welcomeLink;
    if (loginName.length == 0) redirectLink=loginLink;
    location.href = redirectLink;
  }
