function CalendarPopup(){var a;if(arguments.length>0)a=new PopupWindow(arguments[0]);else{a=new PopupWindow;a.setSize(150,175)}a.offsetX=-152;a.offsetY=25;a.autoHide();a.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");a.monthAbbreviations=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");a.dayHeaders=new Array("S","M","T","W","T","F","S");a.returnFunction="CP_tmpReturnFunction";a.returnMonthFunction=
"CP_tmpReturnMonthFunction";a.returnQuarterFunction="CP_tmpReturnQuarterFunction";a.returnYearFunction="CP_tmpReturnYearFunction";a.weekStartDay=0;a.isShowYearNavigation=false;a.displayType="date";a.disabledWeekDays={};a.disabledDatesExpression="";a.yearSelectStartOffset=2;a.currentDate=null;a.todayText="Today";a.cssPrefix="";a.isShowNavigationDropdowns=false;a.isShowYearNavigationInput=false;window.CP_calendarObject=null;window.CP_targetInput=null;window.CP_dateFormat="MM/dd/yyyy";a.copyMonthNamesToWindow=
CP_copyMonthNamesToWindow;a.setReturnFunction=CP_setReturnFunction;a.setReturnMonthFunction=CP_setReturnMonthFunction;a.setReturnQuarterFunction=CP_setReturnQuarterFunction;a.setReturnYearFunction=CP_setReturnYearFunction;a.setMonthNames=CP_setMonthNames;a.setMonthAbbreviations=CP_setMonthAbbreviations;a.setDayHeaders=CP_setDayHeaders;a.setWeekStartDay=CP_setWeekStartDay;a.setDisplayType=CP_setDisplayType;a.setDisabledWeekDays=CP_setDisabledWeekDays;a.addDisabledDates=CP_addDisabledDates;a.setYearSelectStartOffset=
CP_setYearSelectStartOffset;a.setTodayText=CP_setTodayText;a.showYearNavigation=CP_showYearNavigation;a.showCalendar=CP_showCalendar;a.hideCalendar=CP_hideCalendar;a.getStyles=getCalendarStyles;a.refreshCalendar=CP_refreshCalendar;a.getCalendar=CP_getCalendar;a.select=CP_select;a.setCssPrefix=CP_setCssPrefix;a.showNavigationDropdowns=CP_showNavigationDropdowns;a.showYearNavigationInput=CP_showYearNavigationInput;a.copyMonthNamesToWindow();return a}
function CP_copyMonthNamesToWindow(){if(typeof window.MONTH_NAMES!="undefined"&&window.MONTH_NAMES!=null){window.MONTH_NAMES=[];for(var a=0;a<this.monthNames.length;a++)window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthNames[a];for(a=0;a<this.monthAbbreviations.length;a++)window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthAbbreviations[a]}}
function CP_tmpReturnFunction(a,b,c){if(window.CP_targetInput!=null){a=new Date(a,b-1,c,0,0,0);window.CP_calendarObject!=null&&window.CP_calendarObject.copyMonthNamesToWindow();window.CP_targetInput.value=formatDate(a,window.CP_dateFormat)}else alert("Use setReturnFunction() to define which function will get the clicked results!")}
function CP_tmpReturnMonthFunction(a,b){alert("Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year="+a+" , month="+b)}function CP_tmpReturnQuarterFunction(a,b){alert("Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year="+a+" , quarter="+b)}function CP_tmpReturnYearFunction(a){alert("Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year="+a)}
function CP_setReturnFunction(a){this.returnFunction=a}function CP_setReturnMonthFunction(a){this.returnMonthFunction=a}function CP_setReturnQuarterFunction(a){this.returnQuarterFunction=a}function CP_setReturnYearFunction(a){this.returnYearFunction=a}function CP_setMonthNames(){for(var a=0;a<arguments.length;a++)this.monthNames[a]=arguments[a];this.copyMonthNamesToWindow()}
function CP_setMonthAbbreviations(){for(var a=0;a<arguments.length;a++)this.monthAbbreviations[a]=arguments[a];this.copyMonthNamesToWindow()}function CP_setDayHeaders(){for(var a=0;a<arguments.length;a++)this.dayHeaders[a]=arguments[a]}function CP_setWeekStartDay(a){this.weekStartDay=a}function CP_showYearNavigation(){this.isShowYearNavigation=arguments.length>0?arguments[0]:true}
function CP_setDisplayType(a){if(a!="date"&&a!="week-end"&&a!="month"&&a!="quarter"&&a!="year"){alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");return false}this.displayType=a}function CP_setYearSelectStartOffset(a){this.yearSelectStartOffset=a}function CP_setDisabledWeekDays(){this.disabledWeekDays={};for(var a=0;a<arguments.length;a++)this.disabledWeekDays[arguments[a]]=true}
function CP_addDisabledDates(a,b){if(arguments.length==1)b=a;if(!(a==null&&b==null)){if(this.disabledDatesExpression!="")this.disabledDatesExpression+="||";if(a!=null){a=parseDate(a);a=""+a.getFullYear()+LZ(a.getMonth()+1)+LZ(a.getDate())}if(b!=null){b=parseDate(b);b=""+b.getFullYear()+LZ(b.getMonth()+1)+LZ(b.getDate())}this.disabledDatesExpression+=a==null?"(ds<="+b+")":b==null?"(ds>="+a+")":"(ds>="+a+"&&ds<="+b+")"}}function CP_setTodayText(a){this.todayText=a}
function CP_setCssPrefix(a){this.cssPrefix=a}function CP_showNavigationDropdowns(){this.isShowNavigationDropdowns=arguments.length>0?arguments[0]:true}function CP_showYearNavigationInput(){this.isShowYearNavigationInput=arguments.length>0?arguments[0]:true}function CP_hideCalendar(){arguments.length>0?window.popupWindowObjects[arguments[0]].hidePopup():this.hidePopup()}
function CP_refreshCalendar(a){var b=window.popupWindowObjects[a];arguments.length>1?b.populate(b.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])):b.populate(b.getCalendar());b.refresh()}function CP_showCalendar(a){if(arguments.length>1)this.currentDate=arguments[1]==null||arguments[1]==""?new Date:new Date(parseDate(arguments[1]));this.populate(this.getCalendar());this.showPopup(a)}
function CP_select(a,b,c){var f=arguments.length>3?arguments[3]:null;if(window.getDateFromFormat)if(this.displayType!="date"&&this.displayType!="week-end")alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");else if(a.type!="text"&&a.type!="hidden"&&a.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");window.CP_targetInput=null}else{if(!a.disabled){window.CP_targetInput=a;window.CP_calendarObject=this;this.currentDate=
null;var e=0;if(f!=null)e=getDateFromFormat(f,c);else if(a.value!="")e=getDateFromFormat(a.value,c);if(f!=null||a.value!="")this.currentDate=e==0?null:new Date(e);window.CP_dateFormat=c;this.showCalendar(b)}}else alert("calendar.select: To use this method you must also include 'date.js' for date formatting")}
function getCalendarStyles(){var a="",b="";if(this!=null&&typeof this.cssPrefix!="undefined"&&this.cssPrefix!=null&&this.cssPrefix!="")b=this.cssPrefix;a+="<STYLE>\n";a+="."+b+"cpYearNavigation,."+b+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";a+="."+b+"cpDayColumnHeader, ."+b+"cpYearNavigation,."+b+"cpMonthNavigation,."+b+"cpCurrentMonthDate,."+b+"cpCurrentMonthDateDisabled,."+b+"cpOtherMonthDate,."+
b+"cpOtherMonthDateDisabled,."+b+"cpCurrentDate,."+b+"cpCurrentDateDisabled,."+b+"cpTodayText,."+b+"cpTodayTextDisabled,."+b+"cpText { font-family:arial; font-size:8pt; }\n";a+="TD."+b+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";a+="."+b+"cpCurrentMonthDate, ."+b+"cpOtherMonthDate, ."+b+"cpCurrentDate  { text-align:right; text-decoration:none; }\n";a+="."+b+"cpCurrentMonthDateDisabled, ."+b+"cpOtherMonthDateDisabled, ."+b+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";
a+="."+b+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";a+="."+b+"cpOtherMonthDate { color:#808080; }\n";a+="TD."+b+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";a+="TD."+b+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";a+="TD."+b+"cpTodayText, TD."+b+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";a+="A."+b+"cpTodayText, SPAN."+b+"cpTodayTextDisabled { height:20px; }\n";
a+="A."+b+"cpTodayText { color:black; }\n";a+="."+b+"cpTodayTextDisabled { color:#D0D0D0; }\n";a+="."+b+"cpBorder { border:solid thin #808080; }\n";a+="</STYLE>\n";return a}
function CP_getCalendar(){var a=new Date,b=this.type=="WINDOW"?"window.opener.":"",c="";if(this.type=="WINDOW"){c+="<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";c+="<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n"}else{c+='<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';c+="<TR><TD ALIGN=CENTER>\n";c+="<CENTER>\n"}if(this.displayType==
"date"||this.displayType=="week-end"){if(this.currentDate==null)this.currentDate=a;var f=arguments.length>0?arguments[0]:this.currentDate.getMonth()+1,e=arguments.length>1&&arguments[1]>0&&arguments[1]-0==arguments[1]?arguments[1]:this.currentDate.getFullYear(),p=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);if(e%4==0&&e%100!=0||e%400==0)p[2]=29;var o=e,j=f,l=1,d=(new Date(e,f-1,1)).getDay(),g=0;g=d>=this.weekStartDay?d-this.weekStartDay:7-this.weekStartDay+d;if(g>0){j--;if(j<1){j=12;o--}l=p[j]-
g+1}g=f+1;var h=e;if(g>12){g=1;h++}var n=f-1,m=e;if(n<1){n=12;m--}if(this.type!="WINDOW")c+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";c+="<TR>\n";d=b+"CP_refreshCalendar";var i="javascript:"+d;if(this.isShowNavigationDropdowns){c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+d+"("+this.index+",this.options[this.selectedIndex].value-0,"+(e-0)+');">';for(h=1;h<=12;h++){g=
h==f?"SELECTED":"";c+='<option value="'+h+'" '+g+">"+this.monthNames[h-1]+"</option>"}c+="</select></TD>";c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';c+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+d+"("+this.index+","+f+',this.options[this.selectedIndex].value-0);">';for(d=e-this.yearSelectStartOffset;d<=e+this.yearSelectStartOffset;d++){g=d==e?"SELECTED":"";c+='<option value="'+
d+'" '+g+">"+d+"</option>"}c+="</select></TD>"}else if(this.isShowYearNavigation){c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="../'+i+"("+this.index+","+n+","+m+');"><</A></TD>';c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[f-1]+"</SPAN></TD>";c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="../'+
i+"("+this.index+","+g+","+h+');">></A></TD>';c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';c+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="../'+i+"("+this.index+","+f+","+(e-1)+');"><</A></TD>';c+=this.isShowYearNavigationInput?'<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+e+'" onBlur="'+d+"("+
this.index+","+f+',this.value-0);"></TD>':'<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+e+"</SPAN></TD>";c+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="../'+i+"("+this.index+","+f+","+(e+1)+');">></A></TD>'}else{c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="../'+i+"("+this.index+","+n+","+m+');"><<</A></TD>\n';
c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[f-1]+" "+e+"</SPAN></TD>\n";c+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="../'+i+"("+this.index+","+g+","+h+');">>></A></TD>\n'}c+="</TR></TABLE>\n";c+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n";c+="<TR>\n";for(d=0;d<7;d++)c+='<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+
this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+d)%7]+"</TD>\n";c+="</TR>\n";for(d=1;d<=6;d++){c+="<TR>\n";for(g=1;g<=7;g++){var k=false;if(this.disabledDatesExpression!=""){h=""+o+LZ(j)+LZ(l);eval("disabled=("+this.disabledDatesExpression+")")}h="";h=j==this.currentDate.getMonth()+1&&l==this.currentDate.getDate()&&o==this.currentDate.getFullYear()?"cpCurrentDate":j==f?"cpCurrentMonthDate":"cpOtherMonthDate";if(k||this.disabledWeekDays[g-1])c+='\t<TD CLASS="'+this.cssPrefix+
h+'"><SPAN CLASS="'+this.cssPrefix+h+'Disabled">'+l+"</SPAN></TD>\n";else{i=l;n=j;m=o;if(this.displayType=="week-end"){i=new Date(m,n-1,i,0,0,0,0);i.setDate(i.getDate()+(7-g));m=i.getYear();if(m<1E3)m+=1900;n=i.getMonth()+1;i=i.getDate()}c+='\t<TD CLASS="'+this.cssPrefix+h+'"><A HREF="javascript:'+b+this.returnFunction+"("+m+","+n+","+i+");"+b+"CP_hideCalendar('"+this.index+'\');" CLASS="'+this.cssPrefix+h+'">'+l+"</A></TD>\n"}l++;if(l>p[j]){l=1;j++}if(j>12){j=1;o++}}c+="</TR>"}f=a.getDay()-this.weekStartDay;
if(f<0)f+=7;c+="<TR>\n";c+='\t<TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';if(this.disabledDatesExpression!=""){a.getFullYear();LZ(a.getMonth()+1);LZ(a.getDate());eval("disabled=("+this.disabledDatesExpression+")")}c+=k||this.disabledWeekDays[f+1]?'\t\t<SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+"</SPAN>\n":'\t\t<A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+b+this.returnFunction+"('"+a.getFullYear()+"','"+(a.getMonth()+1)+"','"+a.getDate()+
"');"+b+"CP_hideCalendar('"+this.index+"');\">"+this.todayText+"</A>\n";c+="\t\t<BR>\n";c+="\t</TD></TR></TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="month"||this.displayType=="quarter"||this.displayType=="year"){e=arguments.length>0?arguments[0]:this.displayType=="year"?a.getFullYear()-this.yearSelectStartOffset:a.getFullYear();if(this.displayType!="year"&&this.isShowYearNavigation){c+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";c+="<TR>\n";c+='\t<TD CLASS="'+
this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+b+"CP_refreshCalendar("+this.index+","+(e-1)+');"><<</A></TD>\n';c+='\t<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+e+"</TD>\n";c+='\t<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+b+"CP_refreshCalendar("+this.index+","+(e+1)+');">>></A></TD>\n';c+="</TR></TABLE>\n"}}if(this.displayType=="month"){c+=
"<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(a=0;a<4;a++){c+="<TR>";for(d=0;d<3;d++){k=a*3+d;c+='<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+b+this.returnMonthFunction+"("+e+","+(k+1)+");"+b+"CP_hideCalendar('"+this.index+'\');" CLASS="undefined">'+this.monthAbbreviations[k]+"</A></TD>"}c+="</TR>"}c+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="quarter"){c+="<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n";
for(a=0;a<2;a++){c+="<TR>";for(d=0;d<2;d++){k=a*2+d+1;c+='<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+b+this.returnQuarterFunction+"("+e+","+k+");"+b+"CP_hideCalendar('"+this.index+'\');" CLASS="undefined">Q'+k+"</A><BR><BR></TD>"}c+="</TR>"}c+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="year"){c+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";c+="<TR>\n";c+='\t<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+
this.cssPrefix+'cpYearNavigation" HREF="javascript:'+b+"CP_refreshCalendar("+this.index+","+(e-8)+');"><<</A></TD>\n';c+='\t<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+b+"CP_refreshCalendar("+this.index+","+(e+8)+');">>></A></TD>\n';c+="</TR></TABLE>\n";c+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(a=0;a<4;a++){for(d=0;d<2;d++){k=e+d*4+a;c+='<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+
'cpText" HREF="javascript:'+b+this.returnYearFunction+"("+k+");"+b+"CP_hideCalendar('"+this.index+'\');" CLASS="undefined">'+k+"</A></TD>"}c+="</TR>"}c+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.type=="WINDOW")c+="</BODY></HTML>\n";return c};
