<!--
    if (document.images)
    {
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "images/testata_pul.jpg";
      image_url[1] = "images/testata_pul_sel.jpg";
      image_url[2] = "images/testata_btn.jpg";
      image_url[3] = "images/testata_btn_sel.jpg";

       var i = 0;
       for(i=0; i<=3; i++) 
         preload_image_object.src = image_url[i];
    }

    //-->
function swapImage(idname, image){
	if(idname != menuselect){
		document[idname].src = "images/testata_pul" + image + ".jpg";
		newImage = "url(images/testata_btn" + image + ".jpg)";
	
		if (document.getElementById){
			document.getElementById(idname + "_tab").style.backgroundImage = newImage;
		}
		else if (document.all){
			document.all(idname + "_tab").style.backgroundImage = newImage;
		}
		else if (document.layers){
			document.layers(idname + "_tab").style.backgroundImage = newImage;
		}
	}
}

function confirmSwap(idname){
	if(menuselect==idname){
		newImage = "url(images/testata_btn.jpg)";
		if (document.getElementById){
			document.getElementById(menuselect + "_tab").style.backgroundImage = newImage;
		}
		else if (document.all){
			document.all(menuselect + "_tab").style.backgroundImage = newImage;
		}
		else if (document.layers){
			document.layers(menuselect + "_tab").style.backgroundImage = newImage;
		}
		document[idname].src = "images/testata_pul.jpg";
		document.getElementById(menuselect + "_sub").style.display = "none";
		menuselect = '';
	}
	else{
		if(menuselect!=""){
			document[menuselect].src = "images/testata_pul.jpg";
			newImage = "url(images/testata_btn.jpg)";
			if (document.getElementById){
				document.getElementById(menuselect + "_tab").style.backgroundImage = newImage;
			}
			else if (document.all){
				document.all(menuselect + "_tab").style.backgroundImage = newImage;
			}
			else if (document.layers){
				document.layers(menuselect + "_tab").style.backgroundImage = newImage;
			}
			document.getElementById(menuselect + "_sub").style.display = "none";
		}
		
		if (document.getElementById){
			var obj = document.getElementById(idname + "_tab");
		}
		else if (document.all){
			var obj = document.all(idname + "_tab");
		}
		else if (document.layers){
			var obj = document.layers(idname + "_tab");
		}
		
		var curleft = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft;
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft;
			}
		}

		document[idname].src = "images/testata_pul_sel.jpg";
		newImage = "url(images/testata_btn_sel.jpg)";
	
		if (document.getElementById){
			document.getElementById(idname + "_tab").style.backgroundImage = newImage;
		}
		else if (document.all){
			document.all(idname + "_tab").style.backgroundImage = newImage;
		}
		else if (document.layers){
			document.layers(idname + "_tab").style.backgroundImage = newImage;
		}
		
		
		if(curleft>600) curleft = curleft - 400;

		var agt = navigator.userAgent.toLowerCase();
		var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
		
		if(!is_nav)
			document.getElementById(idname + "_sub").style.paddingLeft = curleft + ' px';
		else
			document.getElementById(idname + "_sub").style.paddingLeft = curleft ;
			
		document.getElementById(idname + "_sub").style.display = "block";
		menuselect = idname;	
	}
}

function openSubmenu(){
	if (document.getElementById){
		var obj = document.getElementById(menuselect + "_tab");
	}
	else if (document.all){
		var obj = document.all(menuselect + "_tab");
	}
	else if (document.layers){
		var obj = document.layers(menuselect + "_tab");
	}
	
	var curleft = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
		}
	}

	document[menuselect].src = "images/testata_pul_sel.jpg";
	newImage = "url(images/testata_btn_sel.jpg)";

	if (document.getElementById){
		document.getElementById(menuselect + "_tab").style.backgroundImage = newImage;
	}
	else if (document.all){
		document.all(menuselect + "_tab").style.backgroundImage = newImage;
	}
	else if (document.layers){
		document.layers(menuselect + "_tab").style.backgroundImage = newImage;
	}
	
	
	if(curleft>600) curleft = curleft - 400;

	var agt = navigator.userAgent.toLowerCase();
	var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
               && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
               && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	
	if(!is_nav)
		document.getElementById(menuselect + "_sub").style.paddingLeft = curleft + ' px';
	else
		document.getElementById(menuselect + "_sub").style.paddingLeft = curleft ;
		
	document.getElementById(menuselect + "_sub").style.display = "block";
}

function loadSwf(swf, w, h, sfondo){
	document.write("<object");
	document.write("width=\""+w+"\" height=\""+h+"\"");
	document.write("codebase=\"http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,0,0\">");
	document.write("<param name=\"movie\" value=\""+swf+"\" />");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"allowFullScreen\" value=\"true\" />");
	document.write("<param name=\"bgcolor\" value=\""+sfondo+"\" />");
	document.write("<embed src=\""+swf+"\""); 
	document.write("width=\""+w+"\" height=\""+h+"\" align=\"middle\"");
	document.write("play=\"true\"");
	document.write("loop=\"true\"");
	document.write("quality=\"high\"");
	document.write("bgcolor=\""+sfondo+"\"");
	document.write("allowScriptAccess=\"sameDomain\"");
	document.write("allowFullScreen=\"true\"");
	document.write("type=\"application/x-shockwave-flash\"");
	document.write("pluginspage=\"http://www.adobe.com/go/getflashplayer\">");
	document.write("</embed>");
	document.write("</object>");
}

function loadswftour(swf, ivp, w, h){
	document.write("<object");
	document.write("width=\""+w+"\" height=\""+h+"\"");
	document.write("codebase=\"http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,0,0\">");
	document.write("<param name=\"movie\" value=\""+swf+"\" />");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"allowFullScreen\" value=\"true\" />");
	document.write("<param name='flashvars' value='panorama="+ivp+"' />");
	document.write("<embed src=\""+swf+"\""); 
	document.write("width=\""+w+"\" height=\""+h+"\" align=\"middle\"");
	document.write("play=\"true\"");
	document.write("loop=\"false\"");
	document.write("quality=\"high\"");
	document.write("allowScriptAccess=\"sameDomain\"");
	document.write("allowFullScreen=\"true\"");
	document.write("flashvars=\"panorama="+ivp+"\"");
	document.write("type=\"application/x-shockwave-flash\"");
	document.write("pluginspage=\"http://www.adobe.com/go/getflashplayer\">");
	document.write("</embed>");
	document.write("</object>");
}


function cambiaImmagine(nomeFoto){
	document.punto_zoom.src = "images/" + nomeFoto;
}

function apri(pag) {
  win = window.open(pag,'win','toolbar=0, menubar=0, scrollbar=0, resizable=0, width=640, height=342, left=10, top=10');
  win.focus();
}

function zoom(nome, w, h){
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoom.php?nome="+nome, "zoom", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function loadVideo(flv, w, h){
	var dispH=h-20;
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
	document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8\"");
	document.write("width=\""+w+"\" height=\""+h+"\"");
	document.write("id=\"video\">");
	document.write("<param name=movie value=\"mediaplayer.swf\">");
	document.write("<param name=quality value=\"high\">");
	document.write("<param name=bgcolor value=\"#FFFFFF\">");
	document.write("<param name=allowFullScreen value=\"true\">");
	document.write("<param name=swLiveConnect value=\"true\">");
	document.write("<param name=allowScriptAccess value=\"sameDomain\">");
	document.write("<param name=\"FlashVars\" value=\"file="+flv+"&width="+w+"&height="+h+"&displaywidth="+w+"&displayheight="+dispH+"&overstretch=true&shuffle=false&backcolor=0xFFFFFF\">");

	document.write("<embed type=\"application/x-shockwave-flash\""); 
	document.write("pluginspage=\"http://www.macromedia.com/go/getflashplayer\""); 
	document.write("width=\""+w+"\" height=\""+h+"\" bgcolor=\"#FFFFFF\""); 
	document.write("name=\"video\"");
	document.write("src=\"mediaplayer.swf\"");
	document.write("flashvars=\""+flv+"&width="+w+"&height="+h+"&displaywidth="+w+"&displayheight="+dispH+"&overstretch=true&shuffle=false&backcolor=0xFFFFFF\">");
	document.write("</embed>");
	document.write("</object>");
}

function controlloForm(){
	thisForm=document.invia;

	if(thisForm.tipo[2].checked == true){
		if(thisForm.tipo_altro.value==''){
			alert("Specificare la tipologia");
			thisForm.tipo_altro.focus();
			return;
		}
	}
	if(thisForm.referente.value==''){
		alert("Inserire il referente");
		thisForm.referente.focus();
		return;
	}
	if(thisForm.localita.value==''){
		alert("Inserire la località");
		thisForm.localita.focus();
		return;
	}
	if(thisForm.telefono.value==''){
		alert("inserire il telefono");
		thisForm.telefono.focus();
		return;
	}
	if(thisForm.fax.value==''){
		alert("inserire il fax");
		thisForm.fax.focus();
		return;
	}
	if(thisForm.g_arrivo.value==''){
		alert("inserire il giorno di arrivo");
		thisForm.g_arrivo.focus();
		return;
	}
	thisForm.submit();
}

function controlloFormP(){
	thisForm=document.prenotazioni;
	
	if(thisForm.nome.value==''){
		alert("Inserire il Nome");
		thisForm.nome.focus();
		return;
	}
	if(thisForm.cognome.value==''){
		alert("Inserire il Cognome");
		thisForm.cognome.focus();
		return;
	}
	if(thisForm.email.value==''){
		alert("inserire l'email");
		thisForm.email.focus();
		return;
	}
	if(thisForm.n_visitatori.value==''){
		alert("inserire il numero di visitatori");
		thisForm.n_visitatori.focus();
		return;
	}
	if(thisForm.data_gg.value=='gg'){
		alert("Inserire il giorno");
		thisForm.data_gg.focus();
		return;
	}
	if(thisForm.data_mm.value=='mm'){
		alert("Inserire il mese");
		thisForm.data_mm.focus();
		return;
	}
	if(thisForm.data_aa.value=='aa'){
		alert("Inserire l'anno");
		thisForm.data_aa.focus();
		return;
	}
	if(thisForm.ora_hh.value=='hh'){
		alert("Inserire l'ora");
		thisForm.ora_hh.focus();
		return;
	}
	if(thisForm.ora_mm.value=='mm'){
		alert("Inserire i minuti");
		thisForm.ora_mm.focus();
		return;
	}
	if(thisForm.privacy.checked == false){
		alert("Bisogna accettare le condizioni sulla privacy per proseguire");
		thisForm.privacy.focus();
		return;
	}
	thisForm.submit();
}

function controlloFormParere(){
	thisForm=document.parere;
	
	if(thisForm.nome.value==''){
		alert("Inserire il Nome");
		thisForm.nome.focus();
		return;
	}
	if(thisForm.cognome.value==''){
		alert("Inserire il Cognome");
		thisForm.cognome.focus();
		return;
	}
	if(thisForm.email.value==''){
		alert("inserire l'email");
		thisForm.email.focus();
		return;
	}
	
	if(thisForm.privacy.checked == false){
		alert("Bisogna accettare le condizioni sulla privacy per proseguire");
		thisForm.privacy.focus();
		return;
	}
	thisForm.submit();
}

function controlloFormLogin(){
	thisForm=document.login;
	
	if(thisForm.username.value==''){
		alert("Inserire la username");
		thisForm.username.focus();
		return;
	}
	if(thisForm.password.value==''){
		alert("Inserire la password");
		thisForm.password.focus();
		return;
	}
	
	thisForm.submit();
}

function startSearching(){
	thisForm=document.form_ricerca;
	
	if(thisForm.word.value==''){
		alert("Inserire un termine da ricercare");
		thisForm.word.focus();
		return;
	}
	
	thisForm.submit();
}