﻿// ----------------------------------------------------
// ContactUs page handler functions
// created: Sun. 14-May-2006
// author: asaleh
// ----------------------------------------------------

// Client validation functions

function ValidateContactForm(theForm)
{
    if (!IsNameOK(theForm.Name)) 
    {
        alert("You entered a blank or the following Name: \n\n" + theForm.Name.value + " \n\nThis is not a valid Name format. \nPlease check and try again. \ne.g. Firstname Lastname");
        theForm.Name.focus();
        return false;
    }    
    if (!IsEmailOK(theForm.EMail)) 
    {
        alert("You entered a blank or the following E-Mail: \n\n" + theForm.EMail.value + " \n\nThis is not a valid E-Mail format. \nPlease check and try again. \ne.g. yourname@acompany.com");
        theForm.EMail.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;      
}






//function Page_ClientValidate(theForm)
//{
//    if (!IsPostBack) 
//    {
//        // Validate initially to force the asterisks
//        // to appear before the first roundtrip.
//        Validate(theForm);
//    }
//}
//		
//function Validate(theForm)
//{
//    if (theForm.Name == '') 
//    {
//        // Validate initially to force the asterisks
//        // to appear before the first roundtrip.
//        
//    }
//}

