function CheckDate() {
	var newmonthnbday = [ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];

	var errStr1 = 'Invalid date';
	with(document.idForm) {
		var j = fromday[fromday.selectedIndex].value;
		var m = frommonth[frommonth.selectedIndex].value;
		var a = fromyear[fromyear.selectedIndex].value;
	}
	maxday = (m == 2 && a % 4 == 0 && (a % 100 != 0 || a % 400 == 0)) ? 29 : newmonthnbday[m];
	if (j > maxday) {
		alert(errStr1);	//"La date est invalide !"
		return 0;
	}

	return 1;
}
function validation(flag){
	if (flag == 1 && document.idForm.AccessCode.value == "") {
		alert('You must enter your code');	// "Please enter your code ID"
		return (false);
	}

	
	if (CheckDate() == 0)
		return false;
	if (document.idForm.nbdays.options == null) {
		var num = parseInt(document.idForm.nbdays.value);
		if (num > 0 && num < 200) {
			document.idForm.nbdays.value = num;
			//alert("New val : " + num);
		} else {
			alert("invalid number of nights");
			return (false);
		}
	}
	document.idForm.action='javascript:window.open("http://www.fastbookings.biz/DIRECTORY/dispoprice.phtml?Clusternames=UKLSydney&Hotelnames=UKLSydney&langue=&fromday=' + document.idForm.fromday.value + '&frommonth=' + document.idForm.frommonth.value + '&fromyear=' + document.idForm.fromyear.value + '&nbdays=' + document.idForm.nbdays.value + '&adulteresa=' + document.idForm.adulteresa.value + '&enfantresa=0&CurrencyLabel=GBP&redir=BIZ-so5523q0o4&showPromotions=1&nbrooms=1&showPromotions=1&rt=1163434228","bookingpopup","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes"); document.location=\'default.asp\';';
	document.idForm.submit();
	return (true);
}
function UpdateHotelnames(myForm)
{
	menuNum = myForm.HotelList.selectedIndex;
	if (menuNum == null)
		return;
	myForm.Hotelnames.value = myForm.HotelList.options[menuNum].value;
}
function cancel(){
	var CName = document.idForm.Hotelnames.value;
	var langue = document.idForm.langue.value;
	if (CName == null || CName == 'All' || CName == ''){
		alert('Please select a hotel first');	//"Please select a hotel first"
		return (false); }
	return hannul(CName, langue);
}
function allcancel(){
	var langue = document.idForm.langue.value;
	return hallannul(langue);
}
function view(){
	var CName = document.idForm.Hotelnames.value;
	var langue = document.idForm.langue.value;
	if (CName == null || CName == 'All' || CName == ''){
		alert('Please select a hotel first');	//"Please select a hotel first"
		return (false); }
	return hview(CName, langue);
}
function reload(){
	var CName = document.idForm.Hotelnames.value;
	var langue = document.idForm.langue.value;
	if (CName == null || CName == 'All' || CName == ''){
		alert('Please select a hotel first');	//"Please select a hotel first"
		return (false); }
	return hreload(CName, langue);
}
function hannul(val, lg)
{
	var waction = "cancel.phtml?state=77&Hotelnames="+val+"&langue="+lg;
	waction += "&typeresa=";
	window.open(waction, "reservation", "toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	return false;
}
function hallannul(lg)
{
	var waction = "http://www.fastbooking-hotels.com/cancel.phtml?langue="+lg;
	window.open(waction, "reservation", "toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	return false;
}
function hview(val,lg)
{
	var waction = "history.phtml?state=2&Hotelnames="+val+"&langue="+lg;
	window.open(waction, "reservation", "toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	return false;
}
function hreload(val,lg)
{
	var waction = "reload.phtml?state=2&Hotelnames="+val+"&langue="+lg;
	window.open(waction, "reservation", "toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	return false;
}