//
//  Request Information Form Validation
//
function RequestInfoValidate(theForm)
{
	//
	//  Landing Page and History
	//   
	theForm.LandingPage.value = GetCookie('LandingPage');
	theForm.History.value = GetCookie('History');
	theForm.Referrer.value = GetCookie('Referrer');


	//
	//  Salutation
	//   
	radioOption = -1;
	for (counter=0; counter<theForm.Salutation.length; counter++) 
	{
		if (theForm.Salutation[counter].checked) 
			radioOption = counter;
	}
	if (radioOption == -1)
    {
        alert("Please select a saluation.");
        theForm.Salutation[0].focus();
        return(false);
    }
    


	//
	//  FirstName
	//
    if (theForm.FirstName.value == "")
    {
        window.alert("Please enter a value for the \"First Name\" field.");
        theForm.FirstName.focus();
        return(false);
    }
	if (theForm.FirstName.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"First Name\" field.");
		theForm.FirstName.focus();
        return(false);
	}
	if (theForm.FirstName.value.length > 100)
	{
		alert("Please enter at most 100 characters in the \"First Name\" field.");
		theForm.FirstName.focus();
        return(false);
	}
    

	//
	//  LastName
	//   
    if (theForm.LastName.value == "")
    {
        window.alert("Please enter a value for the \"Last Name\" field.");
		theForm.LastName.focus();
        return(false);
    }    
	if (theForm.LastName.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"Last Name\" field.");
		theForm.LastName.focus();
        return(false);
	}
	if (theForm.LastName.value.length > 100)
	{
		alert("Please enter at most 100 characters in the \"Last Name\" field.");
		theForm.LastName.focus();
        return(false);
	}
    
    
	//
	//  Company
	//       
    if (theForm.Company.value == "")
    {
        window.alert("Please enter a value for the \"Company\" field.");
		theForm.Company.focus();
        return(false);
    }
	if (theForm.Company.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"Company\" field.");
		theForm.Company.focus();
        return(false);
	}
	if (theForm.Company.value.length > 100)
	{
		alert("Please enter at most 100 characters in the \"Company\" field.");
		theForm.Company.focus();
        return(false);
	}

    
    
	//
	//  Email
	//       
    if (theForm.Email.value == "")
    {
        window.alert("Please enter a valid e-mail address.");
		theForm.Email.focus();
        return(false);
    }
    if (theForm.Email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
		theForm.Email.focus();
        return(false);
    }
    if (theForm.Email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
		theForm.Email.focus();
        return(false);
    }
	if (theForm.Email.value.length < 5)
	{
        window.alert("Please enter a valid e-mail address.");
		theForm.Email.focus();
        return(false);
	}
    


	//
	//  PhoneNumber
	//       
    if (theForm.PhoneNumber.value == "")
    {
        window.alert("Please enter a valid phone number.");
		theForm.PhoneNumber.focus();
        return(false);
    }
	if (theForm.PhoneNumber.value.length < 6)
	{
        window.alert("Please enter a valid phone number.");
		theForm.PhoneNumber.focus();
        return(false);
	}

	//
	//  PrimaryIndustry
	//       
	radioOption = -1;
	for (counter=0; counter<theForm.PrimaryIndustry.length; counter++) 
	{
		if (theForm.PrimaryIndustry[counter].checked) 
			radioOption = counter;
	}
	if (radioOption == -1)
    {
        alert("Please select a primary industry.");        
    	// setting focus here doesn't work - causes return(true)???
        //theForm.PrimaryIndustry.focus();        
        return(false);
    }

    return(true);
}





