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){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	
	    if ( document.form1.user.value != "" )
    {
		document.form1.user.style.borderColor='#ab935b';
    }
	else{		document.form1.user.style.borderColor='#f23496';}
	
		    if ( document.form1.company.value != "" )
    {
		document.form1.company.style.borderColor='#ab935b';
    }
		else{		document.form1.company.style.borderColor='#f23496';}
	
		 
	
		    if ( document.form1.subject.value != "" )
    {
		document.form1.subject.style.borderColor='#ab935b';
    }
		else{		document.form1.subject.style.borderColor='#f23496';}
		
		  if ( document.form1.message.value != "" )
    {
		document.form1.message.style.borderColor='#ab935b';
    }
		else{		document.form1.message.style.borderColor='#f23496';}
		
		  if ( document.form1.howfind.value != "" )
    {
		document.form1.howfind.style.borderColor='#ab935b';
    }
		else{		document.form1.howfind.style.borderColor='#f23496';}
	
	   if ( document.form1.email.value != ""  && echeck(document.form1.email.value)!= false)
    {
		document.form1.email.style.borderColor='#ab935b';
	
    }
	else{		document.form1.email.style.borderColor='#f23496';
				var InvalidEmail = true;
	}
	
			

			  if ( document.form1.user.value == "" || document.form1.company.value == "" || document.form1.howfind.value == "" || document.form1.email.value == "" || document.form1.subject.value == "" || document.form1.message.value == "" || InvalidEmail == true )
    {
            return false
    }
	
	return true
 }