String.prototype.trim = function() {
// Strip leading and trailing white-space
return this.replace(/^\s*|\s*$/g, "");
}

function checkForm(f) {
  f.email.value = f.email.value.trim();
  if (f.email.value.length == 0) { 
    alert("Please enter your e-mail address");
    f.email.focus();
    return false;
  } 
  if (f.email.value.length < 5 || f.email.value.indexOf("@") == -1) { 
    alert("Invalid e-mail address"); 
    f.email.focus();
    return false;
  } 
  f.submit();
  return true;
}
