/* Re-write page after submission */ function sentForm(type, emailreceiver) { var theDivForm = document.getElementById("sendtoafriend" + type); theDivForm.style.display = "none"; var theDiv = document.getElementById("sendtoafriendreponse" + type); theDiv.innerHTML = "
"; theDiv.innerHTML += "

Indirizzo e-mail del destinatario

"; if (formRequester.responseText == "success") { confirm_text = "

Il messaggio รจ stato inviato.

"; confirm_text = confirm_text.replace("#emaildest#", emailreceiver); theDiv.innerHTML += confirm_text; theDiv.style.display = "block"; } else { theDiv.innerHTML += "

Une erreur a empeche l'envoi de votre e-mail !

"; } } /* Validate form before sending */ function checkFormTop() { var emailsendertop = document.getElementById("emailsendertop"); var emailreceivertop = document.getElementById("emailreceivertop"); var messagetop = document.getElementById("messagetop"); var intitule = document.formsendtoafriendtop.intitule; var champs = ""; if (!emailsendertop.value.match(/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/)) { champs += "Tuo indirizzo e-mail, "; } if (!emailreceivertop.value.match(/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/)) { champs += "Indirizzo e-mail del destinatario "; } /*if (messagetop.value == "") { str += "Indirizzo e-mail del destinatario "; return false; }*/ if(champs != ""){ alert("Per favore, completa / correggi i seguenti campi : "+champs); return false; } /* Send information via XMLHR */ var CGIString = "emailsender=" + emailsendertop.value + "&emailreceiver=" + emailreceivertop.value + "&message=" + messagetop.value + "&IE=" + is.ie + "&url=" + document.location.href + "&intitule=" + intitule.value + "&id_version=" + 4; //alert(CGIString); getXhr(); formRequester.onreadystatechange = onreadystatechangeFormTop; var theDiv = document.getElementById("sendtoafriendreponsetop"); /*theDiv.innerHTML = "

Indirizzo e-mail del destinatario

Connection au serveur de mail

";*/ formRequester.open("GET","/site/send_to_a_friend.php?" + CGIString, true); formRequester.send(null); }