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 CheckTextArea() {
	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";
	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 (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
}
