function isBlank(s) {
  if ((s == null) || (s == "")) return true;
  return false;
}

// Set focus on screen to first blank input field.
function blankFocus() {
  ff = -1;
  if (document.forms.length > 0) {
    field = document.forms[0];
    for (i=0; i<field.length; i++) {
      elt = field.elements[i];
      if ( (elt.type == "text") || 
           (elt.type == "password") ||
           (elt.type == "file") ||
           (elt.type == "select-one") ) {
        if (elt.name != "dummy") {
          if (ff == -1) ff = i;
          if (isBlank(elt.value)) {
            elt.focus();
            return;
          }
        }
      }
    }
    // If no blanks, set to first field.
    if (ff > -1) field.elements[ff].focus();
  }
}
