function submit_subscribe_form()
{
	the_frm = document.subscribe_form
	emailID = the_frm.email
	error_msg = ""

	if ((emailID.value==null)||(emailID.value==""))
		error_msg += "\n\r- Your Email Address"
	else if (echeck(emailID.value)==false)
		error_msg += "\n\r- A correctly formatted Email Address"
	
	if(error_msg)
		alert("Please specify:"+error_msg)
	else
		the_frm.submit()
}


function submit_quick_quote()
{
	the_frm = document.quick_quote_form
	emailID = the_frm.email
	error_msg = ""
	
	if (the_frm.Name.value=="")
		error_msg += "\n\r- Your Name"
		
	if (the_frm.Phone.value=="")
		error_msg += "\n\r- Your Phone Number"

	if ((emailID.value==null)||(emailID.value==""))
		error_msg += "\n\r- Your Email Address"
	else if (echeck(emailID.value)==false)
		error_msg += "\n\r- A correctly formatted Email Address"
	
	if(error_msg)
		alert("Please specify:"+error_msg)
	else
		the_frm.submit()
}

function submit_employment_form()
{
	the_frm = document.employment_form
	emailID = the_frm.email
	error_msg = ""
	
	if (the_frm.name.value=="")
		error_msg += "\n\r- Your Name"

	if ((emailID.value==null)||(emailID.value==""))
		error_msg += "\n\r- Your Email Address"
	else if (echeck(emailID.value)==false)
		error_msg += "\n\r- A correctly formatted Email Address"
	
	if(error_msg)
		alert("Please specify:"+error_msg)
	else
		the_frm.submit()
}


function echeck(str) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(at)==-1)
	   return false

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	   return false

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		return false

	 if (str.indexOf(at,(lat+1))!=-1)
		return false

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		return false

	 if (str.indexOf(dot,(lat+2))==-1)
		return false

	 if (str.indexOf(" ")!=-1)
		return false
		
	 return true					
}


