function CheckDate() {
	if (navigator.appName == "Netscape")
		return 1;	// error with a2=d2.getYear()
	var errStr1 = 'Invalid date';
	var errStr2 = errStr1;
	with(document.idForm) {
		var j = fromday[fromday.selectedIndex].value;
		var m = frommonth[frommonth.selectedIndex].value;
		var a = fromyear[fromyear.selectedIndex].value;
	}
	var d2=new Date(a,m-1,j);
	j2=d2.getDate();
	m2=d2.getMonth()+1;
	a2=d2.getYear();
	if ( (j!=j2)||(m!=m2)||(a!=a2) ) {
		alert(errStr1);	//"La date est invalide !"
		return 0;
	}

	var today=new Date;
	j1=today.getDate();
	m1=today.getMonth()+1;
	a1=today.getYear();
	var d1 = new Date(a1,m1-1,j1);
	//alert("Dates : " + d1 + " : " + d2);
	if ( d2 < d1 ) {
		alert(errStr2);	//"La date est passee !"
		return 0;
	}
	return 1;
}


function validation(flag){
	if (flag == 1 && document.idForm.AccessCode.value == "") {
		alert("You must type 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);
		}
	}
		window.open('','dispoprice', 'toolbar=no,width=700,height=600,menubar=no,scrollbars=yes,resizable=yes');
		document.idForm.submit();
	return (true);
}


