// JavaScript Document
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){
		   alert("Invalid email address.")
		   //document.getElementById('email').style.display = 'block';
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			alert("Invalid email address.")
			//document.getElementById('email').style.display = 'block';
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid email address.")
			//document.getElementById('email').style.display = 'block';
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid email address.")
			//document.getElementById('email').style.display = 'block';
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid email address.")
			//document.getElementById('email').style.display = 'block';
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid email address.")
			//document.getElementById('email').style.display = 'block';
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		     alert("Invalid email address.")
			//document.getElementById('email').style.display = 'block';
		    return false
		 }

 		 return true					
	}

function ValidateForm(form){
	var emailID=document.form2.email
	
	if (document.form2.from.value == ""){
		  alert("Please enter your full name.")
		  //document.getElementById('name').style.display = 'block';
		  document.form2.from.focus()
		  return false
		}
	
	  
	  
	if ((emailID.value==null)||(emailID.value=="")){
		//alert("Please Enter your Email address")
		//document.getElementById('email').style.display = 'block';
		alert("Please enter valid email address.")
		emailID.focus()
		return false
		}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
		}
  
  
	 if (document.form2.suggestion.value == ""){
	    alert("Please type in your suggestion.")
	    //document.getElementById('suggestion').style.display = 'block';
		document.form2.suggestion.focus()
		return false
		}

return true
}
 
function clearAll(form){
	 document.form2.name.value == "";
	 document.form2.email.value == "";
	 document.form2.suggestion.value == "";
	 /*document.getElementById('name').style.display = 'none';
	 document.getElementById('email').style.display = 'none';
	 document.getElementById('suggestion').style.display = 'none';*/
 }