function validation()
{
	//Validation For Name(Check for Blank Name)
	if(document.frm.name.value=="")
	{
		alert("Please enter the name");
		
		document.frm.name.focus();
		return false;
	}
	//(Check for Charectors only Name)
	var chk = Ischar(document.frm.name.value)
	if(chk == false)
	{
		alert("Please use characters only");
		document.frm.name.focus();
		return false;
	}
	//end of validation
	//***************************************
	//Validation for Valid EMail(Check for blank email)
	if(document.frm.email.value=="")
	{
		alert("Please enter the email");
		
		document.frm.email.focus();
		return false;
	}
	//check for validation
	if(!(document.frm.email.value == ""))
    {//(check for '@' symbol)
		if(document.frm.email.value.indexOf("@") == -1)
    	{
     		alert("Please enter valid email");
			
      		document.frm.email.focus();
      		return false;
   		}
    	//(check '.' symbol)
    	if(document.frm.email.value.indexOf(".") == -1)
    	{
			alert("Please enter valid email");
			document.frm.email.focus();
			return false;
   		 }
	}
	//end of validation
	
	//***************************************
	//*******************************************************
	
	if(document.frm.company.value=="")
	{
		alert("Please enter company name");
		
		document.frm.company.focus();
		return false;
	}
	//***********************************
	//*******************************************************
	//Validation for Home Telephone
	if(document.frm.phone.value=="")
	{
		alert("Please enter telephone no.")
		
		document.frm.phone.focus();
		return false;
	}
	
	//(check for valid telephone no.)
	if ((!(document.frm.phone.value.length==10)) && (!(document.frm.phone.value.length==11))) 
    {
       alert("Length of telephone no. should  be upto 10-11 digit");
	   
       document.frm.phone.focus();
	   return false;
    } 
	
	//(check for Numeric value only)
	var chk = IsNumeric(document.frm.phone.value)
	if(chk == false)
	{
		alert("Telephone no. should be in numeric");
		
		document.frm.phone.focus();
		return false;
	} 
	if((document.frm.phone.value.indexOf("0")==0 ) && (document.frm.phone.value.indexOf("7")==1))
      {
	    alert("Please enter valid home telephone no.");
		document.frm.phone.focus();
	    return false;
       }
	//end of validation
	//*******************************************************
	if(document.frm.url.value=="")
	{
		alert("Please enter URL");
		
		document.frm.url.focus();
		return false;
	}
	//*******************************************************
	
	if(document.frm.query.value=="")
	{
		alert("Please enter message");
		
		document.frm.query.focus();
		return false;
	}
	//***********************************
	if(document.frm.security_code.value=="")
	{
		alert("Please enter security code");
		
		document.frm.security_code.focus();
		return false;
	}
	//***********************************************
return true;
}
//check for valid numerical strings
function IsNumeric(strString)
{
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;
   //  test strString consists of valid characters listed above
   for (j = 0; j < strString.length && blnResult == true; j++)
   {
     strChar = strString.charAt(j);
     if (strValidChars.indexOf(strChar) == -1)
     {
        blnResult = false;
     }
   }
   return blnResult;
}	
//check for valid charector strings
function Ischar(strString)
{
  var strValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
  var strChar;
  var blnResult = true;

  if (strString.length == 0) return false;
 //  test strString consists of valid characters listed above
  for (j = 0; j < strString.length && blnResult == true; j++)
  {
     strChar = strString.charAt(j);
     if (strValidChars.indexOf(strChar) == -1)
     {
        blnResult = false;
     }
  }
  return blnResult;
}
