/* Pop up function
   By Jeremy Keith */
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick = function() {
        window.open(this.href);
        return false;
      }
    }
  }
}
window.onload = doPopups;



/* Checking for forms
   By Richard Zeng. */
function checkInput(theForm) {
    if(theForm.FirstName.value.length < 1) {
        alert("Please input your first name.");
        theForm.FirstName.focus();
        return false;
    }
    if(theForm.LastName.value.length < 1) {
        alert("Please input your last name.");
        theForm.LastName.focus();
        return false;
    }
    if(theForm.Email.value.length < 1) {
        alert("Please input your email.");
        theForm.Email.focus();
        return false;
    }
    var emailRegxp = /^[a-zA-Z]([\w]*)(.[\w]*)*@([\w]+)(.[\w]+){1,10}$/;
    if(!emailRegxp.test(theForm.Email.value)) {
        alert("Please input correct email.");
        theForm.Email.focus();
        return false;
    }
    return true;
} 