//
// Copyright (c) 2004 Gulliver S.r.L.
// All Rights Reserved.
//
// DATE: 17-03-2004
// AUTORE: Fabio Pierani
//----------------------------------------------------------------------------------------------------
// contatti

    function invia() {
		
		if (document.layers)
			document.captureEvents(Event.MOUSEDOWN | Event.CLICK);
			document.onmousedown = document.onclick = function (evt) {
			return false;
		}
		
	    var aTextCtrlValue 				= "Morocutti";
		var oggettoTextCtrlValue		= "Recapito rivenditori di zona";
		var nomeTextCtrlValue 			= document.couponForm.nomeTextCtrl.value;
		var professioneTextCtrlValue	= document.couponForm.professioneTextCtrl.value;
		var zonaTextCtrlValue 			= document.couponForm.zonaTextCtrl.value;		
		var telTextCtrlValue 			= document.couponForm.telTextCtrl.value;
		var emailTextCtrlValue 			= document.couponForm.emailTextCtrl.value;
		var testoTextCtrlValue 			= document.couponForm.testoTextCtrl.value;

	    var body;
	    var to;
	    var from;
		var showAlert = false;

	  	if (aTextCtrlValue == '') {
			showAlert = true;
			document.couponForm.aTextCtrl.focus();
	  	} else if (oggettoTextCtrlValue == '') {
			showAlert = true;
			document.couponForm.oggettoTextCtrl.focus();
	  	} else if (nomeTextCtrlValue == '') {
			showAlert = true;
			document.couponForm.nomeTextCtrl.focus();
	  	} else if (professioneTextCtrlValue == '') {
			showAlert = true;
			document.couponForm.professioneTextCtrl.focus();
	  	} else if (emailTextCtrlValue == '') {
			showAlert = true;
			document.couponForm.emailTextCtrl.focus();
	  	} else if (telTextCtrlValue == '') {
			showAlert = true;
			document.couponForm.telTextCtrl.focus();
	  	} else if (zonaTextCtrlValue == '') {
			showAlert = true;
			document.couponForm.zonaTextCtrl.focus();
	  	}

	    if (showAlert) {
			alert("Hai omesso uno o pił campi obbligatori. ");
			if (document.layers) document.releaseEvents(Event.MOUSEDOWN | Event.CLICK);document.onmousedown = document.onclick = null;
	  	} else {
			to = "Prova";
			from = nomeTextCtrlValue;
			body =
					"\r\n\r\n====================== INFO UTENTE =========================" +
					"\r\n Nominativo/Rag. sociale:	" + nomeTextCtrlValue +
					"\r\n Professione:            	" + professioneTextCtrlValue +
					"\r\n Email:            		" + professioneTextCtrlValue +
					"\r\n Tel/Cel:            		" + telTextCtrlValue +					
					"\r\n Zona:         			" + zonaTextCtrlValue +												
					"\r\n========================================================\r\n" +					
					"\r\n\r\n testo:	" + testoTextCtrlValue
					"\r\n\r\n";
			 document.sendMailForm.utente.value 		= nomeTextCtrlValue;
			 document.sendMailForm.professione.value	= professioneTextCtrlValue
			 document.sendMailForm.zona.value 			= zonaTextCtrlValue;
			 document.sendMailForm.tipo.value 			= telTextCtrlValue;
			 document.sendMailForm.email.value 			= emailTextCtrlValue;
			 document.sendMailForm.testo.value 			= testoTextCtrlValue;
			 document.sendMailForm.submit();
	  	}
	}