
var passpers = "";
	passpers+="<FORM NAME=\"formrec\" METHOD=\"post\">";
	passpers+="Usate questo formulario per scriverci. Grazie.<P>";
	passpers+="Inserisci il tuo nome<BR>";
	passpers+="<INPUT TYPE=\"text\" NAME=\"nome\"><BR>";
	passpers+="Nome dell'azienda<BR>";
	passpers+="<INPUT TYPE=\"text\" NAME=\"azienda\"><BR>";
	passpers+="Indirizzo: via e cittą<BR>";
	passpers+="<INPUT TYPE=\"text\" NAME=\"indirizzo\"><BR>";
	passpers+="Inserisci il numero di telefono<BR>";
	passpers+="<INPUT TYPE=\"text\" NAME=\"telefono\"><BR>";
	passpers+="Inserisci la tua mail<BR>";
	passpers+="<INPUT TYPE=\"text\" NAME=\"posta\"><BR>";
	passpers+="Scrivi il tuo messaggio <SMALL>max 150 caratteri</SMALL> <INPUT VALUE=\"150\" NAME=\"num\" SIZE=\"5\" DISABLED></BR>";
	passpers+="<TEXTAREA ROWS=\"5\" COLS=\"35\" NAME=\"messaggio\" ONKEYUP=\"conta(this.form)\"></TEXTAREA><BR>";
	passpers+="!! ATTENZIONE !!<BR>";
	passpers+="<SMALL>Tutti questi campi sono necessari per potervi rispondere.</SMALL><BR>";
	passpers+="<INPUT TYPE=\"button\" ONCLICK=\"return validateqForm();\" VALUE=\"Invia\" CLASS=\"button\" ONFOCUS=\"blur();\"> ";
	passpers+="<INPUT TYPE=\"reset\" VALUE=\"Cancella\" CLASS=\"button\" ONFOCUS=\"blur();\">";
	passpers+="</FORM>";
document.write(passpers);

function conta(val) {
max=150
if (val.messaggio.value.length > max) {
val.messaggio.value = val.messaggio.value.substring(0,max)
rest = 0
}
else {
rest = max - val.messaggio.value.length
}
val.num.value = rest
}

requiredq = new Array("nome", "telefono", "posta", "messaggio")
var div = "<HTML><HEAD><SCRIPT SRC=\"comandi/setup.js\"></SCRIPT><SCRIPT>setTimeout('javascript:history.back()', 9000);</SCRIPT></HEAD><BODY><BODY STYLE=\"text-align:center; background:RGB(255,189,82);\"><BR><BR><TABLE BORDER=\"0\"><TR><TD WIDTH=\"550\" STYLE=\"border: 1px solid #000000; padding: 10px; background: #14B6DE; font: normal 11px verdana; color:#000000;\">Errore nella compilazione del modulo:<P>";
var notgivenq = "";
function isBlankq(s) {
var lenq=s.length
var i
 for(i=0;i<lenq;++i) {
  if(s.charAt(i)!=" ") return false
	}
 return true
}
function validateq(fieldName,fieldValue) {
	if(isBlankq(fieldValue)) {
		notgivenq += fieldName + " = <I>campo non compilato</I><BR>";
	}
}
function validateqForm() {
validationq = true
for(var i=0; i < requiredq.length; ++i) {
	ele = eval("document.forms[0]." + requiredq[i])
	 validateq(ele.name, ele.value)
}
if (notgivenq != "") {
	notgivenq += "<BR>Vi ricordiamo che questi campi sono necessari per poter essere riconosciuti dal destinatario.</TD></TR></TABLE></BODY></HTML>";
	document.write(div)
	document.write(notgivenq)
	notgivenq = ""
	validationq = false
}
if (!validationq) {
	return false
}
else {
document.formrec.action = "scrivici.php";
document.formrec.submit();
        }
}

