﻿// ----------------------------------------------------
// EmailThisPage page handler functions
// created: Fri. 23-June-2006
// author: asaleh
// ----------------------------------------------------

// Client validation functions

function ValidateContactForm(theForm)
{
    if (!IsNameOK(theForm.yourName)) 
    {
        alert("You entered a blank or the following Name: \n\n" + theForm.yourName.value + " \n\nThis is not a valid Name format. \nPlease check and try again. \ne.g. Firstname Lastname");
        theForm.yourName.focus();
        return false;
    }    
    if (!IsEmailOK(theForm.yourEMail)) 
    {
        alert("You entered a blank or the following E-Mail: \n\n" + theForm.yourEMail.value + " \n\nThis is not a valid E-Mail format. \nPlease check and try again. \ne.g. yourname@acompany.com");
        theForm.yourEMail.focus();
        return false;
    }  
    if (!IsEmailOK(theForm.friendsEMail)) 
    {
        alert("You entered a blank or the following friend\'s E-Mail: \n\n" + theForm.friendsEMail.value + " \n\nThis is not a valid E-Mail format. \nPlease check and try again. \ne.g. friendname@acompany.com");
        theForm.friendsEMail.focus();
        return false;
    }   
    if (theForm.Comments.value.length < 6) 
    {
        alert("You entered a blank or the following Comments: \n\n" + theForm.Comments.value + " \n\nComments are required. \nPlease check and try again.");
        theForm.Comments.focus();
        return false;
    }
    return true;      
}


