
function verifyForm(aamir)
{

	var name=aamir.name.value;
	var contact_phone=aamir.contact_phone.value;
	var indexemail=aamir.indexemail.value;
	var comments=aamir.comments.value;
	var how_hear=aamir.how_hear.value;

	var errs=0;
	var errMsg="";


	if(name=="")
	{
		errs+=1;	
		errMsg+="- Please enter your Name\n";
	}
	if(contact_phone=="")
	{
		errs+=1;	
		errMsg+="- Please enter your Phone Number\n";
	}
	if(indexemail=="")
	{
		errs+=1;	
		errMsg+="- Please enter your Email Address\n";
	}	
	if(comments=="")
	{
		errs+=1;	
		errMsg+="- Please enter your Comments\n";
	}
	if(how_hear=="")
	{
		errs+=1;		
		errMsg+="- How did you hear about us\n";
	}

	// If there is even a single error, alert the user
	if(errs>0)
	{
		alert(errMsg);
		return false;	
	}

		
	Position=(aamir.indexemail.value).indexOf("@",1);
	if(Position==-1) // If no @ found
	{
	 	alert("Invalid email address. There should be atleast one \'@\' in the email address");
	 	aamir.indexemail.value="";
	 	aamir.indexemail.focus();
	 	return false;
	}
	
	// Make sure there is only only one @ sign by adding the result we got to one and
	// comparing with -1. It true the answer will not be -1, else it will be.
	else if((aamir.indexemail.value).indexOf("@",Position+1)!=-1)
	{
		alert("Invalid Email address. There should be only one \'@\' in the email address");
	 	aamir.indexemail.value="";
	 	aamir.indexemail.focus();
		return false;
	}
	
	Period=(aamir.indexemail.value).indexOf(".",1);
	if(Period==-1)
	{
	 	alert("Invalid email address, please modify and try again");
	 	aamir.indexemail.focus();
		return false;
	}	
		
	
return true;

}
