function validate(thisform)
{
	if(thisform.txtName.value == '')	
		{
			alert("Woops! You forgot to fill in your Name");
			thisform.txtName.focus();
			return false;
		}
	if(thisform.txtEmail.value == '')	
		{
			alert("Woops! You forgot to fill in your Email");
			thisform.txtEmail.focus();
			return false;
		}
	if(validate_email(thisform.txtEmail,"Woops! You have entered an invalid Email Address")==false)
		{
			thisform.txtEmail.select();
			thisform.txtEmail.focus();
			return false;
		}

	if(thisform.txtPhone.value == '')	
		{
			alert("Woops! You forgot to fill in your Phone");
			thisform.txtPhone.focus();
			return false;
		}
		
	if(IsNumeric(thisform.txtPhone.value)==false)
		{
			alert("Woops! You have entered an invalid Phone Number");
			thisform.txtPhone.select();
			thisform.txtPhone.focus();
			return false;
		}
	
	if(thisform.txtComments.value == '')	
		{
			alert("Woops! You forgot to fill in your Comments");
			thisform.txtComments.focus();
			return false;
		}	
	thisform.submit();
	return true;
}

function validate_contactus(thisform)
{
	if(thisform.txtName.value == '')	
		{
			alert("Woops! You forgot to fill in your Name");
			thisform.txtName.focus();
			return false;
		}
	if(thisform.txtEmail.value == '')	
		{
			alert("Woops! You forgot to fill in your Email");
			thisform.txtEmail.focus();
			return false;
		}
	if(validate_email(thisform.txtEmail,"Woops! You have entered an invalid Email Address")==false)
		{
			thisform.txtEmail.select();
			thisform.txtEmail.focus();
			return false;
		}

	if(thisform.txtAddress.value == '')	
		{
			alert("Woops! You forgot to fill in your Address");
			thisform.txtAddress.focus();
			return false;
		}
	
	if(thisform.txtPhone.value == '')	
		{
			alert("Woops! You forgot to fill in your Phone");
			thisform.txtPhone.focus();
			return false;
		}
	if(IsNumeric(thisform.txtPhone.value)==false)
		{
			alert("Woops! You have entered an invalid Phone Number");
			thisform.txtPhone.select();
			thisform.txtPhone.focus();
			return false;
		}
		
	if(thisform.txtFax.value == '')	
		{
			alert("Woops! You forgot to fill in your Fax");
			thisform.txtFax.focus();
			return false;
		}
	
	if(IsNumeric(thisform.txtFax.value)==false)
		{
			alert("Woops! You have entered an invalid Fax Number");
			thisform.txtFax.select();
			thisform.txtFax.focus();
			return false;
		}
		
		
	if(thisform.txtComments.value == '')	
		{
			alert("Woops! You forgot to fill in your Comments");
			thisform.txtComments.focus();
			return false;
		}	
	thisform.submit();
	return true;
}

function validate_consultation(thisform)
{
	if(thisform.txtName.value == '')	
		{
			alert("Woops! You forgot to fill in your Name");
			thisform.txtName.focus();
			return false;
		}
	
	if(thisform.txtAddress.value == '')	
		{
			alert("Woops! You forgot to fill in your Address");
			thisform.txtAddress.focus();
			return false;
		}
		
	if(thisform.txtEmail.value == '')	
		{
			alert("Woops! You forgot to fill in your Email");
			thisform.txtEmail.focus();
			return false;
		}
	if(validate_email(thisform.txtEmail,"Woops! You have entered an invalid Email Address")==false)
		{
			thisform.txtEmail.select();
			thisform.txtEmail.focus();
			return false;
		}

	if(thisform.txtPhone.value == '')	
		{
			alert("Woops! You forgot to fill in your Phone");
			thisform.txtPhone.focus();
			return false;
		}
		
	if(IsNumeric(thisform.txtPhone.value)==false)
		{
			alert("Woops! You have entered an invalid Phone Number");
			thisform.txtPhone.select();
			thisform.txtPhone.focus();
			return false;
		}	
	
	if(thisform.txtFax.value == '')	
		{
			alert("Woops! You forgot to fill in your Fax");
			thisform.txtFax.focus();
			return false;
		}
		
	if(IsNumeric(thisform.txtFax.value)==false)
		{
			alert("Woops! You have entered an invalid Fax Number");
			thisform.txtFax.select();
			thisform.txtFax.focus();
			return false;
		}
	
	if(thisform.txtAge.value == '')	
		{
			alert("Woops! You forgot to fill in your Age");
			thisform.txtAge.focus();
			return false;
		}	
		
	if(thisform.txtComplaint.value == '')	
		{
			alert("Woops! You forgot to fill in your Present Complaint");
			thisform.txtComplaint.focus();
			return false;
		}
		
	if(thisform.txtComments.value == '')	
		{
			alert("Woops! You forgot to fill in your Comments");
			thisform.txtComments.focus();
			return false;
		}
			
	thisform.submit();
	return true;
}

function validate_email(entered,alertbox) {

   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = entered.value;
   if(reg.test(address) == false) {
     if (alertbox!="") alert(alertbox,entered);
      return false;
   }
}

function IsNumeric(strString)
{
   var strValidChars = "0123456789-(). ";
   var strChar;
   var blnResult = true;
   if (strString.length == 0) return false;

   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         	{
        	 blnResult = false;
         	}
      }
   return blnResult;
}

 function checkIt(evt) {
		evt = (evt) ? evt : window.event
		var charCode = (evt.which) ? evt.which : evt.keyCode
		if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode!=8 && charCode!=37 && charCode!=39 && charCode!=46) {
			status = "This field accepts numbers only."
			return false
		}
		status = ""
		return true
	}





