function calrows() {
temp8=ad+"Month";
monther=document.getElementById(temp8).selectedIndex;
var calstart=MDY[monther];
var calend=MD[monther];
var dowstart=DOW[monther];
calbody='
';
if (dowstart==1) {calbody=calbody+'| <\/td>';}
if (dowstart>1) {calbody=calbody+' | <\/td>';}
for (dloop=1;dloop<=calend;dloop++)
{dowstart=dowstart+1;
if (dowstart==8) {dowstart=1;
calbody=calbody+' |
';}
calbody=calbody+"=dloop)) {csd="bdayarr";}}
if (monther==0 && MDY[0]>dloop) {calbody=calbody+' class="bpast">'+dloop+"<\/td>";} else {
if (
(document.getElementById("DepartureMonth").selectedIndex==monther && document.getElementById("DepartureDay").selectedIndex==dloop-1) ||
(document.getElementById("ArrivalMonth").selectedIndex==monther && document.getElementById("ArrivalDay").selectedIndex==dloop-1)
) {calbody=calbody+' class="bstart"';}
else if (
(ad=="Departure" && document.getElementById("ArrivalMonth").selectedIndex=dloop
) ||
(ad=="Departure" && document.getElementById("ArrivalMonth").selectedIndex==document.getElementById("DepartureMonth").selectedIndex
&& document.getElementById("DepartureDay").selectedIndex>=dloop
&& document.getElementById("ArrivalDay").selectedIndex=dloop
&& document.getElementById("ArrivalDay").selectedIndex';
if (csd=="bdayarr" ||
(document.getElementById("ArrivalMonth").selectedIndex==document.getElementById("DepartureMonth").selectedIndex && document.getElementById("ArrivalDay").selectedIndex==dloop-1 && ad=="Departure")
) {calbody=calbody+dloop;} else {calbody=calbody+''+dloop+"<\/a>";}
calbody=calbody+"<\/td>";}
if (dowstart==7) {
calbody=calbody+"<\/tr>";}
}
if (dowstart==6) {calbody=calbody+'| <\/td><\/tr>';}
if (dowstart<6) {calbody=calbody+' | <\/td><\/tr>';}
}
function dayofmonth(tempd) {
document.getElementById(ad+"Day").selectedIndex=tempd;
temp8=ad+"Month";
temp7=monther;
validatedates();
hidecal();
}
function validatedates() {
if (temp8=="ArrivalMonth" && document.getElementById("DepartureMonth").selectedIndextemp7)
{document.getElementById("ArrivalMonth").selectedIndex=temp7;}
checkdayofmonth();
if (temp8=="ArrivalMonth" && document.getElementById("DepartureMonth").selectedIndex==temp7 &&
document.getElementById("DepartureDay").selectedIndex<=document.getElementById("ArrivalDay").selectedIndex)
{
document.getElementById("DepartureDay").selectedIndex=document.getElementById("ArrivalDay").selectedIndex;
if (document.getElementById("DepartureDay").selectedIndex=document.getElementById("DepartureDay").selectedIndex)
{
document.getElementById("DepartureDay").selectedIndex=MD[temp7]-1;
showcal(); }
checkdayofmonth();
if (document.getElementById("ArrivalMonth").selectedIndex==0 &&
document.getElementById("ArrivalDay").selectedIndex-1+MD[document.getElementById("ArrivalMonth").selectedIndex])
{document.getElementById("ArrivalDay").selectedIndex=-1+MD[document.getElementById("ArrivalMonth").selectedIndex];}
if (document.getElementById("DepartureDay").selectedIndex>-1+MD[document.getElementById("DepartureMonth").selectedIndex])
{document.getElementById("DepartureDay").selectedIndex=-1+MD[document.getElementById("DepartureMonth").selectedIndex];}
}
function back1(temp2) {temp7=temp2-1;
temp8=ad+"Month";
document.getElementById(temp8).selectedIndex=temp7;
if (ad=="Departure" && document.getElementById("ArrivalMonth").selectedIndex==document.getElementById("DepartureMonth").selectedIndex) {document.getElementById("DepartureDay").selectedIndex=MD[temp7]-1;}
validatedates();
showcal();
}
function fwd1(temp2) {temp7=temp2+1;
temp8=ad+"Month";
document.getElementById(temp8).selectedIndex=temp7;
if (ad=="Arrival" && document.getElementById("ArrivalMonth").selectedIndex==document.getElementById("DepartureMonth").selectedIndex) {document.getElementById("ArrivalDay").selectedIndex=0;}
validatedates();
showcal();
}
function calbod(temp2) {
temp=temp2+"Month";
tempmonth=document.getElementById(temp).selectedIndex;
var temp=ad+"Day";
tempday=document.getElementById(temp).selectedIndex;
tempback=' ';
tempfwd=' ';
if (document.getElementById("ArrivalMonth").selectedIndex==document.getElementById("DepartureMonth").selectedIndex && ad=="Departure")
{} else if (tempmonth>0) {temp5=tempmonth-1;
tempback='<<\/a>';}
if (tempmonth<11) {temp5=tempmonth+1;
tempfwd='><\/a>';}
temp3='| '+tempback+'<\/td> | '+MNM[tempmonth]+'<\/td> | '+tempfwd+'<\/td><\/tr><\/table><\/td><\/tr> | | Sun<\/td> | Mon<\/td> | Tue<\/td> | Wed<\/td> | Thu<\/td> | Fri<\/td> | Sat<\/td><\/tr>';
return(temp3);
}
function showcal(){
calheader=' |
|
|
| |