

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 (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
  }



function Check_Null()
	{
	
	if (document.frmname.txtname.value == "")  	
	   {
	     alert("Name Cannot be Empty")
	     document.frmname.txtname.focus()
	     return false
	      document.location.href="web-design-quote.php"
	    }
	/* if (document.frmname.txtemail.value == "")  	
	   {
	     alert("Email Cannot be Empty")
	     document.frmname.txtemail.focus()
	     return false
	      document.location.href="web-design-quote.php"
	    }	    
	  */
	if (document.layers||document.getElementById||document.all)
	{
		var str=document.frmname.txtemail.value
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (filter.test(str)==false)
		{
			alert("Please input a valid email address!")
			document.frmname.txtemail.value=""
			document.frmname.txtemail.focus()
			return false
		}
	} 
	  
	  if (document.frmname.txtphone.value.length == 0) 
      {
    	  alert("Please enter a value.");
    	  document.frmname.txtphone.focus();
    	  return false;
      }
      
      if (IsNumeric(document.frmname.txtphone.value) == false) 
      {
	      alert("Please check - Enter only numeric value!");
	      document.frmname.txtphone.focus();
	      return false;
      }	    
	    
	  if (document.frmname.txtpage.value.length == 0) 
      {
	     alert("Please enter a value.");
    	 document.frmname.txtpage.focus();
	     return false;
      } 
   
	 if (IsNumeric(document.frmname.txtpage.value) == false) 
     {
	      alert("Please check - Enter only numeric value!");
	      document.frmname.txtpage.focus();
	      return false;
     }	    
	    
	 if (document.frmname.txtquery.value == "")  	
	 {
	     alert("Query Cannot be Empty")
	     document.frmname.txtquery.focus()
	     return false
	     document.location.href="web-design-quote.php"
	 }
	    
	  if (document.frmname.txtcode.value != document.frmname.imagetext.value)  	
	   {
	     alert("Verification Code does not match")
	     document.frmname.txtcode.focus()
	     return false
	      document.location.href="web-design-quote.php"
	    }	    
	 }
