<!-- BEGIN// check to make sure have tested browser://  Netscape 4.7 or later//  MSIE 4 or laterbrowser_name = navigator.appName;browser_version = parseFloat(navigator.appVersion); okVer = false;msg = "Version 4";if (browser_name == "Netscape") {   if (browser_version >= 4.7) { okVer = true; }   msg = "Netscape 4.7";  window.onResize = reloadIt; // patch for netscape window resizing problem}else if (browser_name == "Microsoft Internet Explorer") {   if (browser_version >= 4.0) { okVer = true; }  msg = "MS Internet Explorer 4";}else if (browser_version >= 4.0) { okVer = true; } okVer = true;if (!okVer) {   alert("Please upgrade your browser to " + msg + " or later.");}form_name = "vote"; string = "";url = "http://www.mdsg.umd.edu/cgi-bin/wss/webvote.pl?";function reloadIt() { document.location = document.location;}function candidate_check(which) { // checkbox with max number  var picked, max, candidates, nn, this_item;  var max = 2;  var pass = true;  var msg = "";  var singles = Array(    "President_elect",    "Methodology_Chair",    "Secretary"  )  // use _ for space qq for period (.)  var candidates = Array(    "Christine Cox",    "Robert Santos",    "Mel Kollander",    "Zhiwei Zhang "  );  nn = candidates.length - 1; // account for array index start at 0   picked = 0;  for (i="0"; i <= nn; i++) {    this_item =       eval('document' + '.' + form_name + '.' + candidates[i] + '.checked');    if (this_item) { picked++; }   }  if (picked > max) {     msg = "You can only vote for up to " + max + " WSS Representatives-at-Large.";    alert(msg);    return false;  }  else {     max = singles.length + 1; // radio + 1 checkbox    for (var j = 0; j < singles.length; j++) {      for (var i="0"; i<which.length; i++) {        var tempobj=which.elements[i];        if (tempobj.name==singles[j]) {          if (tempobj.type=="radio") {           if (tempobj.checked) { picked++; }          }         }      }    }    msg = "";    if (picked < max) {       msg = "You did not vote for all of the offices.\n\n";    }    msg += "Press OK to cast your ballot or \n";    msg += "Cancel to revise your ballot\n\n";    msg += "Remember, you cannot vote again once ";    msg += "you cast you ballot.\n\n";    return confirm(msg)  } }function check_it(which,check_email) {   // which - values from form  // check_email - value of email entry to check    // required - array of required field names in the form  required = Array(    "last",    "voter_id",    "new_vote"  );  // required_text - printed in alert (instead of field name)  required_text = Array(     "Last Name",     "Voter ID",    "Vote"   );    // pattern match variables, labels & pattern name  pattern_var = Array("voter_id");  pattern_text = Array("Voter ID Number");  pattern_name = Array("wss");  var ok;  ok = required_fields(which);     if (ok && check_email) { // have required fields, check email    ok = emailCheck(check_email);    if (!ok) {       alert("Your email address\n  " + check_email +      "\ndoes not appear to be valid.\n");    }  }  // have all required fields & email, now double check patterns   if (ok && pattern_var.length > 0) { ok = check_patterns(which); }  if (ok) { create_window(); return false; }  else { return ok; }}   function booth() {  url += "w=booth";  myWin=window.open(url,'_parent');}function create_window(this_url) {  var this_window, winopt, h, w, movetox, movetoy;   h = 480; // fixed height  // uncomment if is use onBlur for each popup otherwise set h to max needed  //if (ht) { h = ht; };  this_window = "info";   movetox = 600; movetoy = 10;  winopt = "toolbar=no,location=no,directories=no,menubar=no,resizable=no,";  winopt += "scrollbars=yes,width=500,height=" + h;  //winopt += "left=" + movetox + ",top=" + movetoy;   //winopt += "screenX=" + movetox + ",screenY=" + movetoy;  myWin=window.open(this_url,this_window,winopt);  myWin.moveTo(movetox,movetoy);  myWin.focus();  return; }function create_booth(this_url,ht) {  var this_window, winopt, h, w, movetox, movetoy;  h = 525;   if (ht) { h = ht; };  this_window = "ballot";   movetox = 50; movetoy = 10;  winopt = "toolbar=no,location=no,directories=no,menubar=no,resizable=no,";  winopt += "scrollbars=yes,width=450,height=" + h;  //winopt += "left=" + movetox + ",top=" + movetoy;   //winopt += "screenX=" + movetox + ",screenY=" + movetoy;  myBWin=window.open(this_url,this_window,winopt);  myBWin.moveTo(movetox,movetoy);  myBWin.focus();  return; }function required_fields(which) {  // checks if all required fields are filled in  // do not change the rest of this function  // adapted from script by wsabstract.com posted at   // The JavaScript Source!! http://javascript.internet.com    var pass = true;  var msg = "Please make sure that entries for \n";  var num = 0;   string = "w=ballot;";     if (document.images) {  for (i="0"; i<which.length; i++) {    var tempobj=which.elements[i];    for (j = 0; j < required.length; j++) {      if (tempobj.name==required[j]) {        if (((tempobj.type=="password" ||          tempobj.type=="text" ||          tempobj.type=="file" ||          tempobj.type=="textarea") &&           tempobj.value=='') ||          (tempobj.type.toString().charAt(0)=="s" &&            tempobj.selectedIndex=="0")) {          pass=false;          num += 1;          msg += "  * " + required_text[j] + "\n";        }        else {           string += tempobj.name + '=' + tempobj.value + ';';         }      }     }  }  }       if (!pass) {  if (num > 1) { msg += "are entered correctly.\n"; }  else { msg += "is entered correctly.\n"; }  alert(msg);  return false;  }  else { return true; }}function emailCheck(emailStr) {  // V1.1.3: Sandeep V. Tamhankar (stamhankar@hotmail.com)   // The JavaScript Source!! http://javascript.internet.com    // Modified by Dan Jacobs   // comment out alerts - use return true/false only    /* The following variable tells the rest of the function whether or not to   verify that the address ends in a two-letter country   or well-known TLD.    1 means check it, 0 means don't. */    var checkTLD=1;    /* List of known TLDs that an e-mail address must end with. */    var knownDomsPat =   /^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;    /* The following pattern used to check if the entered e-mail address fits the    user@domain format. Also used to separate the username from the domain. */    var emailPat=/^(.+)@(.+)$/;    /* This string represents the pattern for matching all special characters.     We don't want to allow special characters in the address, such as   ( ) < > @ , ; : \ " . [ ] */    var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";    /* The following string represents the range of characters allowed in a   user name or domain name. It really states which chars aren't allowed.*/    var validChars="\[^\\s" + specialChars + "\]";    /* The following pattern applies if the "user" is a quoted string (in which   case, there are no rules about which characters are allowed and which aren't   (anything goes). E.g. "jiminy cricket"@disney.com is legal. */    var quotedUser="(\"[^\"]*\")";    /* The following pattern applies for domains that are IP addresses, rather   than symbolic names - e.g. joe@[123.124.233.4] is a legal e-mail address.   NOTE: The square brackets are required. */    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;    /* The following string represents an atom   (basically a series of non-special characters.) */    var atom=validChars + '+';    /* The following string represents one word in the typical username.   For example, in john.doe@somewhere.com, john and doe are words.   Basically, a word is either an atom or quoted string. */    var word="(" + atom + "|" + quotedUser + ")";    // The following pattern describes the structure of the user    var userPat=new RegExp("^" + word + "(\\." + word + ")*$");    /* The following pattern describes the structure of a normal symbolic domain,   as opposed to ipDomainPat, shown above. */    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");    /* Finally, start to figure out if the supplied address is valid. */    /* Begin with the coarse pattern to simply break up user@domain into   different pieces that are easy to analyze. */    var matchArray=emailStr.match(emailPat);    if (matchArray==null) {  /* Too many/few @'s or something; basically, this address doesn't even fit the   general mold of a valid e-mail address. */  //alert("Email address seems incorrect (check @ and .'s)");  return false;  }    var user=matchArray[1];  var domain=matchArray[2];    // check if only basic ASCII characters are in the strings (0-127).    for (i="0"; i<user.length; i++) {  if (user.charCodeAt(i)>127) {    //alert("The username contains invalid characters.");      return false;  }  }  for (i="0"; i<domain.length; i++) {  if (domain.charCodeAt(i)>127) {    //alert("The domain name contains invalid characters.");    return false;  }  }    // See if "user" is valid     if (user.match(userPat)==null) {  // user is not valid  //alert("The username doesn't seem to be valid.");  return false;  }    /* if the e-mail address is at an IP address (as opposed to a symbolic host   name) make sure the IP address is valid. */    var IPArray=domain.match(ipDomainPat);  if (IPArray!=null) {  // this is an IP address  for (var i=1;i<=4;i++) {    if (IPArray[i]>255) {      //alert("Destination IP address is invalid!");      return false;    }  }  return true;  }    // Domain is symbolic name.  Check if it's valid.     var atomPat=new RegExp("^" + atom + "$");  var domArr=domain.split(".");  var len=domArr.length;  for (i="0";i<len;i++) {  if (domArr[i].search(atomPat)==-1) {    //alert("The domain name does not seem to be valid.");    return false;  }  }    /* domain name seems valid, but now make sure that it ends in a known   top-level domain (like com, edu, gov) or a two-letter word, representing    country (uk, nl), and a hostname precedes the domain or country. */    if (checkTLD && domArr[domArr.length-1].length!=2 &&   domArr[domArr.length-1].search(knownDomsPat)==-1) {  //alert("The address must end in a well-known domain or two letter country.");  return false;  }    // Make sure there's a host name preceding the domain.    if (len<2) {   //alert("This address is missing a hostname!");  return false;  }    // If we've gotten this far, everything's valid!  return true;  }  function check_patterns(which) { // double check the patterns  // written by Dan Jacobs  var pass = true;  var num = 0;  var msg = "";   for (var j = 0; j < pattern_var.length; j++) {    pass =       pattern_check(which,pattern_var[j],pattern_text[j],pattern_name[j],'1');     if (!pass) {       num += 1;      msg += "  * " + pattern_text[j] + "\n";    }  }   if (num > 0) {    tt = "appear to be valid or match the pattern";    if (num > 1) {       alert("The following do not " + tt + ":\n" + msg);    }    else {       alert("The following does not " + tt + ":\n" + msg);    }    return false;  }  else { return true; }}function pattern_check(which,this_var,this_string,pattern,this_flag) {     // written by Dan Jacobs  var min_yr = 1960; max_yr = 2030;  var this_match, this_msg, this_indx, this_num;   var this_var = eval('document' + '.' + form_name + '.' + this_var + '.value');  if (!this_var) { return true; }  if (!pattern) { return true; }  if (pattern == "phone") { // xxx-xxx-xxxx    this_match = this_var.match(/^(\d{3})\-(\d{3})\-(\d{4})$/);    this_msg = "The pattern is xxx-xxx-xxxx, where each x is a number ";    this_msg += "between 0-9.";    }  else if (pattern == "mmyyyy") {     this_match = this_var.match(/^(\d{1,2})\/(\d{4})$/);    if (this_match) { // check limits      this_indx = this_var.indexOf('/');      this_num = this_var.substring(0,this_indx) * 1;      if (this_num > 12) { this_match = ""; }      this_indx += 1;      this_num = this_var.substring(this_indx,this_var.length) * 1;      if (this_num < min_year || this_num > max_year) { this_match = ""; }    }    this_msg = "The pattern is mm/yyyy, where mm is the month (01-12) ";    this_msg += "and yyyy is the year (e.g, 2003).";  }  else if (pattern == "ssn") {    this_match = this_var.match(/^(\d{3})\-(\d{2})\-(\d{4})$/);    this_msg = "The pattern is xxx-xx-xxxx, where each x is a number ";    this_msg += "between 0-9.";  }  else if (pattern == "asa") {    this_match = this_var.match(/^(\d{6})$/);    this_msg = "The pattern is xxxxxx, where each x is a number ";    this_msg += "between 0-9.";  }  else { return true; }   if (!this_match) {     if (this_flag) { // call from double check on submit      return false;    }    else {      alert('Please correct your ' + this_string + '.\n' + this_msg + '\n');    }  }   else { return true; } }//END -->