<!--

var message;
var fieldtofocus;

function newsletter_validator(form)  
  { var passed=true;
  fieldtofocus="";
  
  message="Please check that you have completed the following fields correctly: \n"
  
  if(form.firstname.value=="")
    {message +="--First Name\n";
	 passed=false;
	 fieldtofocus=form.firstname;
	 if (fieldtofocus==""){fieldtofocus=form.firstname}
	}
	
  if(form.lastname.value=="")
    {message +="--Last Name\n";
	 passed=false;
	 fieldtofocus=form.lastname;
	 if (fieldtofocus==""){fieldtofocus=form.lastname}
	}

	x = form.email.value;
	filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if (!filter.test(x)) 
	{message +="--Valid Email\n";
	 passed=false;
	 fieldtofocus=form.email;
     if (fieldtofocus==""){fieldtofocus=form.email}
	}
	
 if(form.x4x.checked==false && form.x5x.checked==false)
 	{message +="--Select a checkbox\n";
	 passed=false;
	 fieldtofocus=form.x4x;
     if (fieldtofocus==""){fieldtofocus=form.x4x}
	}

  if (passed==false) {fixfieldinfo(message, fieldtofocus);}

  return passed;

}  	 

function fixfieldinfo(message, fieldtofocus)
  {alert(message);
   fieldtofocus.focus();
  }
//-->