// JavaScript Document
function register_form_check(){

	
	var i;
	if($('newsletter_name').value== "" )
	{

		$('newsletter_name').style.background = "#FCF7C4";
		$('newsletter_name').focus();
		i=false;
	}else{
		$('newsletter_name').style.background = "#fff";
	}
	
	if($('newsletter_email').value == "")
	{
		$('newsletter_email').style.background = "#FCF7C4";
		$('newsletter_email').focus();
		i=false;
	}else{
		$('newsletter_email').style.background = "#fff";
	}
	
	if(!isEmailAddr($('newsletter_email').value))
	{
		$('newsletter_email').style.background = "#FCF7C4";
		$('newsletter_email').focus();
		i=false;
	}else{
		$('newsletter_email').style.background = "#fff";
	}
	
	return i;

}


function quote_check()
{
	
//	if($('quote_name').value== "" || $('quote_company').value == "" || $('quote_email').value == "" || $('quote_ptype').value == "" || $('quote_description').value == "")
//	{
//		$('quote_name').style.background = "#FCF7C4";
//		$('quote_company').style.background = "#FCF7C4";
//		$('quote_email').style.background = "#FCF7C4";
//		$('quote_ptype').style.background = "#FCF7C4";
//		$('quote_description').style.background = "#FCF7C4";
//		$('quote_name').focus();
//		return false;
//	}
	var i;
	if($('quote_description').value == "")
	{
		$('quote_description').style.background = "#FCF7C4";
		$('quote_description').focus();

		i=false;
	}else{
		$('quote_description').style.background = "#fff";
	}
	
	
	if($('code').value == "")
	{
		$('code').style.background = "#FCF7C4";
		$('code').focus();

		i=false;
	}else{
		$('code').style.background = "#fff";
	}

	
	if($('quote_ptype').value == "")
	{


		$('quote_ptype').style.background = "#FCF7C4";
		$('quote_ptype').focus();

		i=false;
	}else{
		$('quote_ptype').style.background = "#fff";
	}
	
		
	if($('quote_email').value == "")
	{

		$('quote_email').style.background = "#FCF7C4";
		$('quote_email').focus();

		i=false;
	}else{
		$('quote_email').style.background = "#fff";
	}

	if(!isEmailAddr($('quote_email').value))
	{

		$('quote_email').style.background = "#FCF7C4";
		$('quote_email').focus();
		i=false;
	}else{
		$('quote_email').style.background = "#fff";
	}


	if($('quote_company').value == "")
	{

		$('quote_company').style.background = "#FCF7C4";
		$('quote_company').focus();
		i=false;
	}else{
		$('quote_company').style.background = "#fff";
	}
	
	if($('quote_name').value == "")
	{
		$('quote_name').style.background = "#FCF7C4";
		$('quote_name').focus();
		i=false;
	}else{
		$('quote_name').style.background = "#fff";
	}
	
	
	return i;

}
function isEmailAddr(email_address)
	{
	var result = false
	var theStr = new String(email_address)
	var index = theStr.indexOf("@");
	if (index > 0)
		{
			var pindex = theStr.indexOf(".",index);
			if ((pindex > index+1) && (theStr.length > pindex+1))
			result = true;
			}
			return result;
	}