var error;
var error_a;
var error_r;
var error_e;
var error_v;
var errormsg;

function reset()
{
 error_a=false;
 error_r=false;
 error_e=false;
 error_v=false;
 errormsg='Please enter the following information :\n_____________________________\n\n';
}
//*************************************************************************
//  Check to make sure Name is filled in.
//*************************************************************************
function validate_name()
{
  if (mainform.name.value == "")
  {
   errormsg+='Your Name\n';
   error_a=true;
   }
}
//*************************************************************************
//  Check to make sure Email is filled in.  
//*************************************************************************
function validate_email()
{
  if (mainform.email.value == "")
  {
   errormsg+='Your Email Address\n';
   error_r=true;
   }
}
//*************************************************************************
//  Check to make sure enjoysite radio button is selected. 
//  If No, make sure reason is specified in the text box
//*************************************************************************
function validate_topic()
{
  if (mainform.topic.options[0].selected)
  {
   errormsg+='A Topic\n';
   error_e=true;
   }
}
//*************************************************************************
//  Check to make sure visit again dropdown box is selected.
//*************************************************************************
function validate_comments()
{
  if (mainform.comments.value == "")
  {
   errormsg+='Your Comments\n';
   error_v=true;
   }
}
//*************************************************************************
//  Begin Validation
//*************************************************************************
function validate() 
{
reset();
validate_name();
validate_email();
validate_topic();
validate_comments();

 if(error_a||error_r||error_e||error_v)
 	{
  	error=true;
 	}
 else
 	{
 	 error=false;
 	}
 if(!error)
 	{
  	document.main.submit();
 	}
 else
 	{
  	alert(errormsg);
	event.returnValue=false;
 	}
}