  // test browser for compatibility 
  function testBrowser() {
    if (navigator.appName.indexOf("Internet Explorer") != -1 /* &&
        navigator.appVersion.indexOf("4.0") != -1 */ ) {
      return;
    } else if (navigator.appName.indexOf("Netscape") != -1 &&
        navigator.appVersion.indexOf("5.0") != -1 ) {
      return;
    } else {
      window.alert("This form has not been tested on your browser.\n" + 
            "Your application may not be processed properly if you continue.");
    }
  }

  // for form1 - personal information
  function validateForm1() {
    count = 1;
    errors = "The following required fields have not been filled in:\n";
    if (document.form1.gname.value.length == 0) { count--;
       errors += "\tYour first name\n"; }
    if (document.form1.fname.value.length == 0) { count--;
       errors += "\tYour last name\n"; }
    if (document.form1.age.value.length == 0) { count--;
       errors += "\tYour age\n"; }
    if (document.form1.address.value.length == 0) { count--;
       errors += "\tYour address\n"; }
    if (document.form1.pcode.value.length == 0) { count--;
       errors += "\tYour postcode\n"; }
    if (document.form1.hphone.value.length == 0) { count--;
       errors += "\tYour home phonenumber\n"; }
    if (count == 1) { 
      document.form1.submit();
    } else { 
      window.alert(errors);
    }
  }

  // for form4 - declaration
  function validateForm4() {
    dom = document.form4.declared;
    if (dom.checked) { 
      document.form4.submit();
    } else { 
      window.alert("The declaration checkbox must be checked \n" + 
            "before we can accept your submission.");
    }
  }

  // opens a new restricted window for uploading resume
  function popUpload() {
     window.open("./upload.asp", "UploadWin", 
     "toolbar=no,location=no,directories=no,status=yes," +
     "menubar=no,scrollbars=yes,resizable=yes,width=500,height=350")
  }

  // for upload form - file location entered
  function validateUpload() {
     if (document.upload.uploadFile.value.length != 0) {
       document.upload.submit();
     } else {
       window.alert("You must enter a file location to upload!");
     }
  }

  // opens a new window for application form
  function popForm() {
      window.open("./form.asp", "OnlineApp", 
     "toolbar=no,location=no,directories=no,status=yes," +
     "menubar=no,scrollbars=yes,resizable=yes")
  }