	function validatfield(){
	//alert('test');
	var anum=/(^\d+$)|(^\d+\.\d+$)/ ;
	
	if(document.quotefrm.client_name.value==''){
		alert('Please enter your name');
		document.quotefrm.client_name.focus();
		return false;
	}
	if(document.quotefrm.client_email.value==''){
		alert('Please enter your E-mail');
		document.quotefrm.client_email.focus();
		return false;
	}
	
	if (echeck(document.quotefrm.client_email.value)==false){
		alert('Please enter valid E-mail');
		document.quotefrm.client_email.focus();
		return false;
	}

	
	if(document.quotefrm.client_phone.value==''){
		alert('Please enter your Phone Number');
		document.quotefrm.client_phone.focus();
		return false;
	}
	if(!anum.test(document.quotefrm.client_phone.value)){
		alert('Please enter numeric number');
		document.quotefrm.client_phone.focus();
		return false;
	}
	
	
	//alert(document.quotefrm.enquiry_checkbox.length);
	
	var chkCount=countChecks();
	//alert(chkCount);
	if(chkCount <=0){
		alert('Please select at least one service');
		return false;
	}
	if(document.quotefrm.security_code.value==''){
		alert('Please enter security code');
		document.quotefrm.security_code.focus();
		return false;
	}
	if(document.quotefrm.security_code.value!=document.quotefrm.autoval.value){
		alert('Please enter correct security code');
		document.quotefrm.security_code.focus();
		return false;
	}
	
	if(document.quotefrm.projtittle.value==''){
		alert('Please specify your project name');
		document.quotefrm.projtittle.focus();
		return false;
	}
	
	if(document.quotefrm.projectDescription.value==''){
		alert('Please enter project description');
		document.quotefrm.projectDescription.focus();
		return false;
	}
	if(document.quotefrm.prjectStartDate.value==''){
		alert('Please enter tentative start date of project');
		document.quotefrm.prjectStartDate.focus();
		return false;
	}

else{

return true;

}
}

/**
 * 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){
		    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){
		   // 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 to check total number of CheckBoxes 
//that are checked in a form
function countChecks() 
{
	 
    //initialize total count to zero
    var totalChecked = 0;
    //get total number of CheckBoxes in form
	
	
	var chkBoxCount = document.getElementsByName('enquiry_checkbox[]');
	 //loop through each CheckBox
    for (var i = 0; i < chkBoxCount.length; i++) 
    {
        if(chkBoxCount[i].checked==true) 
        {
			totalChecked += 1;
        }
    }
    //return the number of checked
    return totalChecked
}




