// JavaScript Document

function verify(){
var Name = document.friendform.Name.value;
var Email = document.friendform.Email.value;
var F1Name = document.friendform.F1Name.value;
var F1Email = document.friendform.F1Email.value;
var F2Email = document.friendform.F2Email.value;
var F3Email = document.friendform.F3Email.value;
if (Name == ""){
alert("Please enter your first name")
document.friendform.Name.focus();return false; }
if (Email== ""){
alert("Please enter your email address")
document.friendform.Email.focus();return false; }
if (!checkemail(Email)){
alert("Your email address is not going to work please input it again")
document.friendform.Email.focus();return false;}
if (F1Name == ""){
alert("Please enter your friend's name")
document.friendform.F1Name.focus();return false; }
if (F1Email == ""){
alert("Please enter your friend's email")
document.friendform.F1Email.focus();return false; }
if (!checkemail(F1Email)){
alert("The 1st email address is not going to work plese input it again")
document.friendform.F1Email.focus();return false;}
if (!F2Email == ""){
if (!checkemail(F2Email)){
alert("The 2nd email address is not going to work plese input it again")
document.friendform.F2Email.focus();return false;}
}
if (!F3Email == ""){
if (!checkemail(F3Email)){
alert("The 3rd email address is not going to work plese input it again")
document.friendform.F3Email.focus();return false;}
}
}
function checkemail(str){
if(!str.match(/^[\w]{1}[\w\.\&\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)){
return false;
} else {
return true;
}
}
