// JavaScript Document


function isPhone(fieldval)
{
	re = /^\d{3}\-\d{3}\-\d{4}$/;
	return re.test(fieldval);
}
function isEmail(fieldval)
{
	re = /^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/;
	return re.test(fieldval);
}
function isNull(fieldval)
{
	re = /^\s{0,}$/;
	return re.test(fieldval);
}
function isNumeric(fieldval)
{
	re = /^\d{1,4}$/
	return re.test(fieldval);
}


function ValidateFieldsFE()
{
    if(document.getElementById("firstname").value == "")
    {
        alert("First Name Cannot Be Blank.");
        document.getElementById("firstname").focus();
        return false;
    }
    else if(document.getElementById("lastname").value == "")
    {
        alert("Last Name Cannot Be Blank.");
        document.getElementById("lastname").focus();
        return false;
    }
    else if(document.getElementById("address").value == "")
    {
        alert("Address Cannot Be Blank.");
        document.getElementById("address").focus();
        return false;
    }
    else if(document.getElementById("city").value == "")
    {
        alert("City Cannot Be Blank.");
        document.getElementById("city").focus();
        return false;
    }
    else if(document.getElementById("state").value == "")
    {
        alert("State Cannot Be Blank.");
        document.getElementById("state").focus();
        return false;
    }
    else if(document.getElementById("zipcode").value == "")
    {
        alert("Zip/Postal Code Cannot Be Blank.");
        document.getElementById("zipcode").focus();
        return false;
    }
    else if(document.getElementById("phone").value == "")
    {
        alert("Phone Number Cannot Be Blank.");
        document.getElementById("phone").focus();
        return false;
    }
    else if(document.getElementById("email").value == "")
    {
        alert("E-mail Cannot Be Blank");
        document.getElementById("email").focus();
        return false;
    }
    else if(!isEmail(document.getElementById("email").value))
    {
        alert("Incorrect format for Email.  The email address must be in the form name@company.com.");
        document.getElementById("email").focus();
        return false;
    }
    else
	{
        document.getElementById("frmInformation").submit();
    }
}


