// JavaScript Document

function validate(theForm)
{
	noerrors = true;
	missings = "\n"; //<FORMNAME>.<INPUTNAME>.VALUE == "" or <FORMNAME>.<INPUTNAME>.VALUE.LENGHT < 6
	if(theForm.fname.value == "")
 	{
    	alert ("Please supply your name");
		theForm.fname.focus();
      	return (false);
  	}
	if(theForm.email.value == "")
 	{
    	alert ("Please supply your e-mail address");
		theForm.email.focus();
      	return (false);
  	}
	/* if (theForm.phone.value != "")
  	{
    	if(isNaN(theForm.phone.value))
		{
			alert ("Please supply numeric phone number");
			theForm.phone.focus();
			return (false);
		}
  	} */
	
	apos=theForm.email.value.indexOf("@");
	dotpos=theForm.email.value.lastIndexOf(".");
	lastpos=theForm.email.value.length-1;
	if (apos < 1 || dotpos - apos < 2 || lastpos - dotpos > 3 || lastpos - dotpos < 2)
	{
		alert ("Please supply valid e-mail address");
		theForm.email.select();
      	return (false);
	}
	if (theForm.comments.value == "")
	{
		alert ("Please drop your comments");
		theForm.comments.focus();
      	return (false);
	}
	if (noerrors == true)
	{
		return (true);
	}
	else
	{
		message = "Please enter the fields marked by an asterix!";
		alert (message);
		return (false);
	}
}




