<!--
function initializeDates(){var d=new Date();d.setMonth(d.getMonth(),d.getDate()+14);document.forms['myForm'].elements['cki'].value=getFormattedMonth(d.getMonth())+"/"+getFormattedDay(d.getDate())+"/"+d.getFullYear();}
function travelNowize(){var intNight=document.forms['myForm'].numberOfNights.value;var dt=new Date(document.forms['myForm'].cki.value);var adt=new Date(dt.getFullYear(),dt.getMonth(),dt.getDate()+(document.forms['myForm'].numberOfNights.selectedIndex+1));document.forms['myForm'].departureDay.value=adt.getDate();document.forms['myForm'].departureMonth.value=adt.getMonth();document.forms['myForm'].arrivalDay.value=dt.getDate();document.forms['myForm'].arrivalMonth.value=dt.getMonth();}
function getFormattedMonth(themonth){if(themonth<9){switch(themonth){case 0:return'01';case 1:return'02';case 2:return'03';case 3:return'04';case 4:return'05';case 5:return'06';case 6:return'07';case 7:return'08';case 8:return'09';}}
return themonth+1;}
function getFormattedDay(theday){if(theday<10){switch(theday){case 1:return'01';case 2:return'02';case 3:return'03';case 4:return'04';case 5:return'05';case 6:return'06';case 7:return'07';case 8:return'08';case 9:return'09';}}
return theday;}
function update(themonth,theday,theyear){document.forms[fName].elements['cki'].value=getFormattedMonth(themonth)+"/"+getFormattedDay(theday)+"/"+theyear;testWindow.close();}
function loadCalendar(viewMonth){testWindow.document.close();testWindow.document.open();var day_of_week=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");var month_of_year=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var dateObj=new Date();var year=dateObj.getFullYear();var month=dateObj.getMonth();var today=dateObj.getDate();var weekday=dateObj.getDay();var DAYS_OF_WEEK=7;var DAYS_OF_MONTH=31;var cal;if(viewMonth<month){year=year+1;}
if(year<1900){year+=1900;}
month=viewMonth;dateObj.setDate(1);dateObj.setMonth(month);dateObj.setFullYear((year));var TR_start='<TR>';var TR_end='</TR>';var highlight_start='<TD WIDTH="30"><TABLE CELLSPACING=0 BORDER=1 BORDERCOLOR=CCCCCC><TR><TD WIDTH=20><B><CENTER>';var highlight_end='</CENTER></TD></TR></TABLE></B>';var TD_start='<TD WIDTH="30"><CENTER>';var TD_end='</CENTER></TD>';var prevM=month-1;var nextM=month+1;if(nextM==12){nextM=0;}
if(prevM==-1){prevM=11;}
cal='<html><head><title>Calendar</title></head><body>';cal+='<style>a{cursor: hand}body,table,td{cursor: default;font-family:sans-serif;font-size:12px;color:black;}p.masterHEADER {background: gray; color:white; font-weight: bold; font-size: 13px;margin:0;padding:5px;text-align: center;}</style>';cal+='<div style="border:black 1px solid;">';cal+='<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" width="100%">'+TR_start;cal+='<TD COLSPAN="'+DAYS_OF_WEEK+'"><p class=masterHEADER>';cal+=month_of_year[month]+'   '+year+'</p>'+TD_end+TR_end;cal+=TR_start;for(index=0;index<DAYS_OF_WEEK;index++){cal+=TD_start+day_of_week[index]+TD_end;}
cal+=TD_end+TR_end;cal+=TR_start;for(index=0;index<dateObj.getDay();index++){cal+=TD_start+'  '+TD_end;}
for(index=0;index<DAYS_OF_MONTH;index++){if(dateObj.getDate()>index){week_day=dateObj.getDay();if(week_day==0){cal+=TR_start;}
if(week_day!=DAYS_OF_WEEK){var day=dateObj.getDate();cal+=TD_start+"<span onclick='window.opener.update("+month+","+day+","+year+")'>"+day+"</span>"+TD_end;}
if(week_day==DAYS_OF_WEEK){cal+=TR_end;}}
dateObj.setDate(dateObj.getDate()+1);}
cal+='</td></TR></TABLE></div><br>';cal+='<div align="center"><a href="javascript:" onClick="window.opener.loadCalendar('+prevM+');">&lt;&lt;</a>&nbsp;&nbsp;&nbsp;&nbsp;';cal+='<a href="javascript:" onClick="window.opener.loadCalendar('+nextM+');">&gt;&gt;</a></div>';cal+='<a href="javascript:window.close();" style="float:right">close</a>';cal+='</body></html>';testWindow.document.write(cal);}
var testWindow;var fieldName;var fName;function openCalendar(formName,field){fieldName=field;fName=formName;testWindow=window.open('','dates','width=300,height=225,resizable=1,status=1,menubar=0,location=0');var month=document.forms[fName].elements[fieldName].value;var dateRegExp=new RegExp("^(([1][0-2])|([0]?[1-9]))/(([0123]?[0-9])|[0-9])(/((20)?[0-9]{2}))?");if(month.match(dateRegExp)){month=document.forms[fName].elements[fieldName].value.split("/")[0]-1;}else{month=new Date().getMonth();}
loadCalendar(month);}
