<!-- Original:  Nick Korosi (nfk2000@hotmail.com) -->



<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->



<!-- Begin



var dDate = new Date();

var dat = new Date();

var dCurMonth = dDate.getMonth();

var dCurDayOfMonth = dDate.getDate();

var dCurYear = dDate.getFullYear();

var objPrevElement = new Object();

var obj = new Object;



var dCalDate2 = new Date();

var dCalDate22 = new Date();



function fToggleColor(myElement) {

var toggleColor = "#ff0000";

if (myElement.id == "calDateText") {

if (myElement.color == toggleColor) {

myElement.color = "";

} else {

myElement.color = toggleColor;

   }

} else if (myElement.id == "calCell") {

for (var i in myElement.children) {

if (myElement.children[i].id == "calDateText") {

if (myElement.children[i].color == toggleColor) {

myElement.children[i].color = "";

} else {

myElement.children[i].color = toggleColor;

            }

         }

      }

   }

   

   if (myElement.id == "calDateText1") {

if (myElement.color == toggleColor) {

myElement.color = "";

} else {

myElement.color = toggleColor;

   }

} else if (myElement.id == "calCell1") {

for (var i in myElement.children) {

if (myElement.children[i].id == "calDateText1") {

if (myElement.children[i].color == toggleColor) {

myElement.children[i].color = "";

} else {

myElement.children[i].color = toggleColor;

            }

         }

      }

   }

}





function setField(obj1,mth,yr,dy){

	obj1.value = mth + "/" + dy + "/" + yr;

}



function getSelectedIndex(selectDate,obj1){

	ret = -1;

	for (i = 0; i < obj1.options.length; i++) {

		if(obj1.options[i].value == selectDate){

			ret = i;

			break;

		}

	}

	return ret;

}



function setText(){

	dat = dCalDate22;

	mth = dCalDate22.getMonth() + 1;

	yr = dCalDate22.getYear();

	

	if(obj.name == "txtReturndate"){

		newIndex = getSelectedIndex(mth,document.all.DropoffMonth);

		if(newIndex != -1){

			document.all.DropoffMonth.selectedIndex = newIndex;

			setDay(document.all.DropoffYear,document.all.DropoffMonth,document.all.DropoffDay);

		}

	} else {

		newIndex = getSelectedIndex(mth,document.all.PickupMonth);

		if(newIndex != -1){

			document.all.PickupMonth.selectedIndex = newIndex;

			setDay(document.all.PickupYear,document.all.PickupMonth,document.all.PickupDay);

		}

	}

	

	if(obj.name == "txtReturndate"){

		newIndex = getSelectedIndex(document.all.calSelectedDate.value,document.all.DropoffDay);

		if(newIndex != -1){

			document.all.DropoffDay.selectedIndex = newIndex;

		}

	} else {

		newIndex = getSelectedIndex(document.all.calSelectedDate.value,document.all.PickupDay);

		if(newIndex != -1){

			document.all.PickupDay.selectedIndex = newIndex;

		}

	}

	

	obj.value = mth + "/" + document.all.calSelectedDate.value + "/" + yr;

	

	checkyear();

	checkmonth();

	checkdate();

}



function setText2(){

	dat = dCalDate2;

	mth = dCalDate2.getMonth();	

	yr = dCalDate2.getYear();

	

	if(mth == 0){

		stYear = parseInt(document.all.PickupYear.options[0].value);

		stYear1 = dCalDate2.getYear();

		dif = parseInt(stYear1) - stYear;

		if(obj.name == "txtPickupdate"){

			document.all.PickupYear.selectedIndex = dif;

			document.all.PickupMonth.selectedIndex = 0;

		} else {

			document.all.DropoffYear.selectedIndex = dif;

			document.all.DropoffMonth.selectedIndex = 0;

		}

	} else {

		if(obj.name == "txtPickupdate"){

			newIndex = getSelectedIndex(mth + 1,document.all.PickupMonth);

			if(newIndex != -1){

				document.all.PickupMonth.selectedIndex = newIndex;

				setDay(document.all.PickupYear,document.all.PickupMonth,document.all.PickupDay);

			}

		} else {

			newIndex = getSelectedIndex(mth + 1,document.all.DropoffMonth);

			if(newIndex != -1){

				document.all.DropoffMonth.selectedIndex = newIndex;

				setDay(document.all.DropoffYear,document.all.DropoffMonth,document.all.DropoffDay);

			}

		}

		

	}

	

	

	if(obj.name == "txtReturndate"){

		newIndex = getSelectedIndex(document.all.calSelectedDate.value,document.all.DropoffDay);

		if(newIndex != -1){

			document.all.DropoffDay.selectedIndex = newIndex;

		}

	} else {

		newIndex = getSelectedIndex(document.all.calSelectedDate.value,document.all.PickupDay);

		if(newIndex != -1){

			document.all.PickupDay.selectedIndex = newIndex;

		}

	}

	



	obj.value = mth + "/" + document.all.calSelectedDate.value + "/" + yr;

	checkyear();

	checkmonth();

	checkdate();

}



function fSetSelectedDay(myElement){

if (myElement.id == "calCell") {

if (!isNaN(parseInt(myElement.children["calDateText"].innerText))) {

myElement.bgColor = "#c0c0c0";

objPrevElement.bgColor = "";



//dCalDate2.getYear

//dCalDate2.getMonth]

	var ddDate = new Date();

	

	var day = parseInt(myElement.children["calDateText"].innerText);

	

	dCalDate22 = new Date(dCalDate22.getFullYear(),dCalDate22.getMonth(),day)

	

	

	if(dCalDate22 > ddDate || dCalDate22.getDate() == ddDate.getDate()){

		document.all.select1.style.visibility='visible';

		document.all.select2.style.visibility='visible';

		document.all.Layer3.style.visibility='hidden';

		document.all.calSelectedDate.value = parseInt(myElement.children["calDateText"].innerText);

		setText();

		

	}

		objPrevElement = myElement;

      }

   }

   

   //alert(dCalDate22);

   

   ddDate = new Date();

   if (myElement.id == "calCell1") {

if (!isNaN(parseInt(myElement.children["calDateText1"].innerText))) {

myElement.bgColor = "#c0c0c0";

objPrevElement.bgColor = "";



var day = parseInt(myElement.children["calDateText1"].innerText);

dCalDate2 = new Date(dCalDate2.getFullYear(),dCalDate2.getMonth(),day);



if(dCalDate2 > ddDate || dCalDate2 == ddDate){

	document.all.Layer3.style.visibility='hidden';

	document.all.select1.style.visibility='visible';

	document.all.select2.style.visibility='visible';

	document.all.calSelectedDate.value = parseInt(myElement.children["calDateText1"].innerText);

	setText2();

	

}

	objPrevElement = myElement;

      }

   }

   

   

}





function fGetDaysInMonth(iMonth, iYear) {

var dPrevDate = new Date(iYear, iMonth, 0);

return dPrevDate.getDate();

}

function fBuildCal(iYear, iMonth, iDayStyle) {

var aMonth = new Array();

aMonth[0] = new Array(7);

aMonth[1] = new Array(7);

aMonth[2] = new Array(7);

aMonth[3] = new Array(7);

aMonth[4] = new Array(7);

aMonth[5] = new Array(7);

aMonth[6] = new Array(7);



var dCalDate = new Date(iYear, iMonth-1, 1);



var iDayOfFirst = dCalDate.getDay();

var iDaysInMonth = fGetDaysInMonth(iMonth, iYear);

var iVarDate = 1;

var i, d, w;

if (iDayStyle == 2) {

aMonth[0][0] = "Sunday";

aMonth[0][1] = "Monday";

aMonth[0][2] = "Tuesday";

aMonth[0][3] = "Wednesday";

aMonth[0][4] = "Thursday";

aMonth[0][5] = "Friday";

aMonth[0][6] = "Saturday";

} else if (iDayStyle == 1) {

aMonth[0][0] = "Sun";

aMonth[0][1] = "Mon";

aMonth[0][2] = "Tue";

aMonth[0][3] = "Wed";

aMonth[0][4] = "Thu";

aMonth[0][5] = "Fri";

aMonth[0][6] = "Sat";

} else {

aMonth[0][0] = "Su";

aMonth[0][1] = "Mo";

aMonth[0][2] = "Tu";

aMonth[0][3] = "We";

aMonth[0][4] = "Th";

aMonth[0][5] = "Fr";

aMonth[0][6] = "Sa";

}



var curDate = new Date();



for (d = iDayOfFirst; d < 7; d++) {

	//var dCalDate22 = new Date(iYear, iMonth-1, iVarDate);
//
	//if(dCalDate22 >= curDate){

		aMonth[1][d] = iVarDate;

		iVarDate++;

	//} else {

	//	aMonth[1][d] = 0
	//	iVarDate++;

	//}

}







for (w = 2; w < 7; w++) {

for (d = 0; d < 7; d++) {

	//var dCalDate22 = new Date(iYear, iMonth-1, parseInt(iVarDate) + 1);	

	//if(dCalDate22 > curDate || dCalDate22 == curDate){

		if (iVarDate <= iDaysInMonth) {
//
			aMonth[w][d] = iVarDate;

			iVarDate++;

		}

	//} else {
		
	//	aMonth[w][d] = 0;
	//	iVarDate++;

	//}

}

}





return aMonth;

}

function fDrawCal(iYear, iMonth, iCellWidth, iCellHeight, sDateTextSize, sDateTextWeight, iDayStyle) {

var myMonth;

myMonth = fBuildCal(iYear, iMonth, iDayStyle);

document.write("<table cellspacing=\"0\" width=\"90px\" height=\"50px\" cellpadding=2 style=\"border: 1px #bf8660 solid \" >")

document.write("<tr bgcolor=\"#bf8660\">");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold; color:#ffffff'>" + myMonth[0][0] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold; color:#ffffff'>" + myMonth[0][1] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold; color:#ffffff'>" + myMonth[0][2] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold; color:#ffffff'>" + myMonth[0][3] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold; color:#ffffff'>" + myMonth[0][4] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold; color:#ffffff'>" + myMonth[0][5] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold; color:#ffffff'>" + myMonth[0][6] + "</td>");

document.write("</tr>");

var zeroCount = 1;

for (w = 1; w < 7; w++) {

	document.write("<tr>")

	for (d = 0; d < 7; d++) {
		
		document.write("<td background='images/bg_body.gif' align='left' valign='top' width='" + iCellWidth + "' height='" + iCellHeight + "' id=calCell style='CURSOR:Hand' onMouseOver='fToggleColor(this)' onMouseOut='fToggleColor(this)' onclick=fSetSelectedDay(this)>");

		if (!isNaN(myMonth[w][d])) {
			
			

		document.write("<font id=calDateText onMouseOver='fToggleColor(this)' CURSOR:Hand;FONT-FAMILY:Arial;FONT-SIZE:" + sDateTextSize + ";FONT-WEIGHT:" + sDateTextWeight + "' onMouseOut='fToggleColor(this)' onclick=fSetSelectedDay(this)>" + myMonth[w][d] + "</font>");

		} else {

		document.write("<font id=calDateText onMouseOver='fToggleColor(this)' style='CURSOR:Hand;FONT-FAMILY:Arial;FONT-SIZE:" + sDateTextSize + ";FONT-WEIGHT:" + sDateTextWeight + "' onMouseOut='fToggleColor(this)' onclick=fSetSelectedDay(this)></font>");

		}

		document.write("</td>")

	}

	document.write("</tr>");

}

document.write("</table>")

}



function fDrawCal2(iYear, iMonth, iCellWidth, iCellHeight, sDateTextSize, sDateTextWeight, iDayStyle) {

var myMonth1;

myMonth1 = fBuildCal(iYear, iMonth, iDayStyle);

document.write("<table cellspacing=\"0\" width=\"90px\" height=\"50px\" cellpadding=2 style=\"border: 1px #bf8660 solid \" >")

document.write("<tr bgcolor=\"#bf8660\">");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold;color:#ffffff'>" + myMonth1[0][0] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold;color:#ffffff'>" + myMonth1[0][1] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold;color:#ffffff'>" + myMonth1[0][2] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold;color:#ffffff'>" + myMonth1[0][3] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold;color:#ffffff'>" + myMonth1[0][4] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold;color:#ffffff'>" + myMonth1[0][5] + "</td>");

document.write("<td background='images/bg_button.gif' align='center' style='FONT-FAMILY:Arial;FONT-SIZE:10px;FONT-WEIGHT: bold;color:#ffffff'>" + myMonth1[0][6] + "</td>");

document.write("</tr>");

for (w = 1; w < 7; w++) {

document.write("<tr>")

for (d = 0; d < 7; d++) {

document.write("<td background='images/bg_body.gif' align='left' valign='top' width='" + iCellWidth + "' height='" + iCellHeight + "' id=calCell1 style='CURSOR:Hand' onMouseOver='fToggleColor(this)' onMouseOut='fToggleColor(this)' onclick=fSetSelectedDay(this)>");

if (!isNaN(myMonth1[w][d])) {

document.write("<font id=calDateText1 onMouseOver='fToggleColor(this)' style='text-decoration:underline;CURSOR:Hand;FONT-FAMILY:Arial;FONT-SIZE:" + sDateTextSize + ";FONT-WEIGHT:" + sDateTextWeight + "' onMouseOut='fToggleColor(this)' onclick=fSetSelectedDay(this)>" + myMonth1[w][d] + "</font>");

} else {

document.write("<font id=calDateText1 onMouseOver='fToggleColor(this)' style='CURSOR:Hand;FONT-FAMILY:Arial;FONT-SIZE:" + sDateTextSize + ";FONT-WEIGHT:" + sDateTextWeight + "' onMouseOut='fToggleColor(this)' onclick=fSetSelectedDay(this)> </font>");

}

document.write("</td>")

}

document.write("</tr>");

}

document.write("</table>")

}



function getMonthString(mon){

var mont = ""

	switch(mon){

		case 1:

			mont = "January";

			break;

		case 2:

			mont = "February";

			break;

		case 3:

			mont = "March";

			break;

		case 4:

			mont = "April";

			break;

		case 5:

			mont = "May";

			break;

		case 6:

			mont = "June";

			break;

		case 7:

			mont = "July";

			break;

		case 8:

			mont = "August";

			break;

		case 9:

			mont = "September";

			break;

		case 10:

			mont = "October";

			break;

		case 11:

			mont = "November";

			break;

		case 12:

			mont = "December";

			break;

	}

	return mont;

}

function getMonthString2(mon){

var mont = ""

	switch(mon){

		case 1:

			mont = "Jan";

			break;

		case 2:

			mont = "Feb";

			break;

		case 3:

			mont = "Mar";

			break;

		case 4:

			mont = "Apr";

			break;

		case 5:

			mont = "May";

			break;

		case 6:

			mont = "Jun";

			break;

		case 7:

			mont = "Jul";

			break;

		case 8:

			mont = "Aug";

			break;

		case 9:

			mont = "Sep";

			break;

		case 10:

			mont = "Oct";

			break;



		case 11:

			mont = "Nov";

			break;

		case 12:

			mont = "Dec";

			break;

	}

	return mont;

}



function colorChangePSDates(){

}



function fUpdateCal(iYear, iMonth) {

	

	stYear = parseInt(document.all.PickupYear.options[0].value);

	dif = parseInt(iYear) - stYear;

	

	if(obj.name == "txtPickupdate"){

		document.all.PickupYear.selectedIndex = dif;

		document.all.PickupMonth.selectedIndex = parseInt(iMonth) - 1;

		checkyear();

		checkmonth();

		checkdate();

	} else {

		document.all.DropoffYear.selectedIndex = dif;

		document.all.DropoffMonth.selectedIndex = parseInt(iMonth) - 1;

		checkyear();

		checkmonth();

		checkdate();

	}	

		

	if(iMonth == 0){

		iYear = parseInt(iYear) - 1;

		myMonth = fBuildCal(iYear, 1);

		iMonth = 1;

		dCalDate22 = new Date(iYear, 0, 1);

	} else {	

		iMonth2 = iMonth;

		myMonth = fBuildCal(iYear, iMonth);

		dCalDate22 = new Date(iYear, parseInt(iMonth) - 1, 1);

	}

	

	iMonth2 = iMonth;	

	

	if(iMonth2 == 12){

		iYear2 = parseInt(iYear) + 1;

		myMonth1 = fBuildCal(iYear2, 1);

		iMonth3 = 1;

		dCalDate2 = new Date(iYear2, 0, 1);

	} else {

		iMonth2 = parseInt(iMonth2) + 1;

		iMonth3 = parseInt(iMonth2);

		iYear2 = iYear;

		myMonth1 = fBuildCal(iYear, iMonth2);

		dCalDate2 = new Date(iYear, iMonth2 - 1, 1);

	}

	

	

	

	//dCalDate2 = new Date(iYear2, iMonth2 - , 1);

	/*if(iMonth == 12){

		myMonth1 = fBuildCal(iYear + 1, 1);

	} else {

		myMonth1 = fBuildCal(iYear, iMonth + 1);

	}*/


	curDate = new Date();
	objPrevElement.bgColor = "";

	document.all.calSelectedDate.value = "";

	for (w = 1; w < 7; w++) {

		for (d = 0; d < 7; d++) {

			if (!isNaN(myMonth[w][d])) {

				calDateText[((7*w)+d)-7].innerText = myMonth[w][d];
				chkDate = new Date(iYear,iMonth - 1,parseInt(myMonth[w][d]) + 1);
				if(chkDate < curDate){
					calDateText[((7*w)+d)-7].style.color = "#796D55";
					calDateText[((7*w)+d)-7].style.textDecoration = "none";
				} else {
					calDateText[((7*w)+d)-7].style.color = "#000000";
					calDateText[((7*w)+d)-7].style.textDecoration = "underline";
				}

			} else {

				calDateText[((7*w)+d)-7].innerText = " ";
				calDateText[((7*w)+d)-7].style.textDecoration = "none";
	         }

    	}

   }

   

   for (w = 1; w < 7; w++) {

		for (d = 0; d < 7; d++) {

			if (!isNaN(myMonth1[w][d])) {

				calDateText1[((7*w)+d)-7].innerText = myMonth1[w][d];

			} else {

				calDateText1[((7*w)+d)-7].innerText = " ";

	         }

    	}

   }

   iMonth4 = parseInt(iMonth);

   Previous.innerText = getMonthString(iMonth4) + " " + iYear;

   mont2Title.innerText = getMonthString(iMonth3) + " " + iYear2;

   

   

   if(iMonth == 1){

   		Year = parseInt(iYear) - 1;

		Month = 12;

   } else {

   		Year = parseInt(iYear);

		Month = parseInt(iMonth) - 1;

   }

   

   if(Year >= stYear){

	   var d2 = new Date();

	   

	   if(Month >= (d2.getMonth() + 1)){

		   PRVLink.href = "javascript:fUpdateCal(" + Year + ","+Month+");";

	   } else {
		   if(Year == iYear){
		  	 PRVLink.href = "javascript:void(0);";
		   } else {
			   PRVLink.href = "javascript:fUpdateCal(" + Year + ","+Month+");";
		   }

	   }

   } else {

	   PRVLink.href = "javascript:void(0);";

   }

   

   

   

   if(parseInt(Month) == 12){

   		Month = iMonth + 1;

		Year = iYear;

   } else {

   		Month = Month + 2;

		if(Month > 12){

			Month = 1;

			Year = iYear + 1;

		} else {

			Year = iYear;	

		}

		

   }

   

   maxyt = stYear + 10 - 1;

   

   if(Year <= maxyt){

	   NextLink.href = "javascript:fUpdateCal("+Year+","+Month+");";

   } else {

	   NextLink.href = "javascript:void(0);";

   }

}

/*function checkDate(field1,field2){	

	if(field1.value == ""){

		alert("Pickup Date was Not Specified!");

		field1.select();

		field2.value = "";

		field1.focus();

	} else {

		if(field2.value == ""){

			alert("Drop off Deate was Not Specified");			

		} else {

			strDateArray1 = field1.value.split("/");

			strDateArray2 = field2.value.split("/");

			

			strDay1 = strDateArray1[1];

			strMonth1 = strDateArray1[0];

			strYear1 = strDateArray1[2];

	

			strDay2 = strDateArray2[1];

			strMonth2 = strDateArray2[0];

			strYear2 = strDateArray2[2];

					

			if( parseInt(strYear1) > parseInt(strYear2) ){

				alert("Drop off Date must come after Pickup Date");

				DropoffYear.focus();

			} else {				

				if( parseInt(strMonth1) > parseInt(strMonth2) ){

					alert("Drop off Date must come after Pickup Date");

					DropoffMonth.focus();

				} else {

					if(parseInt(strMonth1) == parseInt(strMonth2)){

						if( parseInt(strDay1) > parseInt(strDay2) ){

							alert("Drop off Date must come after Pickup Date - Day");

							DropoffDay.focus();

						}

					}

				}

			}

		}

	}

	

	

	

	

}*/



function setMonthField(yr,mth,dy){

	var tdt = new Date();

	for (i = 0; i < mth.options.length; i++) {

		mth.options[i] = null; 

	}



	yr1 = tdt.getFullYear();

	yr2 = parseInt(yr.options[yr.selectedIndex].value);

	if(yr1 == yr2){

		mts = tdt.getMonth() + 1;

		count = 0;

		for(i = mts;i <= 12;i++){

			mth.options[count] = new Option(getMonthString2(i));

			mth.options[count].value = i;

			count = count + 1;

		}

	} else {

		for(i = 1;i <= 12;i++){

			mth.options[i - 1] = new Option(getMonthString2(i));

			mth.options[i - 1].value = i;

		}

	}

	mth.selectedIndex = 0;	

	setDay(yr,mth,dy);

	/*for (i = 0; i < dayfield.options.length; i++) {

				dayfield.options[i] = null; 

	}

	for(i = 1;i < maxday;i++){

		  		  dayfield.options[i - 1] = new Option(i+"");

				  dayfield.options[i - 1].value = i;

	}*/

}



function setDay(yearfield,monthfield,dayfield){	

	maxday = 0;

	

	if(yearfield.selectedIndex == -1){

		yearfield.selectedIndex = 0;

	}

	

	yea = parseInt(yearfield.options[yearfield.selectedIndex].value);	

	month = monthfield.options.selectedIndex + 1;

	dt = new Date();

	thismonth = dt.getMonth() + 1;

	thisday = dt.getDate();

	

	switch(month) 

         {

         case 2 :

            if (yea == Math.round(yea / 4) * 4){

				maxday = 29;

			} else {

				maxday = 28;

			}

            break;	

         case "4" :

		 	maxday = 30;

            break;

         case "6":

		 	maxday = 30;

         case "9":

            maxday = 30;

            break;

         case "11":

            maxday = 30;

            break;

         default:

            maxday = 31;

            break;

      }

	  

	  maxday = maxday + 1;

	  

	  if(parseInt(month) == thismonth){

		  start = thisday;

	  } else {

		  start = 1;

	  }

	

  	

	 for (i = 0; i < dayfield.options.length; i++) {

				dayfield.options[i] = null; 

	  }

	  count = 0;

	  for(i = start;i < maxday;i++){

		  		  dayfield.options[count] = new Option(i+"");

				  dayfield.options[count].value = i;

				  count = count + 1;

	  }

	   dayfield.options.selectIndex = 0;

}

function checkyear(){

	if(document.all.PickupYear.selectedIndex > document.all.DropoffYear.selectedIndex){

		document.all.DropoffYear.selectedIndex = document.all.PickupYear.selectedIndex;

	}

	checkmonth();

	checkdate();

}

function checkmonth(){

	if(document.all.PickupYear.selectedIndex == document.all.DropoffYear.selectedIndex){		

		if(document.all.DropoffMonth.selectedIndex <  document.all.PickupMonth.selectedIndex){

			document.all.DropoffMonth.selectedIndex =  document.all.PickupMonth.selectedIndex;

		}

		

	}

	checkdate();

}

function checkdate(){

	if(document.all.PickupYear.selectedIndex == document.all.DropoffYear.selectedIndex){

		if(document.all.PickupMonth.selectedIndex == document.all.DropoffMonth.selectedIndex){

			if(document.all.DropoffDay.selectedIndex < document.all.PickupDay.selectedIndex){

				document.all.DropoffDay.selectedIndex = document.all.PickupDay.selectedIndex;

			}

		}

	}

}





function preventBefore(){

	

}