
var popCalDstFld;var temp;var popCalWin;function popupCal(){var D=new Date();var A="";var E=0;var C;var B="";popCalWin=new Object();if(arguments.length<2){alert("popupCal(): Wrong number of arguments.");return void(0)}B=popupCal.arguments[0];popCalDstFld=popupCal.arguments[1];temp=popupCal.arguments[1];popCalDstFmt=popupCal.arguments[2];popCalMonths=popupCal.arguments[3];popCalDays=popupCal.arguments[4];popCalToday=popupCal.arguments[5];popCalClose=popupCal.arguments[6];popCalTitle=popupCal.arguments[7];popCalFirstDayWeek=popupCal.arguments[8];if(popCalDstFld!=""){popCalDstFld=document.getElementById(popCalDstFld)}if(popCalDstFmt==""){popCalDstFmt="m/d/yyyy"}if(popCalMonths==""){popCalMonths="January,February,March,April,May,June,July,August,September,October,November,December"}if(popCalDays==""){popCalDays="Sun,Mon,Tue,Wed,Thu,Fri,Sat"}if(popCalToday==""||typeof popCalToday=="undefined"){popCalToday="Today"}if(popCalClose==""||typeof popCalClose=="undefined"){popCalClose="Close"}if(popCalTitle==""||typeof popCalTitle=="undefined"){popCalTitle="Calendar"}A=new String(popCalDstFld.value);if(A==""){C=new Date()}else{E=A.lastIndexOf("/");if((A.length-E)==3){A=A.substring(0,E+1)+"20"+A.substr(E+1);C=new Date(A)}else{C=getDateFromFormat(A,popCalDstFmt)}}if(C.toString()=="NaN"||C.toString()=="0"){C=new Date();popCalDstFld.value=""}var F=String(C.getMonth()+1)+"/"+String(C.getDate())+"/"+String(C.getFullYear());reloadCalPopup(F,B);return void(0)}function closeCalPopup(){popCalWin.close();return void(0)}function reloadCalPopup(){var A="toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, height=270, width=270, top="+((screen.height-270)/2).toString()+",left="+((screen.width-270)/2).toString();var B=new Date(reloadCalPopup.arguments[0]);if(B.toString()=="Invalid Date"){B=new Date()}B.setDate(1);var C=calPopupSetData(B,reloadCalPopup.arguments[1]);if(popCalWin.toString()=="[object Object]"){popCalWin=window.open("",reloadCalPopup.arguments[1],A);popCalWin.opener=self;popCalWin.focus()}else{popCalWin.document.close();popCalWin.document.clear()}popCalWin.document.write(C);return void(1)}function calPopupSetData(U,Y){var W="";var X=0;var R=new Array('<FONT SIZE="1">','<B><FONT SIZE="2">','<FONT SIZE="2" COLOR="#EF741D"><B>');var T=new Date();var K=U.getMonth();var I=U.getFullYear();var A=(K==0)?11:(K-1);var F=(K==11)?0:(K+1);var H=(A==11)?(I-1):I;var N=(F==0)?(I+1):I;var J=String((T.getMonth()+1)+"/01/"+T.getFullYear());var D=String((A+1)+"/01/"+H);var e=String((F+1)+"/01/"+N);var M=String((K+1)+"/01/"+(I-1));var h=String((K+1)+"/01/"+(I+1));var E=new Date(e);E=new Date(E.valueOf()-1001);X=E.getDate();if(this.popCalMonths.split){var S=this.popCalMonths.split(",");var g=this.popCalDays.split(",")}else{var S=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var g=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")}var Q="<style><!-- body{font-family:Arial,Helvetica,sans-serif;font-size:9pt}; td {  font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #666666}; A { text-decoration: none; };TD.day { border-bottom: solid black; border-width: 0px; }--></style>";var P='align="center" class="day" BGCOLOR="#F1F1F1"onMouseOver="temp=this.style.backgroundColor;this.style.backgroundColor=\'#CCCCCC\';" onMouseOut="this.style.backgroundColor=temp;"';var G='align="center" BGCOLOR="#F1F1F1" onMouseOver="temp=this.style.backgroundColor;this.style.backgroundColor=\'#CCCCCC\';" onMouseOut="this.style.backgroundColor=temp;"';var i="<HTML><HEAD><TITLE>"+popCalTitle+"</TITLE>"+Q+'</HEAD><BODY BGCOLOR="#F1F1F1" TEXT="#000000" LINK="#364180" ALINK="#FF8100" VLINK="#424282">';var C="</BODY></HTML>";var O='<CENTER><input type=button value="'+popCalClose+'" onClick="javascript:window.opener.closeCalPopup()"></CENTER>';var a="<A HREF=\"javascript:window.opener.reloadCalPopup('"+J+"','"+Y+"');\">"+popCalToday+"</A>";var f="<A HREF=\"javascript:window.opener.reloadCalPopup('"+D+"','"+Y+"');\">"+S[A]+"</A>";var d="<A HREF=\"javascript:window.opener.reloadCalPopup('"+e+"','"+Y+"');\">"+S[F]+"</A>";var c="<A HREF=\"javascript:window.opener.reloadCalPopup('"+M+"','"+Y+"');\">"+(I-1)+"</A>";var Z="<A HREF=\"javascript:window.opener.reloadCalPopup('"+h+"','"+Y+"');\">"+(I+1)+"</A>";W+=(i+R[1]);W+=('<DIV align="center">');W+=('<TABLE BORDER="0" cellspacing="0" callpadding="0" width="250"><TR><TD width="45">&nbsp</TD>');W+=('<TD width="45" align="center" '+G);W+=(" >");W+=(R[0]+c+"</FONT></TD>");W+=('<TD width="70" align="center" '+G);W+=(" >");W+=(R[0]+a+"</FONT></TD>");W+=('<TD width="45" align="center" '+G);W+=(" >");W+=(R[0]+Z+'</FONT></TD><TD width="45">&nbsp</TD>');W+=("</TR></TABLE>");W+=('<TABLE BORDER="0" cellspacing="0" callpadding="0" width="250">');W+=('<TR><TD width="55" align="center" '+G);W+=(" >");W+=(R[0]+f+"</FONT></TD>");W+=('<TD width="140" align="center">');W+=("&nbsp;&nbsp;"+R[1]+'<FONT COLOR="#000000">'+S[K]+", "+I+"&nbsp;&nbsp;</FONT></TD>");W+=('<TD width="55" align="center" '+G);W+=(" >");W+=(R[0]+d+"</FONT></TD></TR></TABLE><BR>");W+=('<TABLE BORDER="0" cellspacing="2" cellpadding="1"  width="245">');W+=("");W+=("<TR>");var b=0;for(b=0;b<7;b++){W+=('<TD width="35" align="center">'+R[1]+'<FONT COLOR="#000000">'+g[(b+popCalFirstDayWeek)%7]+"</FONT></TD>")}W+=("</TR>");var B=0;var L=1;var V=U.getDay();do{W+=("<TR>");for(B=0;B<7;B++){if(((V+7-popCalFirstDayWeek)%7!=B)||(L>X)){W+=('<TD width="35">'+R[1]+"&nbsp;</FONT></TD>");continue}else{anchorVal="<A HREF=\"javascript:window.opener.calPopupSetDate(window.opener.popCalDstFld,'"+constructDate(L,K+1,I)+"');window.opener.closeCalPopup()\">";jsVal="javascript:window.opener.calPopupSetDate(window.opener.popCalDstFld,'"+constructDate(L,K+1,I)+"');window.opener.closeCalPopup()";W+=('<TD width="35" '+P+' onClick="'+jsVal+'">');if((U.getMonth()==T.getMonth())&&(L==T.getDate())&&(I==T.getFullYear())){W+=(anchorVal+R[2]+L+"</A></FONT></TD>")}else{W+=(anchorVal+R[1]+L+"</A></FONT></TD>")}V++;L++}}V=popCalFirstDayWeek;W+=("</TR>")}while(L<=X);W+=("</TABLE></DIV><BR>");W+=(O+"</FONT>"+C);return(W)}function calPopupSetDate(){calPopupSetDate.arguments[0].value=calPopupSetDate.arguments[1]}function padZero(A){return((A<=9)?("0"+A):A)}function constructDate(C,A,D){var B=this.popCalDstFmt;B=B.replace("dd",padZero(C));B=B.replace("d",C);B=B.replace("MM",padZero(A));B=B.replace("M",A);B=B.replace("yyyy",D);B=B.replace("yy",padZero(D%100));return B}function _isInteger(C){var B="1234567890";for(var A=0;A<C.length;A++){if(B.indexOf(C.charAt(A))==-1){return false}}return true}function _getInt(F,D,E,C){for(var A=C;A>=E;A--){var B=F.substring(D,D+A);if(B.length<E){return null}if(_isInteger(B)){return B}}return null}function getDateFromFormat(B,M){B=B+"";M=M+"";var E=0;var F=0;var J="";var D="";var L,K;var A=new Date();var I=A.getYear();var H=A.getMonth()+1;var C=1;while(F<M.length){J=M.charAt(F);D="";while((M.charAt(F)==J)&&(F<M.length)){D+=M.charAt(F++)}if(D=="yyyy"||D=="yy"||D=="y"){if(D=="yyyy"){L=4;K=4}if(D=="yy"){L=2;K=2}if(D=="y"){L=2;K=4}I=_getInt(B,E,L,K);if(I==null){return 0}E+=I.length;if(I.length==2){if(I>70){I=1900+(I-0)}else{I=2000+(I-0)}}}else{if(D=="MM"||D=="M"){H=_getInt(B,E,D.length,2);if(H==null||(H<1)||(H>12)){return 0}E+=H.length}else{if(D=="dd"||D=="d"){C=_getInt(B,E,D.length,2);if(C==null||(C<1)||(C>31)){return 0}E+=C.length}else{if(B.substring(E,E+D.length)!=D){return 0}else{E+=D.length}}}}}if(E!=B.length){return 0}if(H==2){if(((I%4==0)&&(I%100!=0))||(I%400==0)){if(C>29){return 0}}else{if(C>28){return 0}}}if((H==4)||(H==6)||(H==9)||(H==11)){if(C>30){return 0}}var G=new Date(I,H-1,C);return G};
