function tendina(div,ima)
{var SrcImg=document.getElementById(ima)
var SrcDiv=document.getElementById(div)
if(SrcDiv.style.display=="")
{SrcDiv.style.display="none";SrcImg.src="images/sondaggi/simbolo_piu.gif";SrcImg.alt="Apri";}
else{SrcDiv.style.display="";SrcImg.src="images/sondaggi/simbolo_meno.gif";SrcImg.alt="Chiudi";}}
function checkLogin()
{var user=document.frmboxlogin.inpuser.value;var password=document.frmboxlogin.inppassword.value;if((user=="")||(user=="undefined")){alert("Inserire la user per fare il login.");document.frmboxlogin.inpuser.focus();return false;}
else if((password=="")||(password=="undefined")){alert("Inserire la password per fare il login.");document.frmboxlogin.inppassword.focus();return false;}}
function checkRicerca()
{var user=document.frmboxsearch.inputsearch.value;if((user=="")||(user=="undefined")){alert("Inserire una parola per la ricerca.");document.frmboxsearch.inputsearch.focus();return false;}
document.frmboxsearch.submit();}
function checkMarca()
{var user=document.frmboxsearch.selmarca.value;if((user=="0")||(user=="undefined")){alert("Selezionare una marca per effettuare la ricerca.");return false;}
document.frmboxsearch.submit();}
function checkMsgLogin()
{var user=document.frmmsglogin.user.value;var password=document.frmmsglogin.password.value;if((user=="")||(user=="undefined")){alert("Inserire la user per fare il login.");document.frmmsglogin.user.focus();return false;}
else if((password=="")||(password=="undefined")){alert("Inserire la password per fare il login.");document.frmmsglogin.password.focus();return false;}
return true;}
function checkEmail(objEmail)
{var email_reg_exp=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;var email=objEmail.value;if(!email_reg_exp.test(email)||(email=="")||(email=="undefined"))
{alert("Inserire un indirizzo email corretto.");objEmail.select();return false;}
else
{return true;}}
function checkPassword(pw1,pw2)
{var spw1=pw1.value;var spw2=pw2.value;if((spw1!=spw2)||(spw1=="")||(spw1=="undefined"))
{alert("Le due password devono essere uguali.");pw1.value="";pw2.value="";pw1.select();return false;}
else
{return true;}}
function checkRegistrazione()
{var consenso=document.frmregistrazione.loc_privacy.checked;var spw1=document.frmregistrazione.loc_pw1.value;var spw2=document.frmregistrazione.loc_pw2.value;if(consenso==false){alert("Il consenso sul trattamento dei dati (legge della privacy articolo 13 del D. Lgs. 196/03) è obbligatorio per effettuare l'iscrizione.");document.frmregistrazione.loc_privacy.focus();return false;}
if((spw1!=spw2)||(spw1=="")||(spw1=="undefined")||(spw1.length<8))
{alert("Le due password devono essere uguali e avere almeno 8 caratteri.");document.frmregistrazione.loc_pw1.select();return false;}
return true;}
function createPNGImage(src,width,height){if(navigator.userAgent.indexOf("MSIE")!=-1){var element=document.createElement("div");element.style.filter="progid:DXImageTransform.Microsoft."+"AlphaImageLoader(src='"+src+"')";}else{var element=document.createElement("img");element.src=src;element.style.position="absolute";element.style.left="0px";element.style.top="0px";element.style.zindex=1;}
element.style.width=width+"px";element.style.height=height+"px";element.style.position="absolute";element.style.left="0px";element.style.top="0px";element.style.zindex=1;return element;}<!--
function getCookie(CookieName){var start=document.cookie.indexOf(CookieName+'=');var len=start+CookieName.length+1;if((!start)&&(CookieName!=document.cookie.substring(0,CookieName.length)))
return null;if(start==-1)
return null;var end=document.cookie.indexOf(';',len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));}
function setCookie(CookieName,value,expires,path,domain,secure){document.cookie=CookieName+"="+escape(value)+
((expires)?";expires="+expires:"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function deleteCookie(CookieName,path,domain){if(getCookie(CookieName))
document.cookie=CookieName+'='+
((path)?';path='+path:'')+
((domain)?';domain='+domain:'')+';expires=Thu, 01-Jan-1970 00:00:01 GMT';}
function openWin(url,titolo,width,height)
{searchWin=window.open(url,titolo,"scrollbars=yes,resizable=no,width="+width+",height="+height+",status=no,location=no,toolbar=no");searchWin.focus();}
function openWin2(url,titolo,width,height)
{searchWin=window.open(url,titolo,"scrollbars=no,resizable=no,width="+width+",height="+height+",status=no,location=no,toolbar=no");searchWin.focus();}
function controllanumero(field)
{var val=field.value;var diff=new Number(0);var i
if(!/^\d*$/.test(val)||val==0||val<0)
{alert("Inserire un valore numerico.");field.select();field.focus();field.value="1";}}<!--
function getBrowserWidth(){if(window.innerWidth){return window.innerWidth;}
else if(document.documentElement&&document.documentElement.clientWidth!=0){return document.documentElement.clientWidth;}
else if(document.body){return document.body.clientWidth;}
return 0;}

	


