function checktext(Contents)
{
  var checkOK = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.";
  var checkStr = Contents;
  var allValid = true;

  for (i = 0;  i < checkStr.length;  i++)
  {
	ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
	
      if (ch == checkOK.charAt(j))
        break;
    if (j == 54 )
    {
      allValid = false;
      break;
    }
  }

  if (!allValid)
  {
    return false;
  }
  else
  {
  return true;
  }
 }

//function for Email Validation using ValidRegular Expression
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.contactus.email.value;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      <!--alert('A valid e-mail address is required.\nPlease amend and retry');-->
      return false;
    } 
    return true; 
}

function mansoonvalidation()
{
	//alert('Hi');
	//Validation for First Name	
	if(document.contactus.fname.value=="")
	{
		alert("Please Enter Your Name!");
		document.contactus.fname.focus()
		return false;
	}
	else if(!checktext(document.contactus.fname.value))
	{
		alert("Please Enter only alphabets !")
		document.contactus.fname.select()
		return false;
	}
	 //////////Validation for email
  if(document.contactus.email.value=="")
			{
		alert("Please  enter your email");
		document.contactus.email.focus();
		return false;
			}
else if(!isValidEmail(document.contactus.email.value))
	    {
	    alert("Please enter valid Email");
		document.contactus.email.select()
		return false;
	    }     
		if(chkNumeric(document.getElementById("phone").value)==true)
				document.getElementById("phone").style.border="0px";
			else
			{
				alert("Please enter Valid Phone no.");
				document.getElementById("phone").focus();
				document.getElementById("phone").style.border="0px";
				temp = true;
				return false;
			}

	/*if (document.contactus.phone.value=="")
	{
		alert("Plz Enter Your Phone no")
		document.contactus.phone.focus();
		return false;
	}*/
	if (document.contactus.Gender.value=="")
	{
		alert("Plz Enter Your Gender")
		document.contactus.Gender.focus();
		return false;
	}
	//Validation for City
	if(document.contactus.Age.value=="")
	{
		alert("Please Select Your Age!");
		document.contactus.Age.focus()
		return false;
	}
	if (document.contactus.Treatment.value=="")
	{
		alert("Plz Select Your Treatment")
		document.contactus.Treatment.focus();
		return false;
	}
		if (document.contactus.Center.value=="")
	{
		alert("Plz Select Your Center")
		document.contactus.Center.focus();
		return false;
	}
		   
  
	
	//Validation for Telephone Number
	
	var myTelNo = document.getElementById('tel').value;
	if (!checkUKTelephone (myTelNo)) 
	{
		alert (telNumberErrors[telNumberErrorNo]);
		document.contactus.tel.select();
		return false;
    }
	if (document.contactus.comment.value=="")
	{
		alert("Plz Enter Some Comments")
		document.contactus.comment.focus();
		return false;
	}
	return true;

}
function chkNumeric(strString)
   //  check for valid numeric strings	
   {
   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;
   }
