BrowserOK =  (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || 
  ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )));

function makeon(){
 event.srcElement.style.filter = "gray";
 }
 
function makeout(){
 event.srcElement.style.filter = "";
 } 
 
function gowindow1(str, titolo,w,h) {
 openwin = window.open(str,titolo,'width='+ w +',height='+ h +',status=no,scrollbars=yes,resizable=no,location=no,toolbar=no');
 }

function gowindow(str, titolo,w,h) {
 openwin = window.open(str,titolo,'width='+ w +',height='+ h +',status=no,scrollbars=no,resizable=no,location=no,toolbar=no');
 }
/*----------------------------- */
function setDate()
{
	var gg = document.getElementById("id_gg");	
	var mm = document.getElementById("id_mm");	
	var aa = document.getElementById("id_aa");	
	var oggi = new Date();
	
	if(gg && mm && aa)
	{
		gg.options[(oggi.getDate()-1)].selected = true;
		mm.options[(oggi.getMonth())].selected = true;
		for(i=0; i<10; i++)
		{
			if(aa.options[i])
			{
				if(aa.options[i].value == oggi.getFullYear()) aa.options[i].selected = true;
			}
		}
	}	
}
 
function frmcheck()
{
	frm = document.getElementById("myform");
	if (!(frm)) return false;
	
	var oggi = new Date();
 
	if (parseInt(frm.aa.value) < oggi.getFullYear())
	{
		alert ("Achtung: Das eingegebene Datum ist ungültig. Bitte versuchen Sie es erneut.");
		frm.aa.focus();
		return false;
	}
	if (parseInt(frm.aa.value) == oggi.getFullYear())
	{
		if (parseInt(frm.mm.value) < (parseInt(oggi.getMonth())+1))
		{
			alert ("Achtung: Das eingegebene Datum ist ungültig. Bitte versuchen Sie es erneut.");
			frm.mm.focus();
			return false;
		}
		if (parseInt(frm.mm.value) == (parseInt(oggi.getMonth())+1))
		{
			if (parseInt(frm.gg.value) < parseInt(oggi.getDate()))
			{
				alert ("Achtung: Das eingegebene Datum ist ungültig. Bitte versuchen Sie es erneut.");
				frm.gg.focus();
				return false;
			}
		}
	}
	tot_adulti_pren = 0;
	tot_camere_pren = 0;
 
	if (parseInt(frm.tot_adulti.value) < 1)
	{
		alert("Ein Erwachsene ist notwendig, um weiterzugehen");
		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("Um weiterzugehen, bitte geben Sie die Nummer von Erwachsenen, Kindern und Zimmern an.");
		frm.notti_1.focus();
		return false;
	}
	tot_adulti_pren = parseInt(frm.tot_adulti.value);
	tot_camere_pren = parseInt(frm.tot_camere.value);
	tot_bambini_pren = 0;
	if(frm.tot_bambini) tot_bambini_pren = parseInt(frm.tot_bambini.value);
	
	tot_occupanti_pren = tot_adulti_pren + tot_bambini_pren;
	str = "occ = " + tot_occupanti_pren + " cam = " + tot_camere_pren;
	// alert(str);
	if (tot_occupanti_pren < tot_camere_pren)
	{
		alert("Wenigstens eine Person pro Zimmer notwendig");
		frm.tot_adulti.focus();
		return false;
	}
	frm.submit();
}
