// JavaScript Document
function jumpCollezione(id){
	if(id!="")
		document.gotocollezione.submit();
}

function jumpMerchandising(id){
	if(id!="")
		document.gotocollezione.submit();
}

function showCatalogo(collezione){
	nomeForm=document.navigator;
	nomeForm.idCollezione.value=collezione;
	nomeForm.submit();
}

function zoomCersaie(idCat, idItem){
	var w=596;
	var h=440;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomCersaie.php?idCat="+idCat+"&idItem="+idItem, "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 zoomCersaieV(idCat, idItem){
	var w=400;
	var h=543;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomCersaie.php?idCat="+idCat+"&idItem="+idItem, "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 zoomEventi(idCat, idItem){
	var w=596;
	var h=486;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomEventi.php?idCat="+idCat+"&idItem="+idItem, "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 zoomEventiV(idCat, idItem){
	var w=400;
	var h=575;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomEventi.php?idCat="+idCat+"&idItem="+idItem, "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 zoomPremium(idCat, idItem){
	var w=600;
	var h=490;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomPremium.php?idCat="+idCat+"&idItem="+idItem, "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 zoomPremiumV(idCat, idItem){
	var w=400;
	var h=650;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomPremium.php?idCat="+idCat+"&idItem="+idItem, "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 zoomPremiumV1(idCat, idItem){
	var w=400;
	var h=580;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomPremium.php?idCat="+idCat+"&idItem="+idItem, "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 apriTour(nomeTour){
	width = screen.width;
	height = screen.height;
	posX = (width - 780)/2;
	posY = (height - 545)/2;
	window.open(nomeTour, "cersaie", "width=780, height=545, toolbars=0, status=0, directories=0, menubar=0, scrollbars=0, resizable=0, left=" + posX + ", top=" + posY);
}

function zoom(id){
	var w=600;
	var h=430;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomImmagine.php?id="+id, "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 zoomPress(id){
	var w=600;
	var h=450;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomPress.php?id="+id, "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 zoomStand(id, w, h){
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomStand.php?id="+id, "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();
}

var finestraOpen = false;
function zoomCasaIdea(id, w, h){
	if (finestraOpen){
		finestraZoom.close();
	}
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomCasa.php?id="+id, "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();
	finestraOpen = true;
}

function showZoom(idColl, idProd){
	var w=320;
	var h=510;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomProdotto.php?cod="+idProd+"&coll="+idColl, "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 zoomEventiDinamic(image, w, h){
	var h = h +30;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomDinamic.php?image="+image+"_zoom.jpg", "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 zoomEventiNew(image, w, h){
	if (finestraOpen){
		finestraZoom.close();
	}
	var h = h +30;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomDinamic.php?image="+image+".jpg", "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();
	finestraOpen = true;
}

function apriVideo(idVideo){
	var w=400;
	var h=350;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("zoomVideo.php?cod="+idVideo, "video", "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 apriVideo2(){
	var w=490;
	var h=330;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("video/zoomVideo.php", "video", "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 apriVideoLoch(){
	var w=630;
	var h=420;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("video/zoomLochness.php", "video", "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 apriFiniture(){
	var w=430;
	var h=350;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("finiture.php", "finiture", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function apriNoteTecnicheFucina(){
	var w=430;
	var h=350;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("notetecniche_fucina.php", "fucina", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function apriNoteTecnicheLignite(){
	var w=430;
	var h=350;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("notetecniche_lignite.php", "ignite", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function apriCombinazioniJoe(){
	var w=740;
	var h=400;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("combinazioni_joe.php", "ignite", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function apriNoteTecnicheLustro(){
	var w=430;
	var h=180;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("notetecniche_lustro.php", "ignite", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function apriMinera(){
	var w=520;
	var h=320;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("notetecniche_minera.php", "minera", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function showMinimale(idminimale){
	var posX=100;
	var posY=100;
	finestraZoom=window.open("zoomMinimale.php?cod="+idminimale, "minimale", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes, width=2, height=2, left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function showAmbienti(idProd){
	var w=600;
	var h=480;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraAmbiente=window.open("showAmbienti.php?cod="+idProd, "ambiente", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbar=no, resizable=no, copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraAmbiente.focus();
}

function showMerchandising(idProd){
	var w=620;
	var h=480;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraMerchandising=window.open("zoomMerchandising.php?cod="+idProd, "merchand", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbar=no, resizable=no, copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraMerchandising.focus();
}

function openCredits(){
	var w=350;
	var h=150;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("credits.html", "credits", "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 openDisclaimer(){
	var w=400;
	var h=300;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("disclaimer.php", "disclaimer", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}

function openPrivacy(){
	var w=400;
	var h=300;
	var posX=( screen.width - w) /2;
	var posY=( screen.height - h) /2;
	finestraZoom=window.open("privacy.php", "privacy", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes, width=" + w + ", height=" + h + ", left=" + posX + ", top=" + posY);
	finestraZoom.focus();
}


function ritorna(){
	document.navigator.submit();
}

var indirizzoEmail;
function checkEmailAddress(field) {

     var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.biz)|(\..{2,2}))$)\b/gi);
     
     if (goodEmail){
        indirizzoEmail = true
     } 
     else {
        alert('Inserire un indirizzo email valido');
        field.focus();
        field.select();
        indirizzoEmail = false;
        }
  	return indirizzoEmail;
}


function controlForm(idLingua){
	thisForm=document.contatti;
	
	if(thisForm.nome.value=='') {
		alert("Inserire un nome");
		thisForm.nome.focus();
		return;
	}
	if(thisForm.cognome.value=='') {
		alert("Inserire un cognome");
		thisForm.cognome.focus();
		return;
	}
	if(!checkEmailAddress(thisForm.email)) return;
	
	if(thisForm.accetto.checked==false){
		alert("Accettare le condizioni della privacy");
		thisForm.accetto.focus();
		return;
	}
	
	if(thisForm.nazione.value!='380'){
		thisForm.provincia.selectedIndex='0';
	}
	
	thisForm.action='_class/classAzioni.php';
	thisForm.method="POST";
	thisForm.submit();
}

function controlIscrizione(){
	thisForm=document.iscrizione_newsletter;
	
	if(!checkEmailAddress(thisForm.email_iscriz)) return;
	
	/*if(thisForm.accetto.checked==false){
		alert("Accettare le condizioni della privacy");
		thisForm.accetto.focus();
		return;
	}*/
	
	thisForm.azione.value="iscrizione_newsletter";	
	thisForm.action='_class/classAzioni.php';
	thisForm.method="POST";
	thisForm.submit();
}

function controlFormPress(idLingua){
	thisForm=document.contatti;
	
	if(thisForm.nome.value=='') {
		alert("Inserire un nome");
		thisForm.nome.focus();
		return;
	}
	if(thisForm.cognome.value=='') {
		alert("Inserire un cognome");
		thisForm.cognome.focus();
		return;
	}
	if(!checkEmailAddress(thisForm.email)) return;
	
	if(thisForm.accetto.checked==false){
		alert("Accettare le condizioni della privacy");
		thisForm.accetto.focus();
		return;
	}
	
	if(thisForm.nazione.value!='380'){
		thisForm.provincia.selectedIndex='0';
	}
	
	thisForm.action='_class/classAzioni.php';
	thisForm.method="POST";
	thisForm.submit();
}

function controlFormLogin(idLingua){
	thisForm=document.presslogin;
	
	if(!checkEmailAddress(thisForm.email)) return;
	
	if(thisForm.password.value=='') {
		alert("Inserire la password");
		thisForm.password.focus();
		return;
	}
	
	thisForm.action='_class/classAzioni.php';
	thisForm.method="POST";
	thisForm.submit();
}