function validate_form()
{
	if(customer_name() && customer_number() && customer_message()) 
		return true;
	else
		return false;/**/
}

function customer_number()
{
	var obj = document.contact_form.customer_number;
	if(obj.value != "" && !(isNaN(obj.value)))
	{
		obj.style.background = '#FFFFFF' ;
		return true;
	}
	else
	{
		obj.style.background = '#FF9999' ;
		obj.focus();
		return false;
	}
}

function customer_name()
{
	var obj = document.contact_form.customer_name;
	if(obj.value != "")
	{
		obj.style.background = '#FFFFFF' ;
		return true;
	}
	else
	{
		obj.style.background = '#FF9999' ;
		obj.focus();
		return false;
	}
}

function customer_email()
{
	var obj = document.contact_form.customer_email;	
	if(obj.value != "" && echeck(obj.value))
	{
		obj.style.background = '#FFFFFF' ;
		return true;
	}
	else{
	
		obj.style.background = '#FF9999' ;
		obj.focus();
		return false;
	}
}

function customer_message(){

	var obj = document.contact_form.customer_message;
	if(obj.value != "")
	{	
		obj.style.background = '#FFFFFF' ;
		return true;
	}
	else{
	
		obj.style.background = '#FF9999' ;
		obj.focus();
		return false;
	}
}

function customer_company(){

	var obj = document.contact_form.customer_company;
	if(obj.value != "")
	{	
		obj.style.background = '#FFFFFF' ;
		return true;
	}
	else{
	
		obj.style.background = '#FF9999' ;
		obj.focus();
		return false;
	}
}


function customer_subject(){

	var obj = document.contact_form.customer_subject;
	if(obj.value != "")
	{	
		obj.style.background = '#FFFFFF' ;
		return true;
	}
	else{
	
		obj.style.background = '#FF9999' ;
		obj.focus();
		return false;
	}
}

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					
	}
