
function validation(){ /*validate form*/
	{
	var n = document.frmMain.f_name.value; /*validate first name textbox*/
	var l = document.frmMain.l_name.value; /*validate last name textbox*/
	var t = document.frmMain.titl.value; /*validate title textbox*/
	var c = document.frmMain.com_name.value; /*validate company name textbox*/
	var ba = document.frmMain.bus_mail_address.value; /*validate business address textbox*/
	var bc = document.frmMain.bus_cy.value; /*validate business address textbox*/
	var bs = document.frmMain.bus_st.value; /*validate business address textbox*/
	var bz = document.frmMain.bus_zip.value; /*validate business address textbox*/
	var wk = document.frmMain.wk_phone.value; /*validate work phone textbox*/	
	var txt = document.frmMain.email.value;/*validate email*/
	var ha = document.frmMain.home_address.value; /*validate home address textbox*/
	var hc = document.frmMain.home_cy.value; /*validate home city, state, zip textbox*/
	var hs = document.frmMain.home_st.value; /*validate home city, state, zip textbox*/
	var hz = document.frmMain.home_zip.value; /*validate home city, state, zip textbox*/
	var hp = document.frmMain.home_phone.value; /*validate home phone textbox*/
	var p = document.frmMain.preferred.selectedIndex; /*validate preferred select*/
	var s = document.frmMain.specialty.value; /*validate specialty textbox*/
	var m = document.frmMain.member.selectedIndex; /*validate membership select*/
	var cat = document.frmMain.category.selectedIndex; /*validate category select*/
	

	
		{
		if (n.length == "")
		{
			alert("Please enter your first name");
			document.frmMain.f_name.focus()
			document.frmMain.f_name.select()
			return false;
		}
		
		{
		if (l.length == "")
		{
			alert("Please enter your last name");
			document.frmMain.l_name.focus()
			document.frmMain.l_name.select()
			return false;
		}
		
		{
		if (t.length == "")
		{
			alert("Please enter your title");
			document.frmMain.titl.focus()
			document.frmMain.titl.select()
			return false;
		}
		
		{
		if (c.length == "")
		{
			alert("Please enter a company name");
			document.frmMain.com_name.focus()
			document.frmMain.com_name.select()
			return false;
		}
		
		{
		if (ba.length == "")
		{
			alert("Please enter a business mailing address");
			document.frmMain.bus_mail_address.focus()
			document.frmMain.bus_mail_address.select()
			return false;
		}
		
		{
		if (bc.length == "")
		{
			alert("Please enter a business city");
			document.frmMain.bus_cy.focus()
			document.frmMain.bus_cy.select()
			return false;
		}
		
		{
		if (bs.length == "")
		{
			alert("Please enter a business state");
			document.frmMain.bus_st.focus()
			document.frmMain.bus_st.select()
			return false;
		}
		
		{
		if (bz.length == "")
		{
			alert("Please enter a business zip");
			document.frmMain.bus_zip.focus()
			document.frmMain.bus_zip.select()
			return false;
		}
		
		{
		if (wk.length == 0)
		{
			alert("Please enter a work phone number");
			document.frmMain.wk_phone.focus()
			document.frmMain.wk_phone.select()
			return false;
		}
		
		{
		if(wk.length < 10 || wk.length > 15)
		{
        	alert("Please enter the correct phone number with area code");
			document.frmMain.wk_phone.focus()
			document.frmMain.wk_phone.select()
        	return false;
		}
		
		{
		if(txt.length == 0)
		{
			alert("Please enter an email address")
			document.frmMain.email.focus()
			document.frmMain.email.select()
			return false;
		}
		
		{
		if(txt.indexOf(" ")!=-1)
		{
		alert("Email address cannot contain spaces!");
		document.frmMain.email.focus()
		document.frmMain.email.select()
		return false;
	}
	
	{
	if(txt.indexOf("@")==-1)
	{
		alert("Email address is incorrect! Please make sure you are using the @ symbol.");
		document.frmMain.email.focus()
		document.frmMain.email.select()
		return false;
	}
	
	{
	if(txt.indexOf("@")<1)
	{
		alert("Email address is incorrect! Please check the part before @");
		document.frmMain.email.focus()
		document.frmMain.email.select()
		return false;
	}
	
		{
		if (ha.length == "")
		{
			alert("Please enter a home mailing address");
			document.frmMain.home_address.focus()
			document.frmMain.home_address.select()
			return false;
		}
		
		{
		if (hc.length == "")
		{
			alert("Please enter a home city");
			document.frmMain.home_cy.focus()
			document.frmMain.home_cy.select()
			return false;
		}
		
		{
		if (hs.length == "")
		{
			alert("Please enter a home state");
			document.frmMain.home_st.focus()
			document.frmMain.home_st.select()
			return false;
		}
		
		{
		if (hz.length == "")
		{
			alert("Please enter a home zip code");
			document.frmMain.home_zip.focus()
			document.frmMain.home_zip.select()
			return false;
		}
						
		{
		if (hp.length == 0)
		{
			alert("Please enter your phone number");
			document.frmMain.home_phone.focus()
			document.frmMain.home_phone.select()
			return false;
		}
		
		{
		if(hp.length < 10 || hp.length > 15)
		{
        	alert("Please enter the correct phone number with area code");
			document.frmMain.home_phone.focus()
			document.frmMain.home_phone.select()
        	return false;
		}
					
		{
        if ( 1 > p)
		{
			alert("Please select a preferred mailing address");
			document.frmMain.preferred.focus()
			return false;
		}
			
		{
		if(s.length == "")
		{
			alert("Please enter your specialty name")
			document.frmMain.specialty.focus()
			document.frmMain.specialty.select()
			return false;
		}
		
		{
        if ( 1 > m)
		{
			alert("Please select whether you are a member of MGMA");
			document.frmMain.preferred.focus()
			return false;
		}
		
		{
        if ( 1 > cat)
		{
			alert("Please select a category");
			document.frmMain.category.focus()
			return false;
		}
		else
		{
		return true;
		}
	
}
}
}
}
}
}
}
}
}
}}}}}}}}}}}}}}}}}

