

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
 	 		document.getElementById("sbmt").disabled=true;
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	 		document.getElementById("sbmt").disabled=true;
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
 	 		document.getElementById("sbmt").disabled=true;
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
 	 		document.getElementById("sbmt").disabled=true;
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
  	 		document.getElementById("sbmt").disabled=true;
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
 	 		document.getElementById("sbmt").disabled=true;
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
	 		document.getElementById("sbmt").disabled=true;
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){

	var emailID=document.feedback.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		document.getElementById("sbmt").disabled=true;
		alert("Please Enter your Email ID")
		emailID.focus()		
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
		
			function showSubMenu(valu,valu1)
			{
				if(document.getElementById(valu).style.display=="none" || document.getElementById(valu).style.display==" " || document.getElementById(valu).style.display=="")									
					document.getElementById(valu).style.display="block";			
				else
					document.getElementById(valu).style.display="none";				
			}
			function enblsubmit()
			{
			
				var lname=document.getElementById("fname").value;
				var fname=document.getElementById("lname").value;
				var email=document.getElementById("email").value;
				var phone=document.getElementById("phone").value;
				if ((fname=="") || (lname=="") || (email=="") || (phone==""))
				{			
					document.getElementById("sbmt").disabled=true;
				}
				else
					document.getElementById("sbmt").disabled=false;
			}

 function validateInt()
   {

      var o = document.feedback.phone;

      switch (isInteger(o.value))
      {
         case true:            
		 {
 			document.getElementById("sbmt").disabled=false;
            break;
		}
         case false:
		 {
            alert("Phone Number is not valid");
			document.getElementById("sbmt").disabled=true;
		}
      }
   }
     function isInteger (s)
   {
      var i;

      if (isEmpty(s))
      if (isInteger.arguments.length == 1) return 0;
      else return (isInteger.arguments[1] == true);

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return false;
      }

      return true;
   }
    function isEmpty(s)
   {
      return ((s == null) || (s.length == 0))
   }

   function isDigit (c)
   {
      return ((c >= "0") && (c <= "9"))
   }

