var CalId;var MonthClicked=false;var DefaultDateFormat='MM/DD/YYYY';var DefaultDepartureDays=7;var HideWait=3;var Y2kPivotPoint=76;var FontSize=11;var FontFamily='Tahoma';var CellWidth=23;var CellHeight=18;var ImagePath='../library/js_calendar';var ImageURL=ImagePath+'/calendar.gif';var NextURL=ImagePath+'/next.gif';var PrevURL=ImagePath+'/prev.gif';var CalBGColor='white';var TopRowBGColor='buttonface';var DayBGColor='orange';var WeekendColor='';var BookedColor='lightgrey'
var TodayColor='#ffffc0';var SelectedDayBGColor='#000080'
var BackColor=''
var ZCounter=100;var Today=new Date();var WeekDays=new Array('S','M','T','W','T','F','S');var MonthDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var MonthNames=new Array('January','February','March','April','May','June','July','August','September','October','November','December');if(typeof UnitResv!="undefined"){var Reservations=UnitResv.Reservations}
with(document){writeln('<style>');writeln('td.calendarDateInput {letter-spacing:normal;line-height:normal;font-family:'+FontFamily+',Sans-Serif;font-size:'+FontSize+'px;}');writeln('select.calendarDateInput {letter-spacing:.06em;font-family:Verdana,Sans-Serif;font-size:11px;}');writeln('input.calendarDateInput {letter-spacing:.06em;font-family:Verdana,Sans-Serif;font-size:11px;}');writeln('</style>');}
function NumOnly(e){var KeyCode=(e.keyCode)?e.keyCode:e.which;return((KeyCode==8)||(KeyCode==9)||(KeyCode==37)||(KeyCode==39)||(KeyCode==46)||((KeyCode>47)&&(KeyCode<58)));}
function GetTagPixels(StartTag,Direction){var PixelAmt=(Direction=='LEFT')?StartTag.offsetLeft:StartTag.offsetTop;while((StartTag.tagName!='BODY')&&(StartTag.tagName!='HTML')){StartTag=StartTag.offsetParent;PixelAmt+=(Direction=='LEFT')?StartTag.offsetLeft:StartTag.offsetTop;}
return PixelAmt;}
function BehindCal(SelectList,CalLeftX,CalRightX,CalTopY,CalBottomY,ListTopY){var ListLeftX=GetTagPixels(SelectList,'LEFT');var ListRightX=ListLeftX+SelectList.offsetWidth;var ListBottomY=ListTopY+SelectList.offsetHeight;return(((ListTopY<CalBottomY)&&(ListBottomY>CalTopY))&&((ListLeftX<CalRightX)&&(ListRightX>CalLeftX)));}
function FixSelectLists(Over){if(navigator.appName=='Microsoft Internet Explorer'){var CalDiv=this.getCalendar();var CalLeftX=CalDiv.offsetLeft;var CalRightX=CalLeftX+CalDiv.offsetWidth;var CalTopY=CalDiv.offsetTop;var CalBottomY=CalTopY+(CellHeight*9);var FoundCalInput=false;formLoop:for(var j=this.formNumber;j<document.forms.length;j++){for(var i=0;i<document.forms[j].elements.length;i++){if(typeof document.forms[j].elements[i].type=='string'){if((document.forms[j].elements[i].type=='hidden')&&(document.forms[j].elements[i].name==this.hiddenFieldName)){FoundCalInput=true;i+=3;}
if(FoundCalInput){if(document.forms[j].elements[i].type.substr(0,6)=='select'){ListTopY=GetTagPixels(document.forms[j].elements[i],'TOP');if(ListTopY<CalBottomY){if(BehindCal(document.forms[j].elements[i],CalLeftX,CalRightX,CalTopY,CalBottomY,ListTopY)){document.forms[j].elements[i].style.visibility=(Over)?'hidden':'visible';}}
else break formLoop;}}}}}}}
function DayCellHover(Cell,Over,Color,HoveredDay){Cell.style.backgroundColor=(Over)?DayBGColor:Color;Cell.style.cursor='hand';if(Over){if((this.yearValue==Today.getFullYear())&&(this.monthIndex==Today.getMonth())&&(HoveredDay==Today.getDate()))self.status='Click to select today';else{var Suffix=HoveredDay.toString();switch(Suffix.substr(Suffix.length-1,1)){case'1':Suffix+=(HoveredDay==11)?'th':'st';break;case'2':Suffix+=(HoveredDay==12)?'th':'nd';break;case'3':Suffix+=(HoveredDay==13)?'th':'rd';break;default:Suffix+='th';break;}
self.status='Click to select '+this.monthName+' '+Suffix;}}
else self.status='';return true;}
function PickDisplayDay(ClickedDay){this.show();var MonthList=this.getMonthList();var DayList=this.getDayList();var YearField=this.getYearField();var DateNameField=this.getDateField();var DepartDateObj=this.getDepartDateID;var DefaultDepartDaysFromArrivalDate=this.getDefaultDepartDate;this.setPicked(this.displayed.yearValue,this.displayed.monthIndex,ClickedDay);YearField.value=this.picked.yearPad;YearField.defaultValue=YearField.value;DateNameField.value=(this.displayed.monthIndex+1)+"/"+ClickedDay+"/"+YearField.value;if(DepartDateObj!="undefined"){DepartDateObj=DepartDateObj+"_Object";try{var tmpDate=new Date;tmpDate.setDate(ClickedDay);tmpDate.setMonth(this.displayed.monthIndex);tmpDate.setFullYear(this.displayed.yearValue);if(DefaultDepartDaysFromArrivalDate==null){DefaultDepartDaysFromArrivalDate=DefaultDepartureDays}
tmpDate.setDate(tmpDate.getDate()+DefaultDepartDaysFromArrivalDate);eval(DepartDateObj).setPicked(tmpDate.getFullYear(),tmpDate.getMonth(),tmpDate.getDate())
eval(DepartDateObj).getDateField().value=tmpDate.getMonth()+1+"/"+tmpDate.getDate()+"/"+tmpDate.getFullYear();}
catch(err){alert('Error: The arrival calendar does not have the correct departure calendar ID defined, so the calendars are not linked. \n\nPlease specify the correct depart calendar ID (e.g. DateInput(<ArriveCalID>, <Required>, <DateFormat>,<DefaultArriveDate>,<DepartCalID>)).')}}}
function BuildCalendarDays(){var Rows=5;if(((this.displayed.dayCount==31)&&(this.displayed.firstDay>4))||((this.displayed.dayCount==30)&&(this.displayed.firstDay==6)))Rows=6;else if((this.displayed.dayCount==28)&&(this.displayed.firstDay==0))Rows=4;var HTML='<table width="'+(CellWidth*7)+'" cellspacing="0" cellpadding="1" style="cursor:default">';for(var j=0;j<Rows;j++){HTML+='<tr>';for(var i=1;i<=7;i++){Day=(j*7)+(i-this.displayed.firstDay);if((Day>=1)&&(Day<=this.displayed.dayCount)){if((this.displayed.yearValue==this.picked.yearValue)&&(this.displayed.monthIndex==this.picked.monthIndex)&&(Day==this.picked.day)){TextStyle='color:white;font-weight:bold;'
BackColor=SelectedDayBGColor;}
else{TextStyle='color:black;'
if(i/7==1){if(this.displayed.monthIndex>=5&&this.displayed.monthIndex<=7){BackColor=WeekendColor;}}
else{BackColor=CalBGColor;}}
if(Reservations!=null){for(x=0;x<Reservations.length;x++){if((Reservations[x].Month==eval(this.displayed.monthIndex+1))&&(Reservations[x].Day==Day)&&(Reservations[x].Year==this.displayed.yearValue)){if(BackColor!=SelectedDayBGColor){BackColor=BookedColor;}
break;}}}
if(BackColor==BookedColor||BackColor==SelectedDayBGColor||this.displayed.yearValue<Today.getFullYear()||(this.displayed.yearValue==Today.getFullYear()&&this.displayed.monthIndex<Today.getMonth())){HTML+='<td align="center" class="calendarDateInput" style="height:'+CellHeight+';width:'+CellWidth+';'+TextStyle+';background-color:'+BackColor+'"   onMouseOut="return '+this.objName+'.displayed.dayHover(this,false,\''+BackColor+'\')">'+Day+'</td>';}
else{HTML+='<td align="center" class="calendarDateInput" style="cursor:default;height:'+CellHeight+';width:'+CellWidth+';'+TextStyle+';background-color:'+BackColor+';text-decoration:underline" onClick="'+this.objName+'.pickDay('+Day+')" onMouseOver="return '+this.objName+'.displayed.dayHover(this,true,\''+BackColor+'\','+Day+')" onMouseOut="return '+this.objName+'.displayed.dayHover(this,false,\''+BackColor+'\')">'+Day+'</td>';}
BackColor=CalBGColor;}
else HTML+='<td class="calendarDateInput" style="height:'+CellHeight+'"> </td>';}
HTML+='</tr>';}
return HTML+='</table>';}
function GetGoodYear(YearDigits){if(YearDigits.length==4)return YearDigits;else{var Millennium=(YearDigits<Y2kPivotPoint)?2000:1900;return Millennium+parseInt(YearDigits,10);}}
function GetDayCount(SomeYear,SomeMonth){return((SomeMonth==1)&&((SomeYear%400==0)||((SomeYear%4==0)&&(SomeYear%100!=0))))?29:MonthDays[SomeMonth];}
function VirtualButton(Cell,ButtonDown){if(ButtonDown){Cell.style.borderLeft='buttonshadow 1px solid';Cell.style.borderTop='buttonshadow 1px solid';Cell.style.borderBottom='buttonhighlight 1px solid';Cell.style.borderRight='buttonhighlight 1px solid';}
else{Cell.style.borderLeft='buttonhighlight 1px solid';Cell.style.borderTop='buttonhighlight 1px solid';Cell.style.borderBottom='buttonshadow 1px solid';Cell.style.borderRight='buttonshadow 1px solid';}}
function NeighborHover(Cell,Over,DateObj){if(Over){VirtualButton(Cell,false);self.status='Click to view '+DateObj.fullName;}
else{Cell.style.border='buttonface 1px solid';self.status='';}
return true;}
function FixYearInput(YearField){var YearRE=new RegExp('\\d{'+YearField.defaultValue.length+'}');if(!YearRE.test(YearField.value))YearField.value=YearField.defaultValue;}
function CalIconHover(Over){var Message=(this.isShowing())?'hide':'show';self.status=(Over)?'Click to '+Message+' the calendar':'';return true;}
function CalTimerReset(){eval('clearTimeout('+this.timerID+')');eval(this.timerID+'=setTimeout(\''+this.objName+'.show()\','+(HideWait*1000)+')');}
function DoTimer(CancelTimer){if(CancelTimer)eval('clearTimeout('+this.timerID+')');else{eval(this.timerID+'=null');this.resetTimer();}}
function ShowCalendar(){if(this.isShowing()){var StopTimer=true;this.getCalendar().style.zIndex=--ZCounter;this.getCalendar().style.visibility='hidden';this.fixSelects(false);}
else{var StopTimer=false;this.fixSelects(true);this.getCalendar().style.zIndex=++ZCounter;this.getCalendar().style.visibility='visible';}
this.handleTimer(StopTimer);self.status='';}
function SetElementStatus(Hide){this.getDayList().style.visibility=(Hide)?'hidden':'visible';this.getYearField().style.visibility=(Hide)?'hidden':'visible';this.getCalendarLink().style.visibility=(Hide)?'hidden':'visible';}
function CheckMonthChange(MonthList){var DayList=this.getDayList();if(MonthList.options[MonthList.selectedIndex].value==''){DayList.selectedIndex=0;this.hideElements(true);this.setHidden('');}
else{this.hideElements(false);if(this.isShowing()){this.resetTimer();this.getCalendar().style.zIndex=++ZCounter;}
var DayPick=FixDayList(DayList,GetDayCount(this.picked.yearValue,MonthList.options[MonthList.selectedIndex].value));this.setPicked(this.picked.yearValue,MonthList.options[MonthList.selectedIndex].value,DayPick);}}
function CheckDayChange(DayList){if(this.isShowing())this.show();this.setPicked(this.picked.yearValue,this.picked.monthIndex,DayList.selectedIndex+1);}
function CheckYearInput(YearField){if((YearField.value.length==YearField.defaultValue.length)&&(YearField.defaultValue!=YearField.value)){if(this.isShowing()){this.resetTimer();this.getCalendar().style.zIndex=++ZCounter;}
var NewYear=GetGoodYear(YearField.value);var MonthList=this.getMonthList();var NewDay=FixDayList(this.getDayList(),GetDayCount(NewYear,this.picked.monthIndex));this.setPicked(NewYear,this.picked.monthIndex,NewDay);YearField.defaultValue=YearField.value;}}
function dateObject(){this.date=(arguments.length==1)?new Date(arguments[0]):new Date(arguments[0],arguments[1],arguments[2]);this.yearValue=this.date.getFullYear();this.monthIndex=this.date.getMonth();this.monthName=MonthNames[this.monthIndex];this.fullName=this.monthName+' '+this.yearValue;this.day=this.date.getDate();this.dayCount=GetDayCount(this.yearValue,this.monthIndex);var FirstDate=new Date(this.yearValue,this.monthIndex,1);this.firstDay=FirstDate.getDay();}
function storedMonthObject(DateFormat,DateYear,DateMonth,DateDay){dateObject.call(this,DateYear,DateMonth,DateDay);this.yearPad=this.yearValue.toString();this.monthPad=(this.monthIndex<9)?'0'+String(this.monthIndex+1):this.monthIndex+1;this.dayPad=(this.day<10)?'0'+this.day.toString():this.day;this.monthShort=this.monthName.substr(0,3).toUpperCase();if(DateFormat!='YYYYMMDD'){DateFormat.match(/(Y{2,4})$/);if(RegExp.$1.length==2)this.yearPad=this.yearPad.substr(2);}
if(/YYYYMMDD/.test(DateFormat))this.formatted=this.yearPad+this.monthPad+this.dayPad;else{if(/MM?\/DD?\/Y{2,4}/.test(DateFormat))var FirstPart=this.monthPad+'/'+this.dayPad+'/';else if(/DD?\/MM?\/Y{2,4}/.test(DateFormat))var FirstPart=this.dayPad+'/'+this.monthPad+'/';else if(/DD?-((MON)|(MMM))-Y{2,4}/.test(DateFormat))var FirstPart=this.dayPad+'-'+this.monthShort+'-';else if(/((MON)|(MMM))-DD?-Y{2,4}/.test(DateFormat))var FirstPart=this.monthShort+'-'+this.dayPad+'-';this.formatted=FirstPart+this.yearPad;}}
function displayMonthObject(ParentObject,DateYear,DateMonth,DateDay){dateObject.call(this,DateYear,DateMonth,DateDay);this.displayID=ParentObject.hiddenFieldName+'_Current_ID';this.getDisplay=new Function('return document.getElementById(this.displayID)');this.dayHover=DayCellHover;this.goCurrent=new Function(ParentObject.objName+'.getCalendar().style.zIndex=++ZCounter;'+ParentObject.objName+'.setDisplayed(Today.getFullYear(),Today.getMonth());');if(ParentObject.formNumber>=0)this.getDisplay().innerHTML=this.fullName;}
function neighborMonthObject(ParentObject,IDText,DateMS){dateObject.call(this,DateMS);this.buttonID=ParentObject.hiddenFieldName+'_'+IDText+'_ID';this.hover=new Function('C','O','NeighborHover(C,O,this)');this.getButton=new Function('return document.getElementById(this.buttonID)');this.go=new Function(ParentObject.objName+'.getCalendar().style.zIndex=++ZCounter;'+ParentObject.objName+'.setDisplayed(this.yearValue,this.monthIndex);');if(ParentObject.formNumber>=0)this.getButton().title=this.monthName;}
function SetDisplayedMonth(DispYear,DispMonth){this.displayed=new displayMonthObject(this,DispYear,DispMonth,1);var d=new Date();var MonTime;if((this.displayed.date.getMonth()>=eval(d.getMonth()+1)&&this.displayed.date.getFullYear()==d.getFullYear())||(this.displayed.date.getFullYear()!=d.getFullYear())){MonTime=86400000}
else{MonTime=0}
this.previous=new neighborMonthObject(this,'Previous',this.displayed.date.getTime()-MonTime);this.next=new neighborMonthObject(this,'Next',this.displayed.date.getTime()+(86400000*(this.displayed.dayCount+1)));if(this.formNumber>=0)this.getDayTable().innerHTML=this.buildCalendar();}
function SetPickedMonth(PickedYear,PickedMonth,PickedDay){this.picked=new storedMonthObject(this.format,PickedYear,PickedMonth,PickedDay);this.setHidden(this.picked.formatted);this.setDisplayed(PickedYear,PickedMonth);}
function calendarObject(DateName,DateFormat,DefaultDate,DepartDateName,DefaultDepartDate){this.hiddenFieldName=DateName;this.monthListName=DateName+'_Month';this.getDateID=DateName;this.dayListID=DateName+'_Day_ID';this.yearFieldID=DateName+'_Year_ID';this.monthDisplayID=DateName+'_Current_ID';this.calendarID=DateName+'_ID';this.dayTableID=DateName+'_DayTable_ID';this.calendarLinkID=this.calendarID+'_Link';this.timerID=this.calendarID+'_Timer';this.objName=DateName+'_Object';this.format=DateFormat;this.formNumber=-1;this.picked=null;this.displayed=null;this.previous=null;this.next=null;this.getDepartDateID=DepartDateName;this.getDefaultDepartDate=DefaultDepartDate;this.setPicked=SetPickedMonth;this.setDisplayed=SetDisplayedMonth;this.checkYear=CheckYearInput;this.fixYear=FixYearInput;this.changeMonth=CheckMonthChange;this.changeDay=CheckDayChange;this.resetTimer=CalTimerReset;this.hideElements=SetElementStatus;this.show=ShowCalendar;this.handleTimer=DoTimer;this.iconHover=CalIconHover;this.buildCalendar=BuildCalendarDays;this.pickDay=PickDisplayDay;this.fixSelects=FixSelectLists;this.setHidden=new Function('D','if (this.formNumber >= 0) this.getHiddenField().value=D');this.getHiddenField=new Function('return document.forms[this.formNumber].elements[this.hiddenFieldName]');this.getMonthList=new Function('return document.forms[this.formNumber].elements[this.monthListName]');this.getDateField=new Function('return document.getElementById(this.getDateID)');this.getDayList=new Function('return document.getElementById(this.dayListID)');this.getYearField=new Function('return document.getElementById(this.yearFieldID)');this.getCalendar=new Function('return document.getElementById(this.calendarID)');this.getDayTable=new Function('return document.getElementById(this.dayTableID)');this.getCalendarLink=new Function('return document.getElementById(this.calendarLinkID)');this.getMonthDisplay=new Function('return document.getElementById(this.monthDisplayID)');this.isShowing=new Function('return !(this.getCalendar().style.visibility != \'visible\')');function getMonthIndex(MonthAbbr){for(var MonPos=0;MonPos<MonthNames.length;MonPos++){if(MonthNames[MonPos].substr(0,3).toUpperCase()==MonthAbbr.toUpperCase())break;}
return MonPos;}
function SetGoodDate(CalObj,Notify){CalObj.setPicked(Today.getFullYear(),Today.getMonth(),Today.getDate());}
if(DefaultDate=='undefined')SetGoodDate(this,false);else{if(this.format=='YYYYMMDD'){(/^\d{8}$/.test(DefaultDate))?this.setPicked(DefaultDate.substr(0,4),parseInt(DefaultDate.substr(4,2),10)-1,DefaultDate.substr(6,2)):SetGoodDate(this,true);}
else{if(/\//.test(this.format)){if(/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/.test(DefaultDate)){if(this.format.substr(0,1)=='M'){var MonPart=RegExp.$1;var DayPart=RegExp.$2;}
else{var MonPart=RegExp.$2;var DayPart=RegExp.$1;}
this.setPicked(GetGoodYear(RegExp.$3),parseInt(MonPart,10)-1,DayPart);}
else SetGoodDate(this,true);}
else if(/-/.test(this.format)){var REMonths='';for(var j=0;j<MonthNames.length;j++){if(j>0)REMonths+='|';REMonths+=MonthNames[j].substr(0,3).toUpperCase();}
if(this.format.substr(0,1)=='D'){var DateRE=new RegExp('^(\\d{1,2})-('+REMonths+')-(\\d{2,4})$','i');(DateRE.test(DefaultDate))?this.setPicked(GetGoodYear(RegExp.$3),getMonthIndex(RegExp.$2),RegExp.$1):SetGoodDate(this,true);}
else{var DateRE=new RegExp('^('+REMonths+')-(\\d{1,2})-(\\d{2,4})$','i');(DateRE.test(DefaultDate))?this.setPicked(GetGoodYear(RegExp.$3),getMonthIndex(RegExp.$1),RegExp.$2):SetGoodDate(this,true);}}}}}
function DateInput(DateName,Required,DateFormat,DefaultDate,DepartDateName,DefaultDepartDate){CalId=DateName;if(DateName==undefined)document.writeln('<span style="color:red;font-size:'+FontSize+'px;font-family:'+FontFamily+';">ERROR: Missing required parameter in call to \'DateInput\': [name of hidden date field].</span>');else{if(Required==undefined)Required=false;if(DateFormat==undefined)DateFormat=DefaultDateFormat;else if((/^YYYYMMDD$/i.test(DateFormat))||(/^((MM?)|(DD?))\/((MM?)|(DD?))\/Y{2,4}$/i.test(DateFormat))||(/^((DD?)|((MON)|(MMM)))-((DD?)|((MON)|(MMM)))-Y{2,4}$/i.test(DateFormat)))DateFormat=DateFormat.toUpperCase();else{var AlertMessage='WARNING: The supplied date format for the \''+DateName+'\' field is not valid: '+DateFormat+'\nTherefore, the default date format will be used instead: '+DefaultDateFormat;var CurrentDate=new storedMonthObject(DefaultDateFormat,Today.getFullYear(),Today.getMonth(),Today.getDate());if(DefaultDate!=undefined)AlertMessage+='\n\nThe supplied date cannot be interpreted with the invalid format.\nTherefore, the current system date will be used instead: '+CurrentDate.formatted;DateFormat=DefaultDateFormat;DefaultDate=CurrentDate.formatted;alert(AlertMessage);}
eval(DateName+'_Object=new calendarObject(\''+DateName+'\',\''+DateFormat+'\',\''+DefaultDate+'\',\''+DepartDateName+'\','+DefaultDepartDate+')');if((!Required)&&(DefaultDate==undefined)){var InitialStatus=' style="visibility:hidden"';var InitialDate='';}
else{var InitialStatus='';var InitialDate=eval(DateName+'_Object.picked.formatted');}
if((Required)&&(DefaultDate==undefined))DefaultDate=eval(DateName+'_Object.picked.formatted');with(document){writeln('<table cellpadding="0" cellspacing="0"><tr>'+String.fromCharCode(13)+'<td valign="middle">');writeln('<input type="text" id="'+DateName+'"  name="'+DateName+'" value="'+InitialDate+'" style="width:'+custwidth+'px">');for(var f=0;f<forms.length;f++){for(var e=0;e<forms[f].elements.length;e++){if(typeof forms[f].elements[e].type=='string'){if((forms[f].elements[e].name==DateName)){eval(DateName+'_Object.formNumber='+f);break;}}}}
writeln('<input'+InitialStatus+' class="calendarDateInput" type="hidden" id="'+DateName+'_Year_ID"')
write('<td>'+String.fromCharCode(13)+'<a'+InitialStatus+' id="'+DateName+'_ID_Link" href="javascript:'+DateName+'_Object.show()" onMouseOver="return '+DateName+'_Object.iconHover(true)" onMouseOut="return '+DateName+'_Object.iconHover(false)"><img src="'+ImageURL+'"  title="Calendar" border="0" align="bottom"></a> ');writeln('</td></tr><tr><td><div style="position:relative"><span  id="'+DateName+'_ID" style="position:absolute;top:0px;left:-30px;visibility:hidden;width:'+(CellWidth*7)+'px;background-color:'+CalBGColor+';border:1px solid dimgray;" onMouseOver="'+DateName+'_Object.handleTimer(true)" onMouseOut="'+DateName+'_Object.handleTimer(false)">');writeln('<table width="'+(CellWidth*7)+'" cellspacing="0" cellpadding="1">'+String.fromCharCode(13)+'<tr style="background-color:'+TopRowBGColor+';">');writeln('<td id="'+DateName+'_Previous_ID" style="cursor:default" align="center" class="calendarDateInput" style="height:'+CellHeight+'" onClick="'+DateName+'_Object.previous.go();MonthClicked=true;" onMouseDown="VirtualButton(this,true)" onMouseUp="VirtualButton(this,false)" onMouseOver="return '+DateName+'_Object.previous.hover(this,true)" onMouseOut="return '+DateName+'_Object.previous.hover(this,false)" title="'+eval(DateName+'_Object.previous.monthName')+'"><img src="'+PrevURL+'" ></td>');writeln('<td id="'+DateName+'_Current_ID" style="cursor:pointer" align="center" class="calendarDateInput" style="height:'+CellHeight+'" colspan="5" onClick="'+DateName+'_Object.displayed.goCurrent()" onMouseOver="self.status=\'Click to view '+eval(DateName+'_Object.displayed.fullName')+'\';return true;" onMouseOut="self.status=\'\';return true;" title="Show Current Month">'+eval(DateName+'_Object.displayed.fullName')+'</td>');writeln('<td id="'+DateName+'_Next_ID" style="cursor:default" align="center" class="calendarDateInput" style="height:'+CellHeight+'" onClick="'+DateName+'_Object.next.go();MonthClicked=true" onMouseDown="VirtualButton(this,true)" onMouseUp="VirtualButton(this,false)" onMouseOver="return '+DateName+'_Object.next.hover(this,true)" onMouseOut="return '+DateName+'_Object.next.hover(this,false)" title="'+eval(DateName+'_Object.next.monthName')+'"><img src="'+NextURL+'" ></td></tr>'+String.fromCharCode(13)+'<tr>');for(var w=0;w<7;w++)writeln('<td width="18" align="center" class="calendarDateInput" style="height:'+CellHeight+';width:'+CellWidth+';font-weight:bold;border-top:1px solid dimgray;border-bottom:1px solid dimgray;">'+WeekDays[w]+'</td>');writeln('</tr>'+String.fromCharCode(13)+'</table>'+String.fromCharCode(13)+'<span id="'+DateName+'_DayTable_ID">'+eval(DateName+'_Object.buildCalendar()')+'</span>'+String.fromCharCode(13)+'</span></div></td></tr>'+String.fromCharCode(13)+'</td>'+String.fromCharCode(13)+'</tr>'+String.fromCharCode(13)+'</table>');}}}
function HideCalendar(){if(CalId!=null){if(MonthClicked==false&&eval(CalId+'_Object.isShowing()')){eval(CalId+'_Object.show()')}}
MonthClicked=false;}
window.document.onclick=HideCalendar;