function frmcheck(frm) {
	/*
	if (!(parseInt(frm.tappa_1_id_albergo.value)>0))
	{
		alert ("You must specify an hotel in order to continue");
		frm.tappa_1_id_albergo.focus();
		return false;
	}*/
	if (parseInt(frm.aa.value) < 2008)
	{
		alert ("Warning: the date inserted is in the past. Please verify.");
		frm.aa.focus();
		return false;
	}
	if (parseInt(frm.aa.value) == 2008)
	{
		if (parseInt(frm.mm.value) < 11)
		{
			alert ("Warning: the date inserted is in the past. Please verify.");
			frm.mm.focus();
			return false;
		}
		if (parseInt(frm.mm.value) == 11)
		{
			if (parseInt(frm.gg.value) < 26)
			{
				alert ("Warning: the date inserted is in the past. Please verify.");
				frm.gg.focus();
				return false;
			}
		}
	}

	tot_adulti_pren = 0;
	tot_camere_pren = 0;

	if (parseInt(frm.tot_adulti.value) < 1)
	{
		alert("One adult is required in order to continue");
		frm.tot_adulti.focus();
		return false;
	}
	if ((!(parseInt(frm.notti_1.value) > 0))||(!(parseInt(frm.tot_adulti.value)>0))||(!(parseInt(frm.tot_camere.value)>0)))
	{
		alert("You must specify the number of nights, of adults and of rooms in order to continue");
		frm.notti_1.focus();
		return false;
	}
	if ((parseInt(frm.tot_bambini.value)>0)&&(parseInt(frm.tot_camere.value)==1))
	{
		tutto_ok = 1;
		for (i=1; i<=parseInt(frm.tot_bambini.value); i++)
		{
			myvar = "st1bamb" + i;
			eta = parseInt(document.getElementById(myvar).value);
			if (eta < 0) tutto_ok = 0;
		}
		if (tutto_ok==0)
		{
			alert("It is necessary to specify the children's age in order to continue");
			frm.st1bamb1.focus();
			return false;
		}
	}
	tot_adulti_pren = parseInt(frm.tot_adulti.value);
	tot_camere_pren = parseInt(frm.tot_camere.value);
	tot_bambini_pren = parseInt(frm.tot_bambini.value);
	tot_occupanti_pren = tot_adulti_pren + tot_bambini_pren;
	if (tot_occupanti_pren < tot_camere_pren)
	{
		alert("It is necessary to have at least one person per room");
		frm.tot_adulti.focus();
		return false;
	}
}
function cambia_bambini(n) {
	camere = parseInt(document.frm.tot_camere.value);
	if (n>4) n=4;
	if ((n>0)&&(camere==1))
	{
		document.getElementById("bam_div").style.display = "block";
	} else {
		document.getElementById("bam_div").style.display = "none";
	}
}
function cambia_camere(n) {
	bambini = parseInt(document.frm.tot_bambini.value);
	cambia_bambini(bambini);
}
function annulla_zona() {
	document.frm.zon_tappa_1.options[0].selected = true;
}
function annulla_localita() {
	// thefrm = document.getElementById("frm");
	document.frm.loc_tappa_1.options[0].selected = true;
}
function vedi_prodotto(id)
{
	window_pmod=window.open("vedi_prodotto.htm?lingua_int=eng&id_albergo=&id_prodotto=" + id,"Albergo", "width=512,height=320,resizable=no,menubar=no,scrollbars=yes");
	window_pmod.focus()
}
function pop_calendar(theVars)
{
	theGVar = theVars + "gg";
	gg = document.getElementById(theGVar).value;
	theMVar = theVars + "mm";
	mm = document.getElementById(theMVar).value;
	theAVar = theVars + "aa";
	aa = document.getElementById(theAVar).value;	
	
	locurl = "http://www.aec-internet.it/booking_engine/calendario.htm?id_stile=266&lingua_int=eng&gg=" + gg + "&mm=" + mm + "&aa=" + aa + "&vars=" + theVars;
	window.open(locurl,"Calendario", "width=220,height=190,resizable=no,menubar=no,scrollbars=yes");

}
function annulla_alberghi() {
	//thefrm = document.getElementById("frm");
	if(document.frm.tappa_1_id_albergo) document.frm.tappa_1_id_albergo.options[0].selected = true;
}
