function trim(str) 
			{
			  return str.replace(/^\s*|\s*$/g,"");
			}

function validate_form()
	{
	if(document.feedform.fname.value=='')
		{
		alert("Please Enter The Firstname")
		document.feedform.fname.focus();
		return false;
		}
		
		email = trim(document.feedform.email.value);
			 
    		if (email.length == 0)
				{
      			alert ("Please Enter the Email Id");
      			document.feedform.email.focus();
      			return false;
  				}

  			
			
			if (echeck(email)==false)
			 {
   			 document.feedform.email.value="";
    		 document.feedform.email.focus();
   			 return false
  			 }
  			
		
		
		
	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 e-mail id")
     			return false
  			}
  			
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
			{
     			alert("Invalid e-mail id")
     			return false
  			}
			
  			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
			{
      			alert("Invalid e-mail id")
     			return false
  			}

  			if (str.indexOf(at,(lat+1))!=-1)
			{
      			alert("Invalid e-mail id")
				return false
  			}

  			if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
			{
      			alert("Invalid e-mail id")
      			return false
  			}

  			if (str.indexOf(dot,(lat+2))==-1)
			{
      			alert("Invalid e-mail id")
      			return false
  			}
  
  			if (str.indexOf(" ")!=-1)
			{
      			alert("Invalid e-mail id")
      			return false
  			}

  		return true
	}

		
		
		
		
		
		
	if(document.feedform.city.value=='')
		{
		alert("Please Enter The City")
		document.feedform.city.focus();
		return false;
		}
			
	if(document.feedform.comments.value=='')
		{
		alert("Please Enter Your Comments")
		document.feedform.comments.focus();
		return false;
		}	
		
		 
	
	
	return true;
	}




