function changeDates() {
		if (document.forms){
			f = document.forms.hotelres;
			sDay = f.DD1.value;
			sMY = f.MM1.value;
			sArr = sMY.split("/");
			sMonth = sArr[0] -1;
			sYear = sArr[1];
			
			oDate = new Date();
			oDate.setDate(sDay)
			oDate.setMonth(sMonth);
			oDate.setFullYear(sYear);
			
			var daysinmonth =  parseInt(getDaysInMonth(oDate));
			var optlength		= parseInt(f.DD1.options.length - 1);
			if (daysinmonth < optlength) {
				for(i=optlength;i>daysinmonth; i--) {
					f.DD1.options[i] = null;
					f.checkoutday.options[i] = null
				}
			}	else if (daysinmonth > optlength) {
				for(i=optlength+1;i<=daysinmonth; i++) {
					var opt1 = new Option(i, i);
					var opt2 = new Option(i, i);
					f.DD1.options[f.DD1.options.length] = opt1;
					f.checkoutday.options[f.checkoutday.options.length] = opt2;
				}
			}
			f.DD1.value = oDate.getDate();
			oDay = oDate.getDate();
			oDay += 1;
			oDate.setDate(oDay);
			nDay = oDate.getDate();
			nMonth = oDate.getMonth() + 1;
			nYear = oDate.getFullYear();
			nMY = nMonth + '/' + nYear;
			f.checkoutday.value = nDay;
			f.DD1MIDU.value = nMY;
		}
	}
	
	function getDaysInMonth(aDate){
   // returns the last day of a given month
    var m = new Number(aDate.getMonth());
    var y = new Number(aDate.getYear());

    var tmpDate = new Date(y, m, 28);
    var checkMonth = tmpDate.getMonth();
    var lastDay = 27;

    while(lastDay <= 31){
        temp = tmpDate.setDate(lastDay + 1);
        if(checkMonth != tmpDate.getMonth())
            break;
        lastDay++
    }
    return lastDay;
}

	function resetDaySelect(oVar) {
		
	}
