defaultStatus="© 2004 Sirio Illuminazione.com - Tutti i diritti riservati.";

function pop_up(a,x) {
	if (a==1){
mypopWin = window.open(x,'pop','scrollbars=yes,resizable=no,width=750,height=540,status=no,location=no,toolbar=no,top=0,left=0');
}	if (a==2){
mypopWin = window.open(x,'pop','scrollbars=no,resizable=no,width=750,height=450,status=no,location=no,toolbar=no,top=0,left=0');
}	if (a==3){
mypopWin = window.open(x,'pop','scrollbars=no,resizable=no,width=300,height=189,status=no,location=no,toolbar=no,top=0,left=0');
}
}

function ChangePage() {
var url2redir='URL';
window.opener.document.location=url2redir;
window.self.close();
}

function form_validator(theForm)
{
	if(theForm.nome.value == "") {
		 alert("Pregasi compilare il campo NOME.");
		 theForm.nome.focus();
		 return(false);
	}
	if(theForm.cognome.value == "") {
		 alert("Pregasi compilare il campo COGNOME.");
		 theForm.cognome.focus();
		 return(false);
	}
	if(theForm.address.value == "") {
		 alert("Pregasi compilare il campo INDIRIZZO.");
		 theForm.address.focus();
		 return(false);
	}
	if(theForm.city.value == "") {
		 alert("Pregasi compilare il campo CITTA\'.");
		 theForm.city.focus();
		 return(false);
	}
	if(theForm.cap.value == "") {
		 alert("Pregasi compilare il campo C.A.P.");
		 theForm.cap.focus();
		 return(false);
	}
	if(theForm.cap.value.length < "5") {
		 alert("Il codice numerico digitato all\'interno del campo C.A.P. risulta: NON VALIDO.\nPregasi verificare la sintassi dei dati inseriti.");
		 theForm.cap.focus();
		 return(false);
	}
	if(!parseFloat(theForm.cap.value)) {
		 alert("Pregasi compilare correttamente il campo C.A.P.!");
		 theForm.cap.focus();
		 return(false);
	}
	if(document.theForm.provincia.options[document.theForm.provincia.selectedIndex].value == "selezionare") {
		 alert("Pregasi SELEZIONARE LA PROVINCIA.");
		 document.theForm.provincia.focus();
		 return(false);
	}
	if(theForm.email.value == "") {
		 alert("Pregasi compilare il campo E-MAIL.");
		 theForm.email.focus();
		 return(false);
	}
	if (theForm.email.value.length < 6 || theForm.email.value.indexOf("@") == -1 || theForm.email.value.indexOf(".") == -1) {
	 	 alert("L\'indirizzo digitato all\'interno del campo E-MAIL risulta: NON VALIDO.\nPregasi verificare la sintassi dei dati inseriti.");
		 theForm.email.focus();
		 return false;
	}
	if(theForm.phone.value == "") {
		 alert("Pregasi compilare il campo RECAPITO TELEFONICO.");
		 theForm.phone.focus();
		 return(false);
	}
	if(theForm.phone.value.length < "9") {
		 alert("Il codice numerico digitato all\'interno del campo RECAPITO TELEFONICO risulta: NON VALIDO. Pregasi verificare la sintassi dei dati inseriti.");
		 theForm.phone.focus();
		 return(false);
	}
	if(!parseFloat(theForm.phone.value)) {
		 alert("Pregasi compilare correttamente il campo RECAPITO TELEFONICO!");
		 theForm.phone.focus();
		 return(false);
	}
	if(document.theForm.argomento.options[document.theForm.argomento.selectedIndex].value == "selezionare") {
		 alert("Pregasi SELEZIONARE L\'ARGOMENTO DESIDERATO.");
		 document.theForm.argomento.focus();
		 return(false);
	}
	if(theForm.richiesta.value.length == "") {
		 alert("Pregasi specificare l\'OGGETTO DELLA VS. RICHIESTA.");
		 theForm.richiesta.focus();
		 return(false);
	}
	if(theForm.richiesta.value.length > "500") {
		 alert("Pregasi utilizzare non pił di 500 caratteri.");
		 theForm.richiesta.focus();
		 return(false);
	}
	return (true);
}

function clear_all() {
document.theForm.reset();
}