// JavaScript Document
/*!
 * Check Required Form Fields
 * 
 * Copyright (c) 2009 Roy Veenendaal
 *
 * Date: 2009-12-06
 * Revision: 1
 */

function validate() {
    if (document.customForm.firstname__c.value == 0) {
        alert('You must fill in the First Name field.');
        return false;
  }
 else if (document.customForm.lastname__c.value == 0) {
        alert('You must fill in the Last Name field.');
        return false;
  }
 else if (document.customForm.Email__c.value == 0) {
        alert('You must fill in the Email Address field.');
        return false;
    }
 else if (document.customForm.phone_home__c.value == 0) {
        alert('You must fill in the address field.');
        return false;
    }
 else if (document.customForm.Mailing_Street__c.value == 0) {
        alert('You must fill in the phone field.');
        return false;
    }
 else if (document.customForm.Mailing_City__c.value == 0) {
        alert('You must fill in the city field.');
        return false;
    }
 else if (document.customForm.mailing_state__c.value == 0) {
        alert('You must fill in the state field.');
        return false;
    }
 else if (document.customForm.Mailing_Postal_Code__c.value == 0) {
        alert('You must fill in the zip field.');
        return false;
    }
 else if (document.customForm.Lead_Source__c.value == 0) {
        alert('Please tell us how you heard about us.');
        return false;
    }
 else
     return true;
}



function displayDiv(divID)
{
	//var divstyle = new String();
	divstyle = document.getElementById(divID).style.display;
	
	if(divstyle.toLowerCase()=="block" || divstyle == "")
	{
		document.getElementById(divID).style.display = "none";
	}
	else
	{
		document.getElementById(divID).style.display = "block";
	}
}



