// JavaScript Document

 
/*function changeCol(obj){
 obj.className='inputFocus';
 
}
function changeColBack(obj){
 obj.className='inputBlur';
}*/

function validateForm(contact)
{

	if(""==document.forms.quote.name.value)
	{
		alert("Please enter your name.");
		document.forms.quote.name.focus();
		return false;
	}
	else if(""==document.forms.quote.address.value)
	{
		alert("Please enter your address.");
		document.forms.quote.email.focus();
		return false;
	}
	else if(""==document.forms.quote.postcode.value)
	{
		alert("Please enter your postcode.");
		document.forms.quote.email.focus();
		return false;
	}
	else if(""==document.forms.quote.email.value)
	{
		alert("Please enter your email address.");
		document.forms.quote.email.focus();
		return false;
	}
	else if (echeck(document.forms.quote.email.value) == false){
		alert("The email address entered was not valid");
		document.forms.quote.email.focus();	
		return false;
	}
	else 
	{
		//alert("Your message has been sent");
		/*document.forms.contact.email.value = "";
		document.forms.contact.name.value ="";
		document.forms.contact.message.value = "";*/
		return true;
	}

}

function clearForm(){
	alert("Form Cleared");
	document.forms.quote.email.value = "";
	document.forms.quote.name.value ="";
	document.forms.quote.message.value = "";
}

<!-- -->
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

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(){
	var emailID=document.frmSample.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		//alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }