
var aS=new Array();var arrMN=new Array('January','February','March','April','May','June','July','August','September','October','November','December');var nextFocus=null;var arrSH=new Array(10);var sb=new SB();var sb1=new SB();var arrE=[];var zz,zv,d,fTSR;d=new Date();fTSR=0;zv=d.getTime();zz="&zz="+zv;var gBF=false;var g_calShown=false;var g_calCB;var rM=new Array(12);rM[0]=rM[2]=rM[4]=rM[6]=rM[7]=rM[9]=rM[11]=31;rM[3]=rM[5]=rM[8]=rM[10]=30;rM[1]=28;document.onclick=function(){try{CancelCal();}catch(e){}}
function UpdDt(e,toID){var t=DE(toID);if(null!=e&&null!=t&&null!=GetInputDate(e.value)&&(null==GetInputDate(t.value)||GetInputDate(e.value)>GetInputDate(t.value))){var ds=GetDateSep();var frmDate=GetInputDate(e.value);var dd=frmDate.getDate();var mm=frmDate.getMonth();var yy=frmDate.getYear();var toDate=new Date(yy,mm,dd+2);var month=toDate.getMonth()+1;var year=(toDate.getFullYear()<1000)?1900+toDate.getFullYear():toDate.getFullYear();t.value=toDate.getDate()+ds+month+ds+year;}}
function SC(el,sOffset,eOffset,toID){if(DE('CalFrame')==null){return;}
var id=el.id;var StartDate=new Date();var EndDate=new Date();StartDate.setDate(StartDate.getDate()+sOffset);EndDate.setDate(EndDate.getDate()+eOffset);el.select();if(toID==null||toID=='')
ShowCalendar(el,el,null,StartDate,EndDate);else
ShowCalendar(el,el,DE(toID),StartDate,EndDate);}
function DE(el){return document.getElementById(el);}
function SH(id,s){var e=DE(id);if(s){e.style.display='block';}else{e.style.display='none';}}
function SB(){this.Concat=Concat;this.GetValue=GetValue;this.Reset=Reset;}
function Concat(StringToConcat){this.aS[this.aS.length]=StringToConcat;}
function GetValue(){return this.aS.join('');}
function Reset(){this.aS=null;this.aS=new Array();}
function ecsf(){document.ec.submit();}
function ece(e){var k;if(e.keyCode){k=e.keyCode;}if(e.which){k=e.which;}if(k=='13'){e.cancelBubble=true;ecsf();}}
function getObj(objID){if(document.getElementById){return document.getElementById(objID);}
else if(document.all){return document.all[objID];}
else if(document.layers){return document.layers[objID];}}
function SH1(id,s){var e=DE(id);if(s){e.style.display='block';}else{e.style.display='none';}}
function GetDowStart(){return 1;}function GetDateFmt(){return"mmddyy";}function GetDateSep(){return"/";}
function ShowCalendar(eP,eD,eDP,dmin,dmax){SCal(eP,eD,eDP,dmin,dmax);}
function GoTo(u){window.top.location=u+zz;}
function Go(u){window.top.location=u;}
function BF(){gBF=true;}
function getObj(objID){if(document.getElementById){return document.getElementById(objID);}
else if(document.all){return document.all[objID];}
else if(document.layers){return document.layers[objID];}}
function DoNothing(){return false;}var cF=null;var cW=null;var g_tid=0;var g_cP,g_eD,g_eDP,g_dmin,g_dmax;var nextFocus;var g_fNoCal=false;function getEventObj(e){if(!e)e=window.event;return e;}
function stopBubble(e){e=getEventObj(e);e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
function CB(){stopBubble(event);}
function SCal(cP,eD,eDP,dmin,dmax){clearTimeout(g_tid);if(g_fNoCal){g_fNoCal=false;return;}
if(g_calShown&&eD==g_eD){return;}
g_calShown=true;g_calCB=null;g_cP=cP;g_eD=eD;g_eDP=eDP;g_dmin=dmin;g_dmax=dmax;WaitCal();}
function CancelCal(){clearTimeout(g_tid);if(!cF)cF=getObj('CalFrame');cF.style.visibility="hidden";g_calShown=false;}
function WaitCal(){if(!cW)cW=frames['CalFrame'];if(null==cW||null==cW.g_fCL||false==cW.g_fCL){g_tid=setTimeout("WaitCal()",200);}
else{if(!cF)cF=getObj('CalFrame');cF.style.visibility="hidden";setTimeout("DoCal()",1);}}
function DoCal(){PosCal(g_cP);if(!cW)cW=frames['CalFrame'];cW.DoCal(g_eD,g_eDP,g_dmin,g_dmax);}
function getScrollTop(){if(document.documentElement.scrollTop)return document.documentElement.scrollTop;if(document.body.scrollTop)return document.body.scrollTop;if(window.pageYOffset)return window.pageYOffset;return 0;}
function getWinHeight(){if(window.innerHeight)return window.innerHeight;if(document.documentElement.clientHeight)return document.documentElement.clientHeight;if(document.body.clientHeight)return document.body.clientHeight;return 0;}
function PosCal(cP){var dB=document.body;var eL=0;var eT=0;if(!cF)cF=getObj('CalFrame');for(var p=cP;p&&p.tagName!='BODY';p=p.offsetParent){eL+=p.offsetLeft;eT+=p.offsetTop;}
var eH=cP.offsetHeight;var dH=parseInt(cF.style.height);var sT=getScrollTop();if(eT-dH>=sT&&eT+eH+dH>getWinHeight()+sT)eT-=dH;else eT+=eH;cF.style.left=eL+'px';cF.style.top=eT+'px';}
function SetNextFocus(e){nextFocus=e;if(nextFocus)nextFocus.onfocus=CancelCal;}
function SetPrevFocus(e){if(e)e.onfocus=CancelCal;}
function FGoNextFocus(){if(nextFocus){nextFocus.focus();return true;}return false;}
function CalSetFocus(e){if(e){g_fNoCal=true;e.focus();setTimeout("EndCalFocus()",200);}}
function EndCalFocus(){g_fNoCal=false;}
function CalDateSet(eInp,d,m,y,giveFocus){var ds=GetDateSep();var fmt=GetDateFmt();if(fmt=="mmddyy")eInp.value=m+ds+d+ds+y;else if(fmt=="ddmmyy")eInp.value=d+ds+m+ds+y;else eInp.value=y+ds+m+ds+d;if(!giveFocus)
CalSetFocus(eInp);}
function SetCalShown(fcshown){g_calShown=fcshown;}
function CalendarCallback(){if(g_calCB)g_calCB();}
function SetCalendarCallback(cb){g_calCB=cb;}
function GetInputDate(t){if(!t)return null;if(!t.length)return null;t=t.replace(/\s+/g,"");if(t.match(/[^-|\d|\.|\/]/))return null;var rgt=t.split(/-|\.|\//);for(var i=0;i<rgt.length;i++)rgt[i]=parseInt(rgt[i],10);if(!rgt[1])return null;var m,d,y;var fmt=GetDateFmt();if(fmt=="yymmdd"){if(!rgt[2])return null;m=rgt[1];d=rgt[2];y=rgt[0];}
else{if(fmt=="mmddyy"){m=rgt[0];d=rgt[1];}
else{m=rgt[1];d=rgt[0];}
if(rgt[2])y=rgt[2];else y=DefYr(m-1,d);}
m-=1;if(y<100)y+=2000;if(y<1601||y>4500||m<0||m>11||d<1||d>GetMonthCount(m,y))return null;return new Date(y,m,d);}
function GetMonthCount(m,y){var c=rM[m];if((1==m)&&IsLY(y))c++;return c;}
function IsLY(y){if(0==y%4&&((y%100!=0)||(y%400==0)))return true;else return false;}
function DefYr(m,d){var dt=new Date();var yC=(dt.getYear()<1000)?1900+dt.getYear():dt.getYear();if(m<dt.getMonth()||(m==dt.getMonth()&&d<dt.getDate()))yC++;return yC;}