// JavaScript Document
function checkform(oForm) { 
         var el, focus_el, i = 0, 
         msg = '\nIl/i seguentei/ campo/i non č/sono stato/i inserito/i :\n\n'; 
         while (el = oForm.elements[i++]) 
         if ((/^\s*$/.test(el.value)) && (el.mandatory=='Y')) { 
                   msg += '\t' + prompts[el.name] + '\n'; 
                   if (!focus_el) focus_el = el; 
         } if (focus_el) { 
                   msg += '\n Per favore completare tutto il form e re-inviare.\n'; 
                   alert(msg); 
                   focus_el.focus(); 
                   focus_el.select(); 
                   return false; 
         } 
         return checkEmail(oForm.email); 
}

function checkEmail(field) { 
         var filter = /^.+@.+\..{2,3}$/; 
                   if (filter.test(field.value)) 
                            return true; 
                   else { 
                            alert('Per favore inserire un indirizzo email valido.'); 
                            field.focus(); 
                            field.select(); 
                            return false; 
                   } 
}


function sendMail(address,domainName,domainExt){
         var completeAddress = address+"@"+domainName+"."+domainExt;
         var command = "mail"+"to:"+completeAddress;
         parent.location=command;
}
function checkAgreement(oForm){
         return (oForm.agreement.checked);
}
 

function RichiestaInfo(oForm){
         if (checkform(oForm)){
                   if (checkAgreement(oForm)){
                            var completeAddress = "info"+"@"+"manuelina"+".com";
                            var subjectLine = "Richiesta informazioni.";
                            var bodyContent = "Il/La Sig./Sig.ra : "+oForm.nome.value+" "+oForm.cognome.value+"\n";
                            bodyContent += "Indirizzo : "+oForm.indirizzo.value+"\n";
                            bodyContent += "Cap : "+oForm.cap.value+"\n";
                            bodyContent += "Cittā : "+oForm.citta.value+"\n";
                            bodyContent += "Provincia : "+oForm.provincia.value+"\n";
                            bodyContent += "Telefono : "+oForm.telefono.value+"\n";
                            bodyContent += "Fax : "+oForm.fax.value+"\n";
                            bodyContent += "E-mail : "+oForm.email.value+"\n";
                            bodyContent += "Richiede maggiori informazioni su: "+oForm.informazioni.value+"\n";						
			    bodyContent += "Note: "+oForm.note.value+"\n";
                            bodyContent += "Contatto preferito: "+oForm.contatto.value+"\n";						
                            var command = "mail"+"to:"+completeAddress+"?SUBJECT="+escape(subjectLine)+"&body="+escape(bodyContent);
                            parent.location=command;
                   } else { 
                            alert("Per usufruire del servizio devi autorizzare il trattamento dei tuoi dati personali ai sensi della legge 31/12/1996 N°675"); 
                   }
         }
}
