	if (navigator.userAgent.indexOf("Mozilla") != -1)
		nav3plus = parseInt(navigator.appVersion.substring(0,1)) >= 3;
	if (nav3plus)
	{
		item1 = new Image(324,48);
		item1.src = "images/info.jpg";
		item1h = new Image(324,48);
		item1h.src = "images/info_a.jpg";
		item2 = new Image(212,49);
		item2.src = "images/next.jpg";
		item2h = new Image(212,49);
		item2h.src = "images/next_a.jpg";
	}
	
	function hilight(imgID,imgNew)
	{
		if (nav3plus) 
			document.images[imgID].src = eval(imgNew + ".src");
	}

var newWin;
function apri(file, width, height) {	
	if (newWin)
	{
		newWin.close();
		newWin = null;
	}
	newWin = window.open("",
						"foto",
						"scrollbars=yes,resizable=no,alwaysRaised=yes,scrollbars=no,dependent=yes,status=no,location=no,toolbar=no, width="+width+", height="+height);
	newWin.document.write("<html><head><title>Il Casale del Lago \"Podere Nuovo\"</title></head>");
	newWin.document.write("<link href=\"styles.css\" type=text/css rel=styleSheet>");
	newWin.document.write("<body id=body2>");
	newWin.document.write("<center><img src="+file+" border=0><br>");
	newWin.document.write("<a href=\"javascript:window.close();\"><b>[close]</b></a></center>");
	newWin.document.write("</body></html>");	
} 

	var win = null;
	function newWindow(mypage, myname, w, h, features) {
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
		if (winl < 0) winl = 0;
		if (wint < 0) wint = 0;
		var settings = 'height=' + h + ',';
		settings += 'width=' + w + ',';
		settings += 'top=' + wint + ',';
		settings += 'left=' + winl + ',';
		settings += features;
		win = window.open(mypage,myname,settings);
		win.window.focus();
}



function ControllaForm()
	{
		var controllo=false;
		
	
var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

	
    if (document.frmdata.Nome.value == "" ) 
			{
				controllo=true;
				alert("ATTENTION! Name field is empty\n");
			}
	if (document.frmdata.Cognome.value == "" ) 
			{
				controllo=true;
				alert("ATTENTION! Surname field is empty\n");
			}
	
	
			
	if (!email_reg_exp.test(frmdata.Email.value) || (frmdata.Email.value=="") || (frmdata.Email.value== "undefined")) {
          	controllo=true;	
		alert("Email is not correct");
         }

	if (document.frmdata.Notti.value == "" ) 
			{
				controllo=true;
				alert("ATTENTION! Nights field is required\n");
			}
	if (document.frmdata.Adulti.value == "" ) 
			{
				controllo=true;
				alert("ATTENTION! Adults field is required\n");
			}
	if (document.frmdata.sistemazioni.value == 0 ) 
			{
				controllo=true;
				alert("ATTENTION! You must choose accomodation\n");
			}
	
	if (controllo){return false}else{return true}
	        }
			
			
			
			
			
			
			
			
			
			
			
			
			
			
function ControllaForm_ita()
	{
		var controllo=false;
		
	
var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

	
    if (document.frmdata.Nome.value == "" ) 
			{
				controllo=true;
				alert("ATTENZIONE! Campo nome vuoto\n");
			}
	if (document.frmdata.Cognome.value == "" ) 
			{
				controllo=true;
				alert("ATTENZIONE! Campo cognome vuoto\n");
			}
	
	
			
	if (!email_reg_exp.test(frmdata.Email.value) || (frmdata.Email.value=="") || (frmdata.Email.value== "undefined")) {
          	controllo=true;	
		alert("Email non corretta");
         }

	if (document.frmdata.Notti.value == "" ) 
			{
				controllo=true;
				alert("ATTENZIONE! Campo notti obbligatorio\n");
			}
	if (document.frmdata.Adulti.value == "" ) 
			{
				controllo=true;
				alert("ATTENZIONE! Campo Adulti obbligatorio\n");
			}
	if (document.frmdata.sistemazioni.value == 0 ) 
			{
				controllo=true;
				alert("ATTENZIONE! Scegli un'accomodazione\n");
			}
	
	if (controllo){return false}else{return true}
	        }
			
			
			
function popup(url, width, height)
{
settings="toolbar=no,location=no,directories=no,"+"status=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}
