
function validEmail(s) { 
	var pat = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
	return pat.test(s); 
} 

function process()
{
  var h = '';
  var pad = '    \n';
  var pink = '#ffe0e0';
	var f = document.getElementById("form1");

  f["Email"].style.background = '';
  if ( !validEmail(f.Email.value) || f.Email.value == "you@somewhere.com" )
  {
    f.Email.focus();
	  f.Email.style.background = pink;
    h += "* Your email address" + pad;
  }

  f["Name"].style.background = '';
  f.Name.value = f.Name.value.replace(/^\s+|\s+$/g, '');
  if ( f.Name.value.length==0 || f.Name.value == "First and Last Name" ) 
  {
    f.Name.focus();
	  f.Name.style.background = pink;
    h += "* Your name" + pad;
  }

  if (h.length > 0) 
  {
    alert("\nPLEASE CHECK YOUR FORM" + pad
      + "for errors in these fields:" + pad
      + h + "\n");
    return false;
  }

/*
  if ( f.Address.value == "Mailing Address" ) f.Address.value = "";
  if ( f.Address2.value == "Optional Second Line" ) f.Address2.value = "";
  if ( f.City.value == "" ) f.City.value = "???";
  if ( f.Zipcode.value == "xxxxx" ) f.Zipcode.value = "00000";
  if ( f.Comments.value == "Type Questions or Comments Here" ) f.Comments.value = "";
*/

  f.submit();
  return true;
}