function setVariables(){
if (navigator.appName == "Netscape") {
if (parseInt(navigator.appVersion) >= 5){v=".top=";h=".left=";dS="document.getElementById(\"";sD="\").style";
y="window.pageYOffset";x="window.pageXOffset";}
else {v=".top=";h=".left=";dS="document.";sD="";
y="window.pageYOffset";x="window.pageXOffset";}
}
else {h=".pixelLeft=";v=".pixelTop=";dS="";sD=".style";
y="document.body.scrollTop";x="document.body.scrollLeft";}
checkLocationA()}
function checkLocation(){
object="menulogo";yy=eval(y);xx=eval(x);
xdiff=xstart-xx;
if ((xdiff<(-1))||(xdiff>(1))) movex=Math.round(xdiff/10),xstart-=movex
if (ystart>=90){eval(dS+object+sD+v+(ystart+10));
} else {eval(dS+object+sD+v+90);}
if (xstart < 305){xstart=305;}
eval(dS+object+sD+h+xstart);
setTimeout("checkLocation()",10);
}
function checkLocationA(){ystart=eval(y);xstart=eval(x);}
function apriFinestra(url, myname, w, h, prop,res) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'resizable='+res+',scrollbars='+prop+',height='+h+',width='+w+',top='+wint+',left='+winl;
var urlcompleto= url;
win = window.open(urlcompleto, myname, winprops);
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function spedisci(){
window.document.forms[0].elements[0].value='TRUE';
var ok=true;
if(ok==true){
var vcognome=document.forms[0].cognome.value;
if(vcognome.length<2){alert("Inserire il proprio Cognome o la Società.");
document.forms[0].cognome.focus();
ok=false;}}
if(ok==true){
var stringa=document.forms[0].email.value;
if(((stringa.length-stringa.lastIndexOf('.'))>6)||((stringa.length-stringa.lastIndexOf('.'))<3)||(stringa.indexOf('@')<0)||(stringa.indexOf('@')!=stringa.lastIndexOf('@'))||((stringa.lastIndexOf('.'))-(stringa.lastIndexOf('@'))<3)){alert("L'indirizzo di posta elettronica \nnon è valido. \nInserire un indirizzo valido.");
document.forms[0].email.focus();
ok=false;}}
if(ok==true){
var vaccetta=document.forms[0].accetto;
if(vaccetta.checked==false){alert("Per poter inviare il form è necessario consentire il trattamento dei dati ai sensi del D.Lgs. 196/03.");
vaccetta.focus();
ok=false;}}
if(ok)document.forms[0].submit();
}

