// JavaScript Document

function clearFeedback()
{
document.frm.reset();
}

function clearFeedback_profile()
{
document.frm.reset();
}
function validation()
{
if(document.frm.name.value==0)
{
alert("Please enter your name")
document.frm.name.value="";
document.frm.name.focus();
return false;
}
if(document.frm.email.value==0)
{
alert("Please enter your e-mail address")
document.frm.email.value="";
document.frm.email.focus();
return false;
}


str=document.frm.email.value
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter your e-mail address in the format someone@example.com")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter your e-mail address in the format someone@example.com")
		   document.frm.email.value=""
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter your e-mail address in the format someone@example.com")
			document.frm.email.value=""
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter your e-mail address in the format someone@example.com")
			document.frm.email.value=""
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter your e-mail address in the format someone@example.com")
			document.frm.email.value=""
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter your e-mail address in the format someone@example.com")
			document.frm.email.value=""
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter your e-mail address in the format someone@example.com")
			document.frm.email.value=""
		    return false
		 }


if(document.frm.suggestion.value==0)
{
alert("Please enter suggestion")
document.frm.suggestion.value="";
document.frm.suggestion.focus();
return false;
}
return true;
}