// JavaScript Document
function getname(str) {
	str.value=str;
    //alert("Hi, "+ str+"!");
  }

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

var NN3 = false;
sq01= new Image();
sq01.src = "assets/layout/logo.gif";
sq02= new Image();
sq02.src = "assets/layout/mail.gif";
sq03= new Image();
sq03.src = "assets/layout/ita.gif";
sq04= new Image();
sq04.src = "assets/layout/eng.gif";
sq05= new Image();
sq05.src= "assets/layout/find_it.gif";
sq06= new Image();
sq06.src= "assets/layout/find_en.gif";
sq07= new Image();
sq07.src= "assets/layout/ok.gif";
sq08= new Image();
sq08.src= "assets/layout/indietro.gif";
sq09= new Image();
sq09.src= "assets/layout/indietro_en.gif";
sq10= new Image();
sq10.src= "assets/layout/archivio_it.gif";
sq11= new Image();
sq11.src= "assets/layout/archivio_en.gif";
sq12= new Image();
sq12.src= "assets/layout/invia_it.gif";
sq13= new Image();
sq13.src= "assets/layout/invia_en.gif";
sq14= new Image();
sq14.src= "assets/layout/zoom.gif";
sq15= new Image();
sq15.src= "assets/layout/zoom.gif";
sq16= new Image();
sq16.src= "assets/layout/registrati.gif";
sq17= new Image();
sq17.src= "assets/layout/registration.gif";
sq18= new Image();
sq18.src= "assets/layout/login.gif";
sq19= new Image();
sq19.src= "assets/private-area/indietro.gif";
sq20= new Image();
sq20.src= "assets/private-area/back.gif";
sq21= new Image();
sq21.src= "assets/private-area/accedi.gif";
sq22= new Image();
sq22.src= "assets/private-area/accedien.gif";
sq23= new Image();
sq23.src= "assets/layout/ok2.gif";
sq24= new Image();
sq24.src= "assets/layout/ok2.gif";
sq25= new Image();
sq25.src= "assets/find_ru.gif";
sq26= new Image();
sq26.src= "assets/layout/invia_ru.gif";
sq27= new Image();
sq27.src= "assets/layout/archivio_ru.gif";
sq28= new Image();
sq28.src= "assets/layout/invia_ru.gif";
sq29= new Image();
sq29.src= "assets/layout/registrati_ru.gif";
sq30= new Image();
sq30.src = "assets/layout/rus.gif";



sq01on= new Image();
sq01on.src = "assets/layout/logo_on.gif";
sq02on= new Image();
sq02on.src = "assets/layout/mail_on.gif";
sq03on= new Image();
sq03on.src = "assets/layout/ita_on.gif";
sq04on= new Image();
sq04on.src = "assets/layout/eng_on.gif";
sq05on= new Image();
sq05on.src = "assets/layout/find_it_on.gif";
sq06on= new Image();
sq06on.src = "assets/layout/find_en_on.gif";
sq07on= new Image();
sq07on.src = "assets/layout/ok_on.gif";
sq08on= new Image();
sq08on.src = "assets/layout/indietro_on.gif";
sq09on= new Image();
sq09on.src= "assets/layout/indietro_en_on.gif";
sq10on= new Image();
sq10on.src= "assets/layout/archivio_it_on.gif";
sq11on= new Image();
sq11on.src= "assets/layout/archivio_en_on.gif";
sq12on= new Image();
sq12on.src= "assets/layout/invia_it_on.gif";
sq13on= new Image();
sq13on.src= "assets/layout/invia_en_on.gif";
sq14on= new Image();
sq14on.src= "assets/layout/zoom_on.gif";
sq15on= new Image();
sq15on.src= "assets/layout/zoom_on.gif";
sq16on= new Image();
sq16on.src= "assets/layout/registrati_on.gif";
sq17on= new Image();
sq17on.src= "assets/layout/registration_on.gif";
sq18on= new Image();
sq18on.src= "assets/layout/login_on.gif";
sq19on= new Image();
sq19on.src= "assets/private-area/indietro_on.gif";
sq20on= new Image();
sq20on.src= "assets/private-area/back_on.gif";
sq21on= new Image();
sq21on.src= "assets/private-area/accedi_on.gif";
sq22on= new Image();
sq22on.src= "assets/private-area/accedien_on.gif";
sq23on= new Image();
sq23on.src = "assets/layout/ok2_on.gif";
sq24on= new Image();
sq24on.src = "assets/layout/ok2_on.gif";
sq25on= new Image();
sq25on.src = "assets/layout/find_ru_on.gif";
sq26on= new Image();
sq26on.src = "assets/layout/invia_ru_on.gif";
sq27on= new Image();
sq27on.src= "assets/layout/archivio_ru_on.gif";
sq28on= new Image();
sq28on.src= "assets/layout/invia_ru_on.gif";
sq29on= new Image();
sq29on.src= "assets/layout/registrati_ru_on.gif";
sq30on= new Image();
sq30on.src = "assets/layout/rus_on.gif";



NN3 = true;
function on(name) {
	if (NN3) document[name].src = eval(name + "on.src");
}
function off(name) {
	if (NN3) document[name].src = eval(name + ".src");
} 

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function NewWindow(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'scrollbars=no,resizable=no,height='+h+',width='+w+',top='+wint+',left='+winl;
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewWindow2(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'scrollbars=yes,resizable=yes,height='+h+',width='+w+',top='+wint+',left='+winl;
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function CheckTextArea8() {
	obj=document.getElementById( 'controllo' );
	mess="";
	document.getElementById('nome').style.backgroundColor="#FFFFFF";
	document.getElementById('cognome').style.backgroundColor="#FFFFFF";
	document.getElementById('mail').style.backgroundColor="#FFFFFF";
	document.getElementById('messaggio').style.backgroundColor="#FFFFFF";
	document.getElementById('captchastring').style.backgroundColor="#FFFFFF";
	if (obj.nome.value == "") {
		mess+=err_nome;
		document.getElementById('nome').style.backgroundColor="#E2EFF7";
	}
	if (obj.cognome.value == "") {
		if(mess==""){
			mess+=err_cognome;
		} else {
			mess+=", "+ err_cognome;
		}
		document.getElementById('cognome').style.backgroundColor="#E2EFF7";
	}
	if (obj.mail.value == "") {
		if(mess==""){
			mess+=err_mail1;
		} else {
			mess+=", "+err_mail1;
		}
		document.getElementById('mail').style.backgroundColor="#E2EFF7";
	}
	if (obj.mail.value != "" && (obj.mail.value.indexOf("@") == -1 || obj.mail.value.indexOf(".") == -1 || obj.mail.value.length<6)) {
		if(mess==""){
			mess+=err_mail2;
		} else {
			mess+=", "+err_mail2;
		}
		document.getElementById('mail').style.backgroundColor="#E2EFF7";
	}
	if (obj.messaggio.value == "") {
		if(mess==""){
			mess+=err_messaggio;
		} else {
			mess+=", "+err_messaggio;
		}
		document.getElementById('messaggio').style.backgroundColor="#E2EFF7";
	}
	if (obj.captchastring.value == "") {
		if(mess==""){
			mess+=err_codice;
		} else {
			mess+=", "+err_codice;
		}
		document.getElementById('captchastring').style.backgroundColor="#E2EFF7";
	}
	if (mess!="") {
		alert(err_invia+mess+".");
		return false;
		void(0);
	} else {
		obj.submit();
	}
	//return true
}
function CheckTextArea2() {
	obj=document.getElementById( 'controllo' );
	mess="";
	document.getElementById('codice').style.backgroundColor="#FFFFFF";
	document.getElementById('nome').style.backgroundColor="#FFFFFF";
	document.getElementById('cognome').style.backgroundColor="#FFFFFF";
	document.getElementById('indirizzo').style.backgroundColor="#FFFFFF";
	document.getElementById('cap').style.backgroundColor="#FFFFFF";
	document.getElementById('citta').style.backgroundColor="#FFFFFF";
	document.getElementById('telefono').style.backgroundColor="#FFFFFF";
	document.getElementById('email').style.backgroundColor="#FFFFFF";
	if (obj.codice.value == "") {
		mess+=err_codice;
		document.getElementById('codice').style.backgroundColor="#E2EFF7";
	}
	
	if (obj.nome.value == "") {
		if(mess==""){
			mess+=err_nome;
		} else {
			mess+=", "+ err_nome;
		}
		document.getElementById('nome').style.backgroundColor="#E2EFF7";
	}
	if (obj.cognome.value == "") {
		if(mess==""){
			mess+=err_cognome;
		} else {
			mess+=", "+ err_cognome;
		}
		document.getElementById('cognome').style.backgroundColor="#E2EFF7";
	}
	if (obj.telefono.value == "") {
		if(mess==""){
			mess+=err_telefono;
		} else {
			mess+=", "+ err_telefono;
		}
		document.getElementById('telefono').style.backgroundColor="#E2EFF7";
	}
	if (obj.email.value == "") {
		if(mess==""){
			mess+=err_mail1;
		} else {
			mess+=", "+err_mail1;
		}
		document.getElementById('email').style.backgroundColor="#E2EFF7";
	}
	if (obj.email.value != "" && (obj.email.value.indexOf("@") == -1 || obj.email.value.indexOf(".") == -1 || obj.email.value.length<6)) {
		if(mess==""){
			mess+=err_mail2;
		} else {
			mess+=", "+err_mail2;
		}
		document.getElementById('email').style.backgroundColor="#E2EFF7";
	}
	if (obj.indirizzo.value == "") {
		if(mess==""){
			mess+=err_indirizzo;
		} else {
			mess+=", "+ err_indirizzo;
		}
		document.getElementById('indirizzo').style.backgroundColor="#E2EFF7";
	}
	if (obj.cap.value == "") {
		if(mess==""){
			mess+=err_cap;
		} else {
			mess+=", "+ err_cap;
		}
		document.getElementById('cap').style.backgroundColor="#E2EFF7";
	}
	if (obj.citta.value == "") {
		if(mess==""){
			mess+=err_citta;
		} else {
			mess+=", "+ err_citta;
		}
		document.getElementById('citta').style.backgroundColor="#E2EFF7";
	}
	
	if (obj.privacy.value == "no") {
		if(mess==""){
			mess+=err_priv;
		} else {
			mess+=". "+err_priv;
		}
	} 
	if (mess!="") {
		alert(err_invia+mess);
		return false;
		void(0);
	} else {
		obj.submit();
	}

	return true
}
function CheckTextArea3() {
	obj=document.getElementById( 'controllo' );
	mess="";
	document.getElementById('user').style.backgroundColor="#FFFFFF";
	document.getElementById('pass').style.backgroundColor="#FFFFFF";
	if (obj.user.value == "") {
		mess+=err_user;
		document.getElementById('user').style.backgroundColor="#E2EFF7";
	}
	if (obj.pass.value == "") {
		if(mess==""){
			mess+=err_pass;
		} else {
			mess+=", "+ err_pass;
		}
		document.getElementById('pass').style.backgroundColor="#E2EFF7";
	}
	if (mess!="") {
		alert(err_invia+mess+".");
		return false;
		void(0);
	} else {
		obj.submit();
	}
	//return true
}
function CheckTextArea4() {
	obj=document.getElementById( 'controllo4' );
	mess="";
	document.getElementById('email').style.backgroundColor="#FFFFFF";
	if (obj.email.value == "") {
		if(mess==""){
			mess+=err_mail1;
		} else {
			mess+=", "+err_mail1;
		}
		document.getElementById('email').style.backgroundColor="#E2EFF7";
	}
	if (obj.email.value != "" && (obj.email.value.indexOf("@") == -1 || obj.email.value.indexOf(".") == -1 || obj.email.value.length<6)) {
		if(mess==""){
			mess+=err_mail2;
		} else {
			mess+=", "+err_mail2;
		}
		document.getElementById('email').style.backgroundColor="#E2EFF7";
	}
	if (mess!="") {
		alert(err_invia+mess+".");
		return false;
		void(0);
	} else {
		obj.submit();
	}
	//return true
}
function veri() {
	obj=document.getElementById( 'domanda' );
	mess="";
	document.getElementById('testo').style.backgroundColor="#FFFFFF";
	if (obj.testo.value == "") {
		mess+=err_testo;
		document.getElementById('testo').style.backgroundColor="#E2EFF7";
	}
	if (mess!="") {
		alert(err_invia+mess+".");
		return false;
		void(0);
	} else {
		obj.submit();
	}
	//return true
}
