//******************************************************************************
// *  Filename:  custsrv.js
// *  Purpose :  This file contains java script validation for use in the Informational Website, specifically on custsrv.html. 
// *  Author :   Erin Wright 
// *  CM Info :  $Header: 
// *             $Log: 
//******************************************************************************
function validateCustomerInfo(form)

{
    statu = true;
    err_msg = "";

    if (isEmptyStr(form.Name))
    {
        setError("Name is required.");
    }

    if (isEmptyStr(form.Email))
    {
        setError("E-mail address is required.");
    }

    if (isEmptyStr(form.Phone))
    {
        setError("Phone number is missing or invalid.");
    }

    if (!isEmptyStr(form.Phone) && !isValidNumber(form.Phone.value))
    {
        setError("Phone number must only contain numbers.");
    }

    if (!(form.Phone.value.length >= 10 && form.Phone.value.length <= 15))
    {
        setError("Phone Number must be at least 10 digits.");
    }
    
    if (isEmptyStr(form.Comments))
    {
        setError("Comments are required.");
    }

    if (!statu)
    {
        alert(err_msg);
    }

    else
    {
        alert("Thank you for submitting e-mail.");
    }
 
    return statu;
}
