function validate(form) {
	var form = document.bookingForm;
	
	var startDate = new Date()
    var endDate = new Date(form.booking_year.value, form.booking_month.value - 1, form.booking_day.value)
		
	// Get the arrival date details
	var arriveDate = form.booking_day.value;
	var arriveMonth = form.booking_month.value;
	var arriveYear = form.booking_year.value;
	
	// Get the number of nights
	var nights = form.nights.value;
	// Get the number of adults
	var adults = form.adults.value;
	    
    // Get the departure date details
	var departure = addDays(endDate, nights);
	var departDate = departure.getDate();
	var departMonth = departure.getMonth() + 1;
	var departYear = departure.getFullYear();
	    
    if ((startDate.getDate() == endDate.getDate()) && (startDate.getMonth() == endDate.getMonth()) && (startDate.getFullYear() == endDate.getFullYear())) {
		// do nothing
    } else {
		// Have check for date
		validDateRange(startDate, endDate, "Selected Date");
	}
	
	//var url = 'https://indecorp.ibe.netbooker.com/web/FrontController.nb4?module=PropertySearch&operation=SinglePropertySearchResult&adults=' + adults + '&children=0&numberOfRooms=1&arriveDate=' + arriveDate + '&arriveMonth=' + arriveMonth + '&arriveYear=' + arriveYear + '&departDate=' + departDate + '&departMonth=' + departMonth + '&departYear=' + departYear + '&numberOfNights=' + nights + '&execute=yes&propertyCodeType=RV&chainCode=IN&instanceId=24&rateCode=&travelAgentId=&propertyCode=DUBKH&lookAndFeelId=175&locale=en'
	
	//var url = 'https://indecorp.ibe.netbooker.com/web/FrontController.nb4?module=PropertySearch&operation=SinglePropertySearch&execute=yes&propertyCodeType=RV&chainCode=IN&instanceId=24&adults=' + adults + '&children=0&numberOfRooms=1&arriveDate=' + arriveDate + '&arriveMonth=' + arriveMonth + '&arriveYear=' + arriveYear + '&departDate=' + departDate + '&departMonth=' + departMonth + '&departYear=' + departYear + '&numberOfNights=' + nights + '&promotionCode=&rateCode=&frequentGuestId=&corporateId=&travelAgentId=&propertyCode=DUBKH&lookAndFeelId=551&locale=en'
	
	var url = 'https://indecorp.ibe.netbooker.com/web/FrontController.nb4?module=PropertySearch&operation=SinglePropertySearchResult&adults=' + adults + '&numberOfRooms=1&arriveDate=' + arriveDate + '&arriveMonth=' + arriveMonth + '&arriveYear=' + arriveYear + '&departDate=' + departDate + '&departMonth=' + departMonth + '&departYear=' + departYear + '&numberOfNights=' + nights + '&execute=yes&propertyCodeType=RV&chainCode=IN&instanceId=24&rateCode=&travelAgentId=&propertyCode=DUBKH&lookAndFeelId=551&locale=en'
	
	form.action = url

	return checkError();
}

function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}