// JavaScript Document


var completeMessage="Please fill out the entire form before submitting.";
var emailMessage="Please check your e-mail address.";


//This validates the form on the subscribe page. Checks to make sure that everything is filled out.

function check_it()
{
	var complete=true;
	var the_name=document.subscribe.first_Name.value;
	var the_lastname=document.subscribe.last_Name.value;
	var the_title=document.subscribe.position.value;
	var the_company=document.subscribe.employer.value;
	var the_industryType=document.subscribe.industry.value;
	var the_employeeNumber=document.subscribe.employees.value;
	var the_address=document.subscribe.address.value;
	var the_town=document.subscribe.town.value;
	var the_state=document.subscribe.state.value;
	var the_zip=document.subscribe.zip_Code.value;
	var the_pnumber=document.subscribe.phone_Number.value;
	var the_email=document.subscribe.email.value;
	var the_shrmMember=document.subscribe.member.value;
	var the_localMember=document.subscribe.localmember.value;
	
	
	if ((the_name=="")||(the_name==null)||(the_lastname=="")||(the_lastname==null)||(the_title=="")||(the_title==null)||(the_company=="")||(the_company==null)||(the_industryType=="")||(the_industryType==null)||(the_employeeNumber=="")||(the_employeeNumber==null)||(the_address=="")||(the_address==null)||(the_town=="")||(the_town==null)||(the_state=="")||(the_state==null)||(the_zip=="")||(the_zip==null)||(the_pnumber=="")||(the_pnumber==null)||(the_email=="")||(the_email==null))
		{
		alert(completeMessage);
		complete=false;
		}
		
		else
		{
				if ((the_email.indexOf("@")==-1) || (the_email.indexOf(".")==-1))
				{
				alert(emailMessage);
				complete=false;
				}
			
					else
					{
					complete=true;
					}
		}	

	return complete;
}


//This validates the contact form before being submitted.

function check_contact()
{
	var complete=true;
	var the_name=document.contact.first_Name.value;
	var the_lastname=document.contact.last_Name.value
	var the_email=document.contact.email.value;
	var the_message=document.contact.message.value;

if ((the_name=="")||(the_name==null)||(the_lastname=="")||(the_lastname==null)||(the_email=="")||(the_email==null)||(the_message=="")||(the_message==null))
		{
		alert(completeMessage);
		complete=false;
		}
		
		else
		{
				if ((the_email.indexOf("@")==-1) || (the_email.indexOf(".")==-1))
				{
				alert(emailMessage);
				complete=false;
				}
			
					else
					{
					complete=true;
					}
		}
return complete;

}
