var ppcDF="m/d/Y",ppcMN=new Array("January","February","March","April","May","June","July","August","September","October","November","December"),ppcWN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"),ppcER=new Array(4);ppcER[0]="Required DHTML functions are not supported in this browser.";ppcER[1]="Target form field is not assigned or not accessible.";ppcER[2]="Sorry, the chosen date is not acceptable. Please read instructions on the page.";ppcER[3]="Unknown error occured while executing this script."; var ppcUC=false,ppcUX=4,ppcUY=4,ppcIE=navigator.appName=="Microsoft Internet Explorer",ppcNN=navigator.appName=="Netscape"&&document.layers,ppcTT='<table width="200" cellspacing="1" cellpadding="2" border="1" bordercolorlight="#000000" bordercolordark="#000000">\n',ppcCD=ppcTT,ppcFT='<font face="MS Sans Serif, sans-serif" size="1" color="#000000">',ppcFC=true,ppcTI=false,ppcSV=null,ppcRL=null,ppcXC=null,ppcYC=null,ppcML=new Array(31,28,31,30,31,30,31,31,30,31,30,31),ppcWE=new Array("Sunday","Monday", "Tuesday","Wednesday","Thursday","Friday","Saturday"),ppcNow=new Date,ppcPtr=new Date;if(ppcNN){window.captureEvents(Event.RESIZE);window.onresize=restoreLayers;document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);document.onmousedown=recordXY;document.onmouseup=confirmXY} function restoreLayers(){if(ppcNN)with(window.document){open("text/html");write("<html><head><title>Restoring the layer structure...</title></head>");write('<body bgcolor="#FFFFFF" onLoad="history.go(-1)">');write("</body></html>");close()}}function recordXY(a){if(ppcNN){ppcXC=a.x;ppcYC=a.y;document.routeEvent(a)}}function confirmXY(a){if(ppcNN){ppcXC=ppcXC==a.x?a.x:null;ppcYC=ppcYC==a.y?a.y:null;document.routeEvent(a)}} function getCalendarFor(a,b){ppcSV=a;ppcRL=b;if(ppcFC){setCalendar();ppcFC=false}if(ppcSV!=null&&ppcSV)if(ppcIE){a=document.all.PopUpCalendar;a.style.left=document.body.scrollLeft+event.clientX;a.style.top=document.body.scrollTop+event.clientY;a.style.visibility="visible"}else if(ppcNN){a=document.layers.PopUpCalendar;a.left=ppcXC;a.top=ppcYC;a.visibility="show"}else showError(ppcER[0]);else showError(ppcER[1])}function switchMonth(a){a=a.split("|");setCalendar(a[0],a[1])} function moveMonth(a){var b=null,c=false;if(ppcIE)b=document.ppcMonthList.sItem;else if(ppcNN)b=document.layers.PopUpCalendar.document.layers.monthSelector.document.ppcMonthList.sItem;else showError(ppcER[0]);if(b!=null)if(a.toLowerCase()=="back"&&b.selectedIndex>0)b.selectedIndex--;else if(a.toLowerCase()=="forward"&&b.selectedIndex<12)b.selectedIndex++;else c=true;if(c){if(ppcIE){b.style.backgroundColor="#FF0000";window.setTimeout("document.ppcMonthList.sItem.style.backgroundColor = '#FFFFFF'", 50)}}else{b=b.options[b.selectedIndex].value.split("|");a=b[0];b=b[1];setCalendar(a,b)}}function selectDate(a){var b=a.split("|");a=b[0];var c=b[1];b=b[2];var d=parseInt(b);ppcPtr.setDate(d);if(ppcSV!=null&&ppcSV)if(validDate(b)){ppcSV.value=dateFormat(a,c,b);hideCalendar()}else{showError(ppcER[2]);if(ppcTI){clearTimeout(ppcTI);ppcTI=false}}else{showError(ppcER[1]);hideCalendar()}} function setCalendar(a,b){if(a==null)a=getFullYear(ppcNow);if(b==null){b=ppcNow.getMonth();setSelectList(a,b)}if(b==1)ppcML[1]=isLeap(a)?29:28;ppcPtr.setYear(a);ppcPtr.setMonth(b);ppcPtr.setDate(1);updateContent()} function updateContent(){generateContent();if(ppcIE)document.all.monthDays.innerHTML=ppcCD;else if(ppcNN)with(document.layers.PopUpCalendar.document.layers.monthDays.document){open("text/html");write('<html>\n<head>\n<title>DynDoc</title>\n</head>\n<body bgcolor="#FFFFFF">\n');write(ppcCD);write("</body>\n</html>");close()}else showError(ppcER[0]);ppcCD=ppcTT} function generateContent(){var a=getFullYear(ppcPtr),b=ppcPtr.getMonth(),c=1,d=ppcPtr.getDay(),f=ppcML[b],e,g="",h,i=0;for(h=0;h<7;++h){if(c>f)break;for(i=0;i<7;++i){e=i==0||i==6?"#FFFFCC":"#FFFFFF";if(h==0&&i<d||c>f)g+=makeCell(e,a,b,0);else{g+=makeCell(e,a,b,c);++c}}ppcCD+='<tr align="center">\n'+g+"</tr>\n";g=""}ppcCD+="</table>\n"} function makeCell(a,b,c,d){var f="'"+b+"|"+c+"|"+d+"'",e='<td width="20" bgcolor="'+a+'" ',g=ppcIE?"</font></span></td>\n":"</font></a></td>\n";a="onMouseOver=\"this.style.backgroundColor='#FF0000'\" onMouseOut=\"this.style.backgroundColor='"+a+'\'" onMouseUp="selectDate('+f+')" ';var h='<span Style="cursor: hand">',i='<span Style="cursor: default">';f='<a href="javascript:selectDate('+f+')" onMouseOver="window.status=\' \';return true;">';var j=d!=0?d+"":"&nbsp;";if(ppcNow.getDate()==d&&ppcNow.getMonth()== c&&getFullYear(ppcNow)==b)j="<b>"+j+"</b>";b="";if(d==0)b=ppcIE?e+'Style="cursor: default">'+i+ppcFT+j+g:e+">"+ppcFT+j+g;else if(ppcIE)b=e+a+'Style="cursor: hand">'+h+ppcFT+j+g;else{if(d<10)j="&nbsp;"+j+"&nbsp;";b=e+">"+f+ppcFT+j+g}return b} function setSelectList(a,b){var c=0,d=null;if(ppcIE)d=document.ppcMonthList.sItem;else if(ppcNN)d=document.layers.PopUpCalendar.document.layers.monthSelector.document.ppcMonthList.sItem;for(;c<13;){d.options[c].value=a+"|"+b;d.options[c].text=a+" \u2022 "+ppcMN[b];c++;b++;if(b==12){a++;b=0}}} function hideCalendar(){if(ppcIE)document.all.PopUpCalendar.style.visibility="hidden";else if(ppcNN){document.layers.PopUpCalendar.visibility="hide";window.status=" "}ppcTI=false;setCalendar();ppcSV=null;if(ppcIE)var a=document.ppcMonthList.sItem;else if(ppcNN)a=document.layers.PopUpCalendar.document.layers.monthSelector.document.ppcMonthList.sItem;a.selectedIndex=0}function showError(a){window.alert("[ PopUp Calendar ]\n\n"+a)}function isLeap(a){return a%400==0||a%4==0&&a%100!=0?true:false} function getFullYear(a){return ppcNN?a.getYear()+1900:a.getYear()}function validDate(a){var b=true;if(ppcRL!=null){var c=ppcRL.split(":");b=c[0];var d=c[1];c=c[2].charAt(0).toLowerCase();if(c!="d"){var f=ppcPtr.getDay();a=isEvenOrOdd(a);b=b=="[^]"?!(f==d&&(a==c||c=="a")):f==d&&(a==c||c=="a")}else b=b=="[^]"?a!=d:a==d}return b}function isEvenOrOdd(a){return a-21>0?"e":a-14>0?"o":a-7>0?"e":"o"} function dateFormat(a,b,c){if(ppcDF==null)ppcDF="m/d/Y";for(var d=ppcPtr.getDay(),f="",e="",g=ppcDF.length,h=0;h<g;++h){f=ppcDF.charAt(h);switch(f){case "M":e+=ppcMN[b];break;case "m":e+=b<9?"0"+ ++b:++b;break;case "Y":e+=a;break;case "y":e+=a.substring(2);break;case "d":e+=ppcDF.indexOf("m")!=-1&&c<10?"0"+c:c;break;case "W":e+=ppcWN[d];break;default:e+=f}}return unescape(e)};