/*
DateClick Popup Date Picker Copyright 2005 Primoris Software, all rights reserved.
http://www.primorissoftware.com
THIS COPY OF DATECLICK IS NOT LICENSED FOR COMMERCIAL USE.
Please purchase a Professional or Developer license if using DateClick in a "for profit" environment. Unauthorized use of this software is illegal and violates the terms of the EULA.
*/
function calendar(aN){this.Version="1.42basic";this.bD=0;this.bE=0;this.bF=0;this.by=new f(aN);this.bC=new Date();this.bA=this.bC.getFullYear();this.dc=glbCalendars.length;this.aO=Array(43);this.aryMonths=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");this.aryDays=Array("S","M","T","W","T","F","S","S");this.aryDaysShort=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");this.FullMonthNames=['January','February','March','April','May','June','July','August','September','October','November','December'];this.FullDayNames=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];this.aC="Please select a future date";glbCalendars[glbCalendars.length]=this;this.bP="caldiv_"+this.dc;this.cw=false;this.Div=null;this.aG=null;this.cu=false;this.isOpen=false;this.cy=0;this.cz=0;this.rect={x:0,y:0,dx:0,dy:0};this.cL={x:0,y:0,dx:0,dy:0};this.ea={x:0,y:0,dx:0,dy:0};this.dG="";this.bV=false;this.dh=true;var cv=(navigator.userAgent.toLowerCase().indexOf("db")!=-1);this.aR=cv?"title":"alt";this.aQ=Array(3);this.dH="";this.cr=null;this.eb=null;this.cM=null;this.bc=this.by.Item("FIELD")?eval(this.by.Item("FIELD")):null;this.be=this.by.Item("FORMAT")?this.by.Item("FORMAT"):"0";this.aZ=this.by.Item("DELIMITER")?this.by.Item("DELIMITER"):"/";this.bg=false;switch(this.be){case "1":this.bk="D"+this.aZ+"M"+this.aZ+"YYYY";break;case "2":this.bk="YYYY"+this.aZ+"M"+this.aZ+"D";break;default:this.bk="M"+this.aZ+"D"+this.aZ+"YYYY";}this.bw=true;this.bn=false;this.aX=true;this.aY=2000;this.bd=0;this.bi=null;this.bj=null;this.bl=1;this.bv=1;this.bb=false;this.aW=true;this.bm=0;this.ba="basic";this.bs=0;this.bf=null;this.bq="Click here to visually select a date with DateClick...";this.bp=0;this.bo=0;this.bt=0;this.bu=0;if(this.by.Item("ZEROS"))this.dG+="ZEROS\n";if(this.by.Item("MOUSEOVER"))this.dG+="MOUSEOVER\n";if(this.by.Item("SHOWDAYS"))this.dG+="SHOWDAYS\n";if(this.by.Item("DELAY"))this.dG+="DELAY\n";if(this.by.Item("BEGINONMONDAY"))this.dG+="BEGINONMONDAY\n";if(this.by.Item("ICONLEFT"))this.dG+="ICONLEFT\n";if(this.by.Item("ICONTOP"))this.dG+="ICONTOP\n";if(this.by.Item("DIR"))this.dG+="DIR\n";if(this.by.Item("MONTH"))this.dG+="MONTH\n";if(this.by.Item("SHADOW"))this.dG+="SHADOW\n";if(this.by.Item("CLOSE"))this.dG+="CLOSE\n";if(this.by.Item("YEAR"))this.dG+="YEAR\n";if(this.by.Item("MOVEMODE"))this.dG+="MOVEMODE\n";if(this.by.Item("INVALID"))this.dG+="INVALID\n";if(this.by.Item("FUNCTION"))this.dG+="FUNCTION\n";if(this.by.Item("TOOLTIP"))this.dG+="TOOLTIP\n";if(this.by.Item("STATIC"))this.dG+="STATIC\n";if(this.by.Item("POSITION"))this.dG+="POSITION\n";var dm=new RegExp("^D","i");switch(this.be){case "1":this.dh=false;break;case "2":this.dh=false;break;default:if(dm.test(this.bk))this.dh=false;}this.dX=this.bq;var dN;if(this.ba){if(this.ba.indexOf("/")>=0){dN=this.ba.split("/");this.aV=dN[dN.length-1];}else{this.aV=this.ba?this.ba:"basic";}}else{this.aV=this.ba?this.ba:"basic";}this.au=au;this.R=R;this.U=U;this.T=T;this.aw=aw;this.av=av;this.nextMonth=nextMonth;this.prevMonth=prevMonth;this.nextYear=nextYear;this.prevYear=prevYear;this.ac=ac;this.ab=ab;this.Y=Y;this.V=V;this.ax=ax;this.B=B;this.C=C;this.F=F;this.writeCalendar=writeCalendar;this.ai=ai;this.aj=aj;this.ak=ak;this.M=M;this.Q=Q;this.J=J;this.N=N;this.L=L;this.ar=ar;this.aq=aq;this.at=at;this.A=A;this.al=al;this.ao=ao;this.ap=ap;this.as=as;this.setDefDate=setDefDate;this.an=an;this.I=I;this.K=K;this.ad=ad;this.X=X;this.z=z;aF=this;function r(){};function an(co){if(aF.bc)aF.bc.value=I(co);};function writeCalendar(){var dC,dI;dC=document.all?"onClick":"onMouseDown";var ci=(document.all&&!document.getElementById)?"width:20;":"";var dE=aF.bn?"onMouseOver":dC;var dA;dA=aF.bb?"filter: progid:DXImageTransform.Microsoft.DropShadow(color=#777788,direction=135,strength=2);":"";var bh=aF.bj?"top:"+aF.bj+"px;":"";bh+=aF.bi?"left:"+aF.bi+"px;":"";bh+=bh.length>0?"position: absolute;":"";aF.F();if(aF.bp<1){document.write("");dI="display:none;";}else{dI="display:inline;";}document.write("
");document.write(aF.J());document.write("
");if(aF.bv){document.write(" ");document.write(aF.Q());document.write("
");}if(aF.bl){document.write(" ");document.write(aF.M());document.write("
");}document.write("\n");document.write("\n");document.write("\n");if(this.dG){if(confirm("The following options are not available in DateClick Standard Edition:\n"+this.dG+"\nTo obtain DateClick Professional or Developer, please "+"click 'OK' to be redirected straight to our website.")){document.location.href="http://www.primorissoftware.com/purchase.asp";}}};function m(){};function au(bS){var aS,shim,cP,cn;var co;bS=H(bS);cP=aF.N(bS);cn=aF.L();W();if(cf)aF.bg=true;if(document.getElementById){aS=document.getElementById(aF.bP);if(aF.bg)shim=document.getElementById(aF.bP+"_ghost");}else if(document.all){aS=document.all[aF.bP];if(aF.bg)shim=document.all[aF.bP+"_ghost"];}else aS=document.layers[aF.bP];aF.Div=aS;aF.aG=shim;if(aF.isOpen){if(aF.bg){aF.ao(shim,aS);shim.style.display="block";}return false;}aF.V();clearInterval(aF.cr);for(var i=0;i0){Y(aF.bP,J());}};function ak(cs,cW){aF.bC.setFullYear(cs);F();Y(aF.bP,J());aF.cw=true;aF.U();if(window.event)event.cancelBubble=true;else cW.stopPropagation();};function aj(cq,cW){aF.bC.setMonth(cq);F();Y(aF.bP,J());aF.cw=true;aF.T();if(window.event)event.cancelBubble=true;else cW.stopPropagation();};function o(){};function I(co){aD=['st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'];var ca=aF.bk;var cC='DMYHdhmst'.split('');var dL=new Array();var bz=0;var dn;var dp=/\[(\d+)\]/;;var dO=new Date(co);var day=dO.getDay();var date=dO.getDate();var month=dO.getMonth();var year=dO.getFullYear().toString();var ck=dO.getHours();var cF=dO.getMinutes();var dz=dO.getSeconds();var bZ=new Object();bZ['D']=date;bZ['d']=date+aD[date-1];bZ['DD']=(date<10)?'0'+date:date;bZ['DDD']=aF.FullDayNames[day].substring(0,3);bZ['DDDD']=aF.FullDayNames[day];bZ['M']=month+1;bZ['MM']=(month+1<10)?'0'+(month+1):month+1;bZ['MMM']=aF.FullMonthNames[month].substring(0,3);bZ['MMMM']=aF.FullMonthNames[month];bZ['Y']=(year.charAt(2)=='0')?year.charAt(3):year.substring(2,4);bZ['YY']=year.substring(2,4);bZ['YYYY']=year;for(var i=0;i9?"":"0")+x};function K(dW,bY){dW=dW+"";bY=bY+"";var cm=0;var cl=0;var c="";var dT="";var dU="";var x,y;var cT=new Date();var year=cT.getYear();var month=cT.getMonth()+1;var date=1;var hh=cT.getHours();var mm=cT.getMinutes();var ss=cT.getSeconds();var aH="";while(cl70){year=1900+(year-0);}else{year=2000+(year-0);}}}else if(dT=="MMM"||dT=="NNN"){month=0;for(var i=0;i11)){month=i+1;if(month>12){month-=12;}cm+=cN.length;break;}}}if((month<1)||(month>12)){return 0;}}else if(dT=="DDDD"||dT=="DDD"){for(var i=0;i12)){return 0;}cm+=month.length;}else if(dT=="dd"||dT=="d"||dT=="D"||dT=="DD"){date=v(dW,cm,dT.length,2);if(date==null||(date<1)||(date>31)){return 0;}cm+=date.length;}else if(dT=="hh"||dT=="h"){hh=v(dW,cm,dT.length,2);if(hh==null||(hh<1)||(hh>12)){return 0;}cm+=hh.length;}else if(dT=="HH"||dT=="H"){hh=v(dW,cm,dT.length,2);if(hh==null||(hh<0)||(hh>23)){return 0;}cm+=hh.length;}else if(dT=="KK"||dT=="K"){hh=v(dW,cm,dT.length,2);if(hh==null||(hh<0)||(hh>11)){return 0;}cm+=hh.length;}else if(dT=="kk"||dT=="k"){hh=v(dW,cm,dT.length,2);if(hh==null||(hh<1)||(hh>24)){return 0;}cm+=hh.length;hh--;}else if(dT=="mm"||dT=="m"){mm=v(dW,cm,dT.length,2);if(mm==null||(mm<0)||(mm>59)){return 0;}cm+=mm.length;}else if(dT=="ss"||dT=="s"){ss=v(dW,cm,dT.length,2);if(ss==null||(ss<0)||(ss>59)){return 0;}cm+=ss.length;}else if(dT=="a"){if(dW.substring(cm,cm+2).toLowerCase()=="am"){aH="AM";}else if(dW.substring(cm,cm+2).toLowerCase()=="pm"){aH="PM";}else{return 0;}cm+=2;}else{if(dW.substring(cm,cm+dT.length)!=dT){return 0;}else{cm+=dT.length;}}}if(cm!=dW.length){return 0;}if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29){return 0;}}else{if(date>28){return 0;}}}if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30){return 0;}}if(hh<12&&aH=="PM"){hh=hh-0+12;}else if(hh>11&&aH=="AM"){hh-=12;}var cS=new Date(year,month-1,date,hh,mm,ss);return cS.getTime();};function w(dW){var bO="1234567890";for(var i=0;i=cE;x--){var dT=dB.substring(i,i+x);if(dT.length0){if(!aF.bV){aF.Div.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=60);";if(aF.Div.style.cursor)aF.Div.style.cursor="move";aF.bV=true;}aF.Div.style["left"]=cU+"px";aF.Div.style["top"]=cV+"px";aF.cy=bT;aF.cz=bU;if(aF.aG)aF.aG.style.display="none";}aF.Div.cY(cU,cV);return false;};function C(){document.onmousemove=null;document.onmouseup=null;aF.Div.cZ(parseInt(aF.Div.style["left"]),parseInt(aF.Div.style["top"]));if(aF.bm){aF.Div.style.filter="";if(aF.Div.style.cursor)aF.Div.style.cursor="arrow";aF.rect=O(aF.Div);if(aF.aG){aF.ao(aF.aG,aF.Div);aF.aG.style.display="block";}if(aF.bm>1){aF.cy=0;aF.cz=0;}}aF.cu=false;};function F(){var bW,bX=0;var cx,cA;var bB=aF.bC;var i,j=1;aF.bD=bB.getDate();aF.bE=bB.getMonth();aF.bF=bB.getFullYear();bW=new Date(aF.bF,aF.bE,1);bX-=bW.getDay()>0?bW.getDay():bW.getDay()+7;for(i=0;i<43;i++){aF.aO[i]=new Date(bW.getFullYear(),bW.getMonth(),++bX);}};function M(){var innerHTML="";innerHTML+="";innerHTML+="";for(var i=0;i<12;i++){if(i%6==0)innerHTML+="
";innerHTML+="";innerHTML+=aF.aryMonths[i];innerHTML+=" | ";}innerHTML+="
";innerHTML+="
";return innerHTML;};function Q(){var innerHTML="";innerHTML+="";innerHTML+="";innerHTML+="";innerHTML+="";innerHTML+=" | ";innerHTML+="
";for(var i=parseInt(aF.bA);i>parseInt(aF.bA)-10;i--){innerHTML+="";innerHTML+="";innerHTML+=i;innerHTML+=" | ";innerHTML+="
";}innerHTML+="";innerHTML+="";innerHTML+="";innerHTML+=" | ";innerHTML+="
";innerHTML+="
";return innerHTML;};function J(){var innerHTML="";var dN,dR,dQ="none",dS="none";var cR;innerHTML+="";innerHTML+="";innerHTML+="";innerHTML+="";innerHTML+="";if(aF.aX){innerHTML+="";for(var x=0;x<7;x++){innerHTML+="";innerHTML+=aF.aryDays[aF.bd+x];innerHTML+=" | ";}innerHTML+=" ";}var dP;for(var i=1;i<42;){innerHTML+="";for(var j=0;j<7;++j,i++){dP=aF.bc?aF.bc.value:null;cR=aF.I(aF.aO[i-1+aF.bd]);dR=aF.I(aF.aO[i-1+aF.bd]);dN=aF.aO[i-1+aF.bd].getMonth()==aF.bE?"cl-on-month":"cl-off-month";if(!aF.X(dR)){dN=" "+aF.aV+"-old";}else if(dP==dR){dN=" "+aF.aV+"-tgt";}else if(aF.I(new Date().toGMTString())==dR){dN=" "+aF.aV+"-today";}innerHTML+="";innerHTML+=aF.aO[i-1+aF.bd].getDate();innerHTML+=" | ";}innerHTML+=" ";}innerHTML+=" ";innerHTML+=" | ";innerHTML+="
";innerHTML+="
";return(innerHTML);};function Y(cB,dV){if(document.getElementById){document.getElementById(cB).innerHTML=dV;}else if(document.all){document.all[cB].innerHTML=dV;}else if(document.layers){with(document.layers[cB].document){open();write(dV);close();}}return null;};function N(e){var de=0;var df=0;if(!e)e=window.event;if(e){if(e.pageX||e.pageY){de=e.pageX+"px";df=e.pageY+"px";}else if(e.clientX||e.clientY){de=e.clientX+document.body.scrollLeft+"px";df=e.clientY+document.body.scrollTop+"px";}}var dq={x:de,y:df};return dq;};function z(aA,aE){var dq,dr,ds;dr=parseInt(aA.x)+parseInt(aE.x);ds=parseInt(aA.y)+parseInt(aE.y);dq={x:dr,y:ds};return dq;};function L(){var de=0;var df=0;var dv;dv=G(document.getElementById("img_"+aF.bP));var dq={x:dv[0],y:dv[1]};return dq;};function ar(){if(aF.cr){clearInterval(aF.cr);aF.cr=null;}aF.cr=setInterval("glbCalendars["+aF.dc+"].R()",aF.aY);};function aq(){if(aF.cM){clearInterval(aF.cM);aF.cM=null;}aF.cM=setInterval("glbCalendars["+aF.dc+"].T()",4000);aF.ar();};function at(){if(aF.eb){clearInterval(aF.eb);aF.eb=null;}aF.eb=setInterval("glbCalendars["+aF.dc+"].U()",4000);aF.ar();};function A(ct){var dq;if(ct<=9){dq=aF.bw?"0"+ct:ct;}else dq=ct;return dq;};function al(aS,cQ){var bI=O(aS);var dY=P();if(bI["dx"]+cQ["x"]>dY["x"])aS.style.left=cQ["x"]-bI["dx"]+"px";else aS.style.left=cQ["x"];if(bI["dy"]+cQ["y"]>dY["y"])aS.style.top=cQ["y"]-bI["dy"]+"px";else{aS.style.top=cQ["y"];}if(aS.style.top<=0)aS.style.top=1;if(aS.style.left<=0)aS.style.left=1;};function ao(cc,aS){var bI=O(aS);if(bI.x>0){cc.style.left=bI.x;cc.style.top=bI.y;cc.style.width=bI.dx;cc.style.height=bI.dy;cc.style.zIndex=0;cc.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';}};function ap(aS,mo){var aU=O(aS);var bI=O(mo);var dY=P();var aT=aU["dx"]/2;var cG=bI["dx"]/2;var cH=aU["x"]-(cG-aT);var cI=aU["dy"]+aU["y"];mo.style.left=cH+"px";if(cI+bI["dy"]>dY["y"])mo.style.top=cI-bI["dy"];else mo.style.top=cI+"px";};function as(aS,yr){var aU=O(aS);var ec=O(yr);var dY=P();if(ec["dx"]+aU["x"]+aU["dx"]>dY["x"])yr.style.left=dY["x"]-ec["dx"];else yr.style.left=aU["x"]+aU["dx"]+"px";if(ec["dy"]+aU["y"]>dY["y"])yr.style.top=aU["y"];else yr.style.top=aU["y"]+"px";};function setDefDate(){var dP;if(aF.bc){dP=aF.bc.value;if(aF.bc.value!=""){co=aF.ad(dP.replace(/\./g,"-"),!this.dh);if(co==null)co=new Date(aF.K(dP,aF.bk));}else co=new Date();}else co=new Date();if(isNaN(co))aF.bC=new Date();else aF.bC=co;aF.F();Y(aF.bP,J());};function X(dD){var bJ=aF.I(new Date());if(aF.bs==1&&aF.K(dD,aF.bk)0){dF=aP[i].substring(0,cp).toUpperCase();dJ=aP[i].substring(cp+1,aP[i].length);if(dJ.toLowerCase()=="true")dJ=true;else if(dJ.toLowerCase()=="false")dJ=false;aJ.dj[i]=dF;aJ.dk[i]=dJ;}}};function Item(aK){var i;for(i=0;irect.x&&di.xrect.y&&di.y