function frmFriend_onsubmit()  {
    if ((document.getElementById("yourName").value == "") || (document.getElementById("yourEmail").value == "") || (document.getElementById("friendEmail").value == ""))  {
       window.alert("The email cannot be sent because missing the mandatory fields\n\n- Your Name\n- Your Email\n- Recipientes Email Address\n");
    } else  {
       document.getElementById("friendForm").submit();
    }
}

function yourEmail_onchange()  {
   email = new String(document.getElementById("yourEmail").value);
       
   if (email.indexOf("@") == -1)  {
      window.alert("Your email address entered is not in the correct format.  It must contain the @ symbol.");
      document.getElementById("yourEmail").value = "";
   }
}

function friendEmail_onchange()  {
   email = new String(document.getElementById("friendEmail").value);
       
   if (email.indexOf("@") == -1)  {
      window.alert("Your friend's email address entered is not in the correct format.  It must contain the @ symbol.");
      document.getElementById("friendEmail").value = "";
   }
}
