// JavaScript Document
function contact_check()
{
	with(window.document.contactus)
  		{
		if(enquiry_about.selectedIndex==0)
         {
         alert("Please select any one.");
         enquiry_about.focus();
         return false;
         }
         if(comments.value=="")
		 	{
			 alert("Please enter Comment!");
			 comments.focus();
			 return false;
			}
   		 if(name.value=="")
		 	{
			 alert("Please enter name!");
			 name.focus();
			 return false;
			}
		if(address.value=="")
		 	{
			 alert("Please enter address!");
			 address.focus();
			 return false;
			}		
		if(email.value=="")
		 	{
			 alert("Please enter Email Id!");
			 email.focus();
			 return false;
			}
	var checkEmail = "@.";
	var checkStr = email.value;
	var EmailValid = false;0000000000
	var EmailAt = false;
	var EmailPeriod = false;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
				for (j = 0;  j < checkEmail.length;  j++)
				{
					if (ch == checkEmail.charAt(j) && ch == "@")
						EmailAt = true;
					if (ch == checkEmail.charAt(j) && ch == ".")
						EmailPeriod = true;
		  			if (EmailAt && EmailPeriod)
				break;
      	  		if (j == checkEmail.length)
				break;
			}
 
				// if both the @ and . were in the string
				if (EmailAt && EmailPeriod)
				{
					EmailValid = true
					break;
				}
		}
			
			if (!EmailValid)
				{
					alert("Invalid Email Id ! Please Enter Your valid Email Id.");
					email.value="";
				    email.focus();
					return(false);
				}			
		if(telephone.value=="")
		 	{
			 alert("Please enter telephone no.!");
			 telephone.focus();
			 return false;
			}		
  		}
}

function isInteger(s)
{
      var i;
	s = s.toString();
      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);
         if (isNaN(c)) 
	   {
		alert("Invalid Contact No !");
		return false;
	   }
      }
      return true;
     }
	function isInteger1(s)
    {
      var i;
	  s = s.toString();
      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);
         if (isNaN(c)) 
	   {
		alert("Invalid Zipcode !");
		return false;
	   }
      }
      return true;
      }


