function validate(theform)
{
     var i;
     var j=1;
     var k;
     var bn;
     var t;
     var r;
     var len;
     var VC = "0123456789";
     var IsNumber=true;
     var Char
	
if(theform.salute.value=="")
		{
			theform.salute.focus();
			alert("Please provide Title");
			return false;
		}
if(theform.f_name.value=="")
		{
			theform.f_name.focus();
			alert("Please provide First Name.");
			return false;
		}
if(theform.l_name.value=="")
		{
			theform.l_name.focus();
			alert("Please provide Last Name.");
			return false;
		}		
if(theform.add1.value=="")
		{
			theform.add1.focus();
			alert("Please provide Address1.");
			return false;
		}				
if(theform.add2.value=="")
		{
			theform.add2.focus();
			alert("Please provide Address2.");
			return false;
		}		
if(theform.city.value=="")
		{
			theform.city.focus();
			alert("Please provide City.");
			return false;
		}		
if(theform.postcode.value=="")
		{
			theform.postcode.focus();
			alert("Please provide Post Code.");
			return false;
		}										
if(theform.email.value=="")
		{
			theform.email.focus();
			alert("Please provide Email.");
			return false;	
		}
		
			if(theform.email.value != "")
	{	
		text1=theform.email.value;
	    len=theform.email.value.length;
       for(i=0;i<=len;i++)
            {
              if (text1.charAt(i)=='@')
                 {
                    k=1;
                 }
            }           
         
         if (k!=1)
           {
              theform.email.focus();
              theform.email.select();
              alert("Please Check Email Address");
              return false;
           }
        
        text1=theform.email.value;       
        len=theform.email.value.length;
            for(i=0; i<=len;i++)
               {
                 if (text1.charAt(i)=='.')
                   {
                     bn=1; 
                   } 
               }             
       
              if(bn!=1)
               {
                  theform.email.focus(); 
                  theform.email.select(); 
                  alert("Please check Email Address");
                  return false;
               }
if(theform.phone.value=="")
		{
			theform.phone.focus();
			theform.phone.select();
			alert("Please provide Phone No.");
			return false;
		}
if(isNaN(theform.phone.value))
{
theform.phone.focus();
alert("Phone : only numbers");
return false;
}
if(theform.product_type.value=="")
		{
			theform.product_type.focus();
			alert("Please provide Product Type");
			return false;
		}
if(theform.budget.value=="")
		{
			theform.budget.focus();
			alert("Please provide Budget");
			return false;
		}
		if(theform.timescale.value=="")
		{
			theform.timescale.focus();
			alert("Please provide Time Scale");
			return false;
		}
}
return true;
}


