	function checkform(form){
		var start_date = new Date(form.arrival_year.value,form.arrival_month.value,form.arrival_day.value);
		var end_date = new Date(form.departure_year.value,form.departure_month.value,form.departure_day.value);
		var threedays = new Date();
		threedays.setSeconds(0);
		threedays.setMinutes(0);
		threedays.setHours(0);
		threedays.setDate(threedays.getDate()+1);
		threedays.setMonth(threedays.getMonth());
		threedays.setFullYear(threedays.getFullYear());
		var diff = Math.floor((threedays - start_date)/1000);
		if (diff > 0) {
			alert( "Please select an arrival date in the present or future." );
			form.arrival_day.focus();
			return false;
		}
		var diff2 = Math.floor((end_date - start_date)/1000);
		if (diff2 < 86400) {
			alert( "Please select a departure date that is at least 1 day ahead of arrival." );
			form.departure_day.focus();
			return false;	
		}
		var aday = form.arrival_day.value;
		var amo = (form.arrival_month.value-1);
		if(amo < 10){ amo = '0' + amo;}
		var aMonthYear = form.arrival_year.value+''+amo;
		var adate = form.arrival_month.value+'/'+form.arrival_day.value+'/'+form.arrival_year.value;
		var dday = form.departure_day.value;
		var dmo = (form.departure_month.value-1);
		if(dmo < 10){ dmo = '0' + dmo;}
		var dMonthYear = form.departure_year.value+''+dmo;
		var ddate = form.departure_month.value+'/'+form.departure_day.value+'/'+form.departure_year.value;
		//url = 'http://book.bestwestern.com/bestwestern/selectRoomOptions.do?propertyCode=05540&disablenav=true&suppressSSLPopup=true&arrDate='+adate+'&depDate='+ddate+'&numAdults='+form.numAdults1.value+'&numChildren='+form.numChildren1.value+'&numRooms='+form.numRooms.value+'&selectRateCode='+form.ratePlan.value+'&corporateId='+form.corpid.value+'&iata='+form.iata.value+'&promoCode='+form.promoCode.value;
		//alert(url);
		url = 'http://book.bestwestern.com/bestwestern/priceAvail.do?propertyCode=05691&disablenav=true&suppressSSLPopup=true&arrivalDay='+aday+'&arrivalMonthYear='+aMonthYear+'&departureDay='+dday+'&departureMonthYear='+dMonthYear+'&ratePlan='+form.ratePlan.value+'&corpid='+form.corpid.value+'&iata='+form.iata.value+'&promoCode='+form.promoCode.value;
		window.location = url;
		return false;
	}	