function validate_form(thisform, alertTextDate, alertTextRooms, alertDateInPast, nextValidDay){
	with (thisform){
		//Abreise von Bis Validierung
		var splittext = nextValidDay.split("-");
		var minDay = new Date(splittext[0],splittext[1]-1,splittext[2]);
		
		var tDate = new Date();

		var from_date_text = from_month_year.value + "-" + from_day.value;
		var splittext = from_date_text.split("-");
		var DateFrom = new Date(splittext[0],splittext[1]-1,splittext[2]);
		var to_date_text = to_month_year.value + "-" + to_day.value;
		splittext = to_date_text.split("-");
		var DateTo = new Date(splittext[0],splittext[1]-1,splittext[2]);
		var submitForm = true;
  	if ((DateFrom < minDay) || (DateTo < minDay) ){
			MM_setTextOfLayer('home_left_content_error','',alertDateInPast);
			MM_setTextOfLayer('booking_bottom_left','',alertDateInPast);
			submitForm = false;
		}
		else {
			submitForm = submitForm && true;
			if (submitForm){
				MM_setTextOfLayer('home_left_content_error','','');
				MM_setTextOfLayer('booking_bottom_left','','');
			}
		}
		if (DateFrom >= DateTo){
			MM_setTextOfLayer('home_left_content_error','',alertTextDate);
			MM_setTextOfLayer('booking_bottom_left','',alertTextDate);
			submitForm = false;
		}
		else {
			if (submitForm){
				MM_setTextOfLayer('home_left_content_error','','');
				MM_setTextOfLayer('booking_bottom_left','','');
				submitForm = submitForm && true;
			}
		}
		try{
			if (parseInt(from_rooms.value) > parseInt(to_rooms.value)){
				MM_setTextOfLayer('home_left_content_error','',alertTextRooms);
				submitForm = false;
			}
			else {
				submitForm = submitForm && true;
				if (submitForm){
					MM_setTextOfLayer('home_left_content_error','','');
				}
			}
		}
		catch (e){
			//Nichts zu tun
			return submitForm;
		}
		return submitForm;
	}
}

function validate_persons(thisform, maxpersons, alertText){
		with (thisform){
			if (parseInt(persons.value) > parseInt(maxpersons)){
				MM_setTextOfLayer('personcounterror','',alertText);
				return false;
			}
			else {
				MM_setTextOfLayer('personcounterror','','');
				return true;
			}
		}
}

