   function exp_coll(ind)
   {
      s = document.getElementById("sp_" + ind);
      if (s.style.display == 'none')
      {
        s.style.display = 'block';
      }
        else if (s.style.display == 'block')
             {
               s.style.display = 'none';
             }
   }

  function imgOn (img) {
  var curimg = 'arrow'+img;
  var imgsrc  = 'document.'+curimg+'.src';
  var imgname = 'document.'+curimg;
  if (eval(imgsrc).indexOf("uarrow") > 0) {
    eval(imgname).src =  "/images/darrow.gif";
  }else{
    eval(imgname).src =  "/images/uarrow.gif";
  }
  exp_coll(img);
}

  function check_netid_pass() {
     if (
          check_uname(document.login.username) &&
          check_email(document.login.username) &&
          check_pwd(document.login.guess)  ) {
             return true;
                       } else return false;
  }

  function check_chg_pwd() {
     if (
          check_oldPass(document.chgpwd.oldpasswd) &&
          check_pwd(document.chgpwd.newpasswd) &&
          validatePwd(document.chgpwd.newpasswd) &&
          check_pwd(document.chgpwd.guess2) &&
          check_both(document.chgpwd.newpasswd,document.chgpwd.guess2)  ) {
             return true;
                       } else return false;
  }

function validatePwd(d) {

//Initialise variables
var errorMsg = "";
var space  = " "; 
fieldvalue  = d.value; 
fieldlength = fieldvalue.length; 

//It must not contain a space
if (fieldvalue.indexOf(space) > -1) {
     errorMsg += "\nPasswords cannot include a space.\n";
}     

//It must contain at least one number character
//if (!(fieldvalue.match(/\d/))) {
//     errorMsg += "\nStrong passwords must include at least one number.\n";
//}
//It must start with at least one letter     
if (!(fieldvalue.match(/^[a-zA-Z]+/))) {
     errorMsg += "\nStrong passwords must start with at least one letter.\n";
}
//It must contain at least one upper case character     
if (!(fieldvalue.match(/[A-Z]/))) {
     errorMsg += "\nStrong passwords must include at least one uppercase letter.\n";
}
//It must contain at least one lower case character
if (!(fieldvalue.match(/[a-z]/))) {
     errorMsg += "\nStrong passwords must include one or more lowercase letters.\n";
}
//It must contain at least one special character
//if (!(fieldvalue.match(/\W+/))) {
//if (!(fieldvalue.match(-,#,&,@,%,_,!))) {
//     errorMsg += "\nStrong passwords must include at least one special character - #,@,%,!\n";
//}
//It must be at least 7 characters long.
if (!(fieldlength >= 7)) {
     errorMsg += "\nStrong passwords must be at least 7 characters long.\n";
}
//If there is aproblem with the form then display an error
     if (errorMsg != ""){
          msg = "______________________________________________________\n\n";
          msg += "Please correct the problem(s) with your password.\n";
          msg += "______________________________________________________\n";
          errorMsg += alert(msg + errorMsg + "\n\n");
          d.focus();
          return false;
     }
     
     return true;
}


  function check_myAcct() {
     if (
          check_fname(document.acct.fname) &&
          check_lname(document.acct.lname)  ) {
             return true;
                       } else return false;
  }

  function check_contactus() {
     if (
          check_name(document.contactus.name) &&
          check_email(document.contactus.cemail) &&
          check_comments(document.contactus.whatsayyou)  ) {
             return true;
                       } else return false;
  }

  function isBlank(s) {
    var len=s.length
    var i
    for (i=0;i<len;i=i+1) {
      if(s.charAt(i)!=" ")
        return false }
    return true
    }

  function check_uname(d) {
    if (isBlank(d.value) || d.value == 'null' || d.value=='undefined' ) {
      alert("Please enter your email address");
      d.focus();
      return false;
    }
    else
      return true}

  function check_email(e) {
   //   var e=document.login.username;
      var invalidChars=" /:,;";
      var bad=0;
      if (e.value=='') { bad=1; }
      for (i=0; i<invalidChars.length; i++) {
        badChar=invalidChars.charAt(i)
        if (e.value.indexOf(badChar,0) > -1) {
           bad=1;
        }
      }

      atPos = e.value.indexOf("@",1)
      if (atPos == -1) { bad=1; }
      if (e.value.indexOf("@",atPos+1) != -1) { bad=1; }

      periodPos = e.value.indexOf(".",atPos)
      if (periodPos == -1) { bad=1; }
      if (periodPos+3 > e.length) { bad=1; }

      if (bad==0)
      {
        return true
      }
       else {
              alert('Invalid Email Address, please re-enter')
              e.focus()
              return false
            }
  }
  function check_pwd(d) {
    if (isBlank(d.value) || d.value == 'null' || d.value=='undefined' ) {
      alert("Please enter a password");
      d.focus();
      return false;
    }
    else
      return true}

  function check_oldPass(d) {
    if (isBlank(d.value) || d.value == 'null' || d.value=='undefined' ) {
      alert("Please enter your old password");
      d.focus();
      return false;
    }
    else
      return true}

  function check_lname(d) {
    if (isBlank(d.value) || d.value == 'null' || d.value=='undefined' ) {
      alert("Please enter your last name");
      d.focus();
      return false;
    }
    else
      return true}

  function check_fname(d) {
    if (isBlank(d.value) || d.value == 'null' || d.value=='undefined' ) {
      alert("Please enter your first name");
      d.focus();
      return false;
    }
    else
      return true}

  function check_name(d) {
    if (isBlank(d.value) || d.value == 'null' || d.value=='undefined' ) {
      alert("Please enter your name");
      d.focus();
      return false;
    }
    else
      return true}

  function check_both(one,two) {
    if (one.value != two.value) {
      alert("New password and re-typed password are not the same.");
      one.focus();
      return false;
    }
    else
      return true}
      
  function check_comments(d) {
 //   var spamHTTP=substr(d.value,0,4);
 //   alert('spamHTTP is ' + spamHTTP);
    if (isBlank(d.value) || d.value == 'null' || d.value=='undefined' || d.value.substr(0,4)=='http'  ) {
      alert("Please enter a comment");
      d.focus();
      return false;
    }
    else
      return true}