var XMLHTTP;function Richiesta(Stringa){if (Stringa.length > 0){var url = "inc/check_users.asp?stringa=" + Stringa;XMLHTTP = RicavaBrowser(CambioStato);XMLHTTP.open("GET", url, true);XMLHTTP.send(null);}else{document.getElementById("risultati").innerHTML = "";} }function CambioStato(){if (XMLHTTP.readyState == 4){var R = document.getElementById("risultati");R.innerHTML = XMLHTTP.responseText;}}function RicavaBrowser(QualeBrowser){if (navigator.userAgent.indexOf("MSIE") != (-1)){var Classe = "Msxml2.XMLHTTP";if (navigator.appVersion.indexOf("MSIE 5.5") != (-1));{Classe = "Microsoft.XMLHTTP";} try{OggettoXMLHTTP = new ActiveXObject(Classe);OggettoXMLHTTP.onreadystatechange = QualeBrowser;return OggettoXMLHTTP;}catch(e){alert("Errore: l'ActiveX non verrą eseguito!");}}else if (navigator.userAgent.indexOf("Mozilla") != (-1)){OggettoXMLHTTP = new XMLHttpRequest();OggettoXMLHTTP.onload = QualeBrowser;OggettoXMLHTTP.onerror = QualeBrowser;return OggettoXMLHTTP;}else{alert("Ajax non supportato da questo browser!");}}

var delay = 3000;var start_frame = 0;function init() {var lis = $('slide-images').getElementsByTagName('li');for( i=0; i < lis.length; i++){if(i!=0){lis[i].style.display = 'none';}}end_frame = lis.length -1;start_slideshow(start_frame, end_frame, delay, lis);}function start_slideshow(start_frame, end_frame, delay, lis) {setTimeout(fadeInOut(start_frame,start_frame,end_frame, delay, lis), delay);}function fadeInOut(frame, start_frame, end_frame, delay, lis) {return (function() {lis = $('slide-images').getElementsByTagName('li');Effect.Fade(lis[frame]);if (frame == end_frame) { frame = start_frame; } else { frame++; }lisAppear = lis[frame];setTimeout("Effect.Appear(lisAppear);", 0);setTimeout(fadeInOut(frame, start_frame, end_frame, delay), delay + 1850);})}Event.observe(window, 'load', init, false);

var FocusOn;

var PreSimpleSwapOnload=(window.onload)?window.onload:function(){};window.onload=function(){PreSimpleSwapOnload();SimpleSwapSetup();}
function MMenuBlinder(FocusOn){if(FocusOn!='gnb_submenu1'){new Effect.Fade('gnb_submenu1',{duration:0.2});}
if(FocusOn!='gnb_submenu2'){new Effect.Fade('gnb_submenu2',{duration:0.2});}
if(FocusOn!='gnb_submenu5'){new Effect.Fade('gnb_submenu5',{duration:0.2});}
if(FocusOn!='gnb_submenu6'){new Effect.Fade('gnb_submenu6',{duration:0.2});}
if(FocusOn!=''){
new Effect.Appear(FocusOn,{duration:0.4});
}
}
function SimpleSwap(el,which){el.src=el.getAttribute(which||"origsrc");}
function SimpleSwapClick(el){var x=document.getElementsByTagName("img");for(var i=0;i<x.length;i++){var oversrc=x[i].getAttribute("oversrc");if(!oversrc)continue;origin=x[i].src;origin=origin.replace('-on','');x[i].src=origin;x[i].onmouseout=new Function("SimpleSwap(this);");}
oversrc=el.getAttribute("oversrc");el.src=oversrc;el.onmouseout=new Function("SimpleSwap(this,'oversrc');");}
function SimpleSwapSetup(){var x=document.getElementsByTagName("img");for(var i=0;i<x.length;i++){var oversrc=x[i].getAttribute("oversrc");if(!oversrc)continue;x[i].oversrc_img=new Image();x[i].oversrc_img.src=oversrc;x[i].onmouseover=new Function("SimpleSwap(this,'oversrc');SimpleSwapClick(this);");x[i].onclick=new Function("SimpleSwap(this,'oversrc');SimpleSwapClick(this);");x[i].onmouseout=new Function("SimpleSwap(this);");x[i].setAttribute("origsrc",x[i].src);
$(window.document).onclick = new Function("MMenuBlinder('');");
}

}
function searchFnc(){document.retVal=false;one_check=0;if(document.form1.searchWord.value==""&&one_check==0){first_check="searchWord";one_check=1;}
if(document.form1.searchWord.value=="cerca"&&one_check==0){first_check="searchWord";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=32;document.retVal=true;}
else{document.form1[first_check].focus();}}
function loginFnc(){one_check=0;if(document.form1.txt_nome_utente.value==""&&one_check==0){first_check="txt_nome_utente";one_check=1;}
if(document.form1.txt_password.value==""&&one_check==0){first_check="txt_password";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=1;document.form1.submit();}
else{document.form1[first_check].focus();}}
function loginFnc2(){one_check=0;if(document.form1.txt_nome_utente_2.value==""&&one_check==0){first_check="txt_nome_utente_2";one_check=1;}
if(document.form1.txt_password_2.value==""&&one_check==0){first_check="txt_password_2";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=25;document.form1.submit();}
else{document.form1[first_check].focus();}}
function InvioPassword(){one_check=0;if(document.form1.txt_ricordami_password_email.value==""&&one_check==0){first_check="txt_ricordami_password_email";one_check=1;}
if(document.form1.txt_ricordami_password_email.value=="la-tua-email@dominio.xx"&&one_check==0){first_check="txt_ricordami_password_email";one_check=1;}
if(checkMail("txt_ricordami_password_email")==false&&one_check==0){first_check="txt_ricordami_password_email";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=3;document.form1.submit();}
else{document.form1[first_check].focus();}}
function QuickRequest(){one_check=0;if(document.form1.txt_quick_nome.value==""&&one_check==0){first_check="txt_quick_nome";one_check=1;}
if(document.form1.txt_quick_cognome.value==""&&one_check==0){first_check="txt_quick_cognome";one_check=1;}
if(checkMail("txt_quick_email")==false&&one_check==0){first_check="txt_quick_email";one_check=1;}
if(document.form1.txt_quick_text.value==""&&one_check==0){first_check="txt_quick_text";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=4;document.form1.submit();}
else{document.form1[first_check].focus();}}
function logoutFnc(){document.form1.HdnFnc.value=2;document.form1.submit();}
function sendmail(){one_check=0;if(document.form1.txtName.value==""&&one_check==0){first_check="txtName";one_check=1;}
if(document.form1.txtLastName.value==""&&one_check==0){first_check="txtLastName";one_check=1;}
if(checkMail("txtEmail")==false&&one_check==0){first_check="txtEmail";one_check=1;}
if(document.form1.txMsg.value==""&&one_check==0){first_check="txMsg";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=5;document.form1.submit();}
else{if(first_check!="accetta[0]"){document.form1[first_check].focus();}}}
function checkForm(){one_check=0;if(document.form1.txtNome.value==""&&one_check==0){first_check="txtNome";one_check=1;}
if(document.form1.txtCognome.value==""&&one_check==0){first_check="txtCognome";one_check=1;}
if(document.form1.txtCittanascita.value==""&&one_check==0){first_check="txtCittanascita";one_check=1;}
if(document.form1.txtDataDiNascita.value==""&&one_check==0){first_check="txtDataDiNascita";one_check=1;}
if(document.form1.txtDataDiNascita.value=="dd/mm/aaaa"&&one_check==0){first_check="txtDataDiNascita";one_check=1;}
if(document.form1.txtIDdoc.value==""&&one_check==0){first_check="txtIDdoc";one_check=1;}
if (document.form1.drop_categorie.value == "" && one_check == 0){first_check = "drop_categorie";one_check = 1;}
if (document.form1.drop_subcatreg.value == "" && one_check == 0){first_check = "drop_subcatreg";one_check = 1;}
if (document.form1.drop_mansione.value == "" && one_check == 0){first_check = "drop_mansione";one_check = 1;}
if(document.form1.txtIndirizzo2.value==""&&one_check==0){first_check="txtIndirizzo2";one_check=1;}
if(document.form1.txtCitta2.value==""&&one_check==0){first_check="txtCitta2";one_check=1;}
if(document.form1.dropDown_PrvNascita.value==""&&one_check==0){first_check="dropDown_PrvNascita";one_check=1;}
if(document.form1.txtDataNascita.value==""&&one_check==0){first_check="txtDataNascita";one_check=1;}
if(document.form1.txtTel_1.value==""&&one_check==0){first_check="txtTel_1";one_check=1;}
if(checkMail("txtEmail")==false&&one_check==0){first_check="txtEmail";one_check=1;}
if(document.form1.txtEmail.value!=document.form1.txtREmail.value&&one_check==0){first_check="txtEmail";one_check=1;}
if(document.form1.txtIDuser.value==""&&one_check==0){first_check="txtIDuser";one_check=1;}
if(document.form1.txtPassword.value==""&&one_check==0){first_check="txtPassword";one_check=1;}
if(document.form1.txtPassword.value!=document.form1.txtRPassword.value&&one_check==0){first_check="txtPassword";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=6;document.form1.submit();}
else{document.form1[first_check].focus();}}
function ModificaAnagrafica(){one_check=0;if(document.form1.txtNome.value==""&&one_check==0){first_check="txtNome";one_check=1;}
if(document.form1.txtCognome.value==""&&one_check==0){first_check="txtCognome";one_check=1;}
if(document.form1.txtCittanascita.value==""&&one_check==0){first_check="txtCittanascita";one_check=1;}
if(document.form1.txtDataDiNascita.value==""&&one_check==0){first_check="txtDataDiNascita";one_check=1;}
if(document.form1.txtIDdoc.value==""&&one_check==0){first_check="txtIDdoc";one_check=1;}
if (document.form1.drop_categorie.value == "" && one_check == 0){first_check = "drop_categorie";one_check = 1;}
if (document.form1.drop_subcatreg.value == "" && one_check == 0){first_check = "drop_subcatreg";one_check = 1;}
if (document.form1.drop_mansione.value == "" && one_check == 0){first_check = "drop_mansione";one_check = 1;}
if(document.form1.txtIndirizzo2.value==""&&one_check==0){first_check="txtIndirizzo2";one_check=1;}
if(document.form1.txtCitta2.value==""&&one_check==0){first_check="txtCitta2";one_check=1;}
if(document.form1.dropDown_PrvNascita.value==""&&one_check==0){first_check="dropDown_PrvNascita";one_check=1;}
if(document.form1.txtDataNascita.value==""&&one_check==0){first_check="txtDataNascita";one_check=1;}
if(document.form1.txtTel_1.value==""&&one_check==0){first_check="txtTel_1";one_check=1;}
if(checkMail("txtEmail")==false&&one_check==0){first_check="txtEmail";one_check=1;}
if(document.form1.txtEmail.value!=document.form1.txtREmail.value&&one_check==0){first_check="txtEmail";one_check=1;}
if(document.form1.txtPassword.value==""&&one_check==0){first_check="txtPassword";one_check=1;}
if(document.form1.txtPassword.value!=document.form1.txtRPassword.value&&one_check==0){first_check="txtPassword";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=7;document.form1.submit();}
else{document.form1[first_check].focus();}}
function clearForm(){document.form1.txtNome.value="";document.form1.txtCognome.value="";document.form1.txtCittanascita.value="";document.form1.txtDataDiNascita.value="";document.form1.txtIDdoc.value="";document.form1.txtIndirizzo.value="";document.form1.txtCitta.value="";document.form1.txtCf.value="";document.form1.txtCap.value="";document.form1.txtIndirizzo2.value="";document.form1.txtCitta2.value="";document.form1.dropDown_PrvNascita.selectedIndex=0;document.form1.txtDataNascita.value="";document.form1.txtTel_1.value="";document.form1.txtTel_2.value="";document.form1.txtEmail.value="";document.form1.txtREmail.value="";document.form1.txtIDuser.value="";document.form1.txtPassword.value="";document.form1.txtRPassword.value="";}
function pagenav(page){document.form1.page.value=page;document.form1.submit();}
function addtobasket(idproduct){document.retVal=false;document.form1.idproduct.value=idproduct
document.form1.HdnFnc.value=8;document.retVal=true;}
function deleteFromCart(id){document.form1.idproduct.value=id;document.form1.HdnFnc.value=9;document.form1.submit();}
function inviaOrdine(){document.retVal=false;one_check=0;if(document.form1.txt_ragsoc.value==""&&one_check==0){first_check="txt_ragsoc";one_check=1;}
if(document.form1.txt_provincia.value==""&&one_check==0){first_check="txt_provincia";one_check=1;}
if(document.form1.txt_comune.value==""&&one_check==0){first_check="txt_comune";one_check=1;}
if(document.form1.txt_cap.value==""&&one_check==0){first_check="txt_cap";one_check=1;}
if(document.form1.txt_indirizzo.value==""&&one_check==0){first_check="txt_indirizzo";one_check=1;}
if(document.form1.txt_telefono.value==""&&one_check==0){first_check="txt_telefono";one_check=1;}
if(checkMail("txt_email")==false&&one_check==0){first_check="txt_email";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=10;document.retVal=true;}
else{document.form1[first_check].focus();}}
function sendPrevFnc(){one_check=0;if(document.form1.txtName.value==""&&one_check==0){first_check="txtName";one_check=1;}
if(document.form1.txtCognome.value==""&&one_check==0){first_check="txtCognome";one_check=1;}
if(document.form1.txtTelefono.value==""&&one_check==0){first_check="txtTelefono";one_check=1;}
if(document.form1.txtTelefono.value==""&&one_check==0){first_check="txtTelefono";one_check=1;}
if(checkMail("txtEmailRq")==false&&one_check==0){first_check="txtEmailRq";one_check=1;}
if(document.form1.txtOggetto.value==""&&one_check==0){first_check="txtOggetto";one_check=1;}
if(document.form1.AreaEmailText.value==""&&one_check==0){first_check="AreaEmailText";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=11;document.form1.submit()}
else{document.form1[first_check].focus();}}
function clearPrevFnc(){document.form1.txtName.value="";document.form1.txtCognome.value="";document.form1.txtAzienda.value="";document.form1.txtRuolo.value="";document.form1.txtTelefono.value="";document.form1.txtEmail.value="@";document.form1.txtOggetto.value="";document.form1.AreaEmailText.value="";}
function SendPrivacyDoc(){document.retVal=false;one_check=0;if(document.form1.txt_ragsoc.value==""&&one_check==0){first_check="txt_ragsoc";one_check=1;}
if(document.form1.txt_piva.value==""&&one_check==0){first_check="txt_piva";one_check=1;}
if(document.form1.txt_cf.value==""&&one_check==0){first_check="txt_cf";one_check=1;}
if(document.form1.txt_attivita.value==""&&one_check==0){first_check="txt_attivita";one_check=1;}
if(document.form1.txt_indirizzo.value==""&&one_check==0){first_check="txt_indirizzo";one_check=1;}
if(document.form1.txt_cap.value==""&&one_check==0){first_check="txt_cap";one_check=1;}
if(document.form1.txt_citta.value==""&&one_check==0){first_check="txt_citta";one_check=1;}
if(document.form1.txt_provincia.value==""&&one_check==0){first_check="txt_provincia";one_check=1;}
if(document.form1.txt_telefono.value==""&&one_check==0){first_check="txt_telefono";one_check=1;}
if(document.form1.txt_fax.value==""&&one_check==0){first_check="txt_fax";one_check=1;}
if(document.form1.txt_email.value==""&&one_check==0){first_check="txt_email";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=12;document.retVal=true;}
else{document.form1[first_check].focus();}}
function SendHaccpDoc(){document.retVal=false;one_check=0;if(document.form1.txt_ragsoc.value==""&&one_check==0){first_check="txt_ragsoc";one_check=1;}
if(document.form1.txt_piva.value==""&&one_check==0){first_check="txt_piva";one_check=1;}
if(document.form1.txt_cf.value==""&&one_check==0){first_check="txt_cf";one_check=1;}
if(document.form1.txt_indirizzo.value==""&&one_check==0){first_check="txt_indirizzo";one_check=1;}
if(document.form1.txt_cap.value==""&&one_check==0){first_check="txt_cap";one_check=1;}
if(document.form1.txt_citta.value==""&&one_check==0){first_check="txt_citta";one_check=1;}
if(document.form1.txt_provincia.value==""&&one_check==0){first_check="txt_provincia";one_check=1;}
if(document.form1.txt_telefono.value==""&&one_check==0){first_check="txt_telefono";one_check=1;}
if(document.form1.txt_fax.value==""&&one_check==0){first_check="txt_fax";one_check=1;}
if(document.form1.txt_email.value==""&&one_check==0){first_check="txt_email";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=13;document.retVal=true;}
else{document.form1[first_check].focus();}}
function SendValRischDoc(azione){document.retVal=false;one_check=0;if(document.form1.txt_ragsoc.value==""&&one_check==0){first_check="txt_ragsoc";one_check=1;}
if(document.form1.txt_piva.value==""&&one_check==0){first_check="txt_piva";one_check=1;}
if(document.form1.txt_cf.value==""&&one_check==0){first_check="txt_cf";one_check=1;}
if(document.form1.txt_indirizzo.value==""&&one_check==0){first_check="txt_indirizzo";one_check=1;}
if(document.form1.txt_cap.value==""&&one_check==0){first_check="txt_cap";one_check=1;}
if(document.form1.txt_citta.value==""&&one_check==0){first_check="txt_citta";one_check=1;}
if(document.form1.txt_provincia.value==""&&one_check==0){first_check="txt_provincia";one_check=1;}
if(document.form1.txt_telefono.value==""&&one_check==0){first_check="txt_telefono";one_check=1;}
if(document.form1.txt_fax.value==""&&one_check==0){first_check="txt_fax";one_check=1;}
if(document.form1.txt_email.value==""&&one_check==0){first_check="txt_email";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=azione;document.retVal=true;}
else{document.form1[first_check].focus();}}
function CommentoNews(){document.retVal=false;one_check=0;if(document.form1.txtNameCommento.value==""&&one_check==0){first_check="txtNameCommento";one_check=1;}
if(checkMail("txtEmailCommento")==false&&one_check==0){first_check="txtEmailCommento";one_check=1;}
if(document.form1.txtTitoloCommento.value==""&&one_check==0){first_check="txtTitoloCommento";one_check=1;}
if(document.form1.txMsgCommento.value==""&&one_check==0){first_check="txMsgCommento";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=24;document.retVal=true;}
else{document.form1[first_check].focus();}}
function Associati(){one_check=0;if(document.form1.txtNome.value==""&&one_check==0){first_check="txtNome";one_check=1;}
if(document.form1.txtCognome.value==""&&one_check==0){first_check="txtCognome";one_check=1;}
if(document.form1.txtCittanascita.value==""&&one_check==0){first_check="txtCittanascita";one_check=1;}
if(document.form1.txtDataDiNascita.value==""&&one_check==0){first_check="txtDataDiNascita";one_check=1;}
if(document.form1.txtCf.value==""&&one_check==0){first_check="txtCf";one_check=1;}
if(document.form1.txtIndirizzo.value==""&&one_check==0){first_check="txtIndirizzo";one_check=1;}
if(document.form1.txtCap.value==""&&one_check==0){first_check="txtCap";one_check=1;}
if(document.form1.txtCitta.value==""&&one_check==0){first_check="txtCitta";one_check=1;}
if(document.form1.dropDown_PrvNascita.value==""&&one_check==0){first_check="dropDown_PrvNascita";one_check=1;}
if(document.form1.txtTel_1.value==""&&one_check==0){first_check="txtTel_1";one_check=1;}
if(document.form1.dropDown_Titolo.value==""&&one_check==0){first_check="dropDown_Titolo";one_check=1;}
if(checkMail('txtEmail')==false&&one_check==0){first_check="txtEmail";one_check=1;}
if(document.form1.txtEmail.value!=document.form1.txtREmail.value&&one_check==0){first_check="txtEmail";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=30;document.form1.submit();}
else{document.form1[first_check].focus();}}
function IscCentro(){one_check=0;if(document.form1.txtCentro.value==""&&one_check==0){first_check="txtCentro";one_check=1;}
if(document.form1.txtIndirizzo.value==""&&one_check==0){first_check="txtIndirizzo";one_check=1;}
if(document.form1.txtCitta.value==""&&one_check==0){first_check="txtCitta";one_check=1;}
if(document.form1.dropDown_Prv.value==""&&one_check==0){first_check="dropDown_Prv";one_check=1;}
if(document.form1.txtCap.value==""&&one_check==0){first_check="txtCap";one_check=1;}
if(document.form1.txtTelefono.value==""&&one_check==0){first_check="txtTelefono";one_check=1;}
if(checkMail('txtEmail')==false&&one_check==0){first_check="txtEmail";one_check=1;}
if(one_check==0){document.form1.HdnFnc.value=31;document.form1.submit();}
else{document.form1[first_check].focus();}}
function checkMail(InputData){Mail=document.form1[InputData].value;var mailRet=false;Filtro=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;if(Filtro.test(Mail)){mailRet=true;}
return mailRet;}
function keyControl(){if((event.keyCode<48)||(event.keyCode>57)){event.keyCode="".charCodeAt(0);}}
function WinPrevOpen(){width=(screen.width-700)/2;height=(screen.height-350)/2;win=window.open('lightwindow_preventivi.asp','popup','width=700,height=350,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=no,screenX='+width+',screenY='+height+',top='+height+',left='+width+'');win.focus();}
