function VerifyForm() {
  this.msgSeparator = '\n';
  this.blankValue   = '';
  this._gripes      = new Array();
  this._Email    = /^([0-9a-z_&.+-]+!)*[0-9a-z_&.+-]+@(([0-9a-z]([0-9a-z-]*[0-9a-z])?\.)+[a-z]{2,3}|([0-9]{1,3}\.){3}[0-9]{1,3})$/i;
  this._EmailBad = /^(((postmaster|root|hostmaster|mailer-daemon|webmaster)@(texterity)\.com)|.*@(.*\.(texterity)\.com|localhost\.com|127\.0\.0\.1))$/i;
  this.addError      = _VerifyForm_addError;
  this.showErrors    = _VerifyForm_showErrors;
  this.hasValue      = _VerifyForm_hasValue;
  this.getValue      = _VerifyForm_getValue;
  this.getAllValues  = _VerifyForm_getAllValues;
  this.clearFirst    = _VerifyForm_clearFirst;
  this.clearLast     = _VerifyForm_clearLast;
  this.clearAll      = _VerifyForm_clearAll;
  this.setFirst      = _VerifyForm_setFirst;
  this.setLast       = _VerifyForm_setLast;
  this.setAll        = _VerifyForm_setAll;
  this.checkFirst    = _VerifyForm_checkFirst;
  this.checkLast     = _VerifyForm_checkLast;
  this.checkAll      = _VerifyForm_checkAll;
  this.uncheckFirst  = _VerifyForm_uncheckFirst;
  this.uncheckLast   = _VerifyForm_uncheckLast;
  this.uncheckAll    = _VerifyForm_uncheckAll;
  this._setField     = _VerifyForm__setField;
  this.validEmail    = _VerifyForm_validEmail;
  return this;
}
function _VerifyForm_addError (field, msg) {
  if ( ! this._gripes.length) {
    // IE 4.x Mac bug workaround: "object.method" produces error
    // instead of returning true when method exists!!!
    // therefore we also test for field.all here
    if (field.all || field.focus)  field.focus();
    if (field.value && (field.all || field.select)) field.select();
  }
  this._gripes[this._gripes.length] = msg;
}
function _VerifyForm_showErrors (head, foot) {
  if (this._gripes.length) {
    alert((head ? head + this.msgSeparator : '') + this._gripes.join(this.msgSeparator) + (foot ? this.msgSeparator + foot : ''));
    return false;
  }
  return true;
}
function _VerifyForm_hasValue (field) {
  if ( ! field.type && field.length ) {
    for (var i = 0; i < field.length; i++)
      if (field[i].type && this.hasValue(field[i]))
        return true;
    return false;
  }
  if (/select/.test(field.type))
    return (field.selectedIndex != -1 && (field.options[field.selectedIndex].value != this.blankValue));
  if (/(checkbox|radio)/.test(field.type))
    return ( field.checked && (field.value != this.blankValue) );
  if (/(button|reset|submit)/.test(field.type))
    return false;
  return (field.value != this.blankValue)
}
function _VerifyForm_getValue (field) {
  if ( ! field.type && field.length ) {
    for (var i = 0; i < field.length; i++) {
      if (field[i].type) {
        var value = this.getValue(field[i]);
        if (value) return value;
      }
    }
    return null;
  }
  if (/select/.test(field.type))
    return ( (field.selectedIndex != -1 && (field.options[field.selectedIndex].value != this.blankValue))
      ? field.options[field.selectedIndex].value : null );
  if (/(checkbox|radio)/.test(field.type))
    return ( (field.checked && (field.value != this.blankValue)) ? field.value : null );
  return ( ( ! /(button|reset|submit)/.test(field.type) && (field.value != this.blankValue)) ? field.value : null )
}
function _VerifyForm_getAllValues (field) {
  var arr = new Array();
  if ( ! field.type && field.length ) {
    var temparr;
    for (var i = 0; i < field.length; i++) {
      if (field[i].type) {
        temparr = this.getAllValues(field[i]);
        for (var j = 0; j < temparr.length; j++)
          arr[arr.length] = temparr[j];
      }
    }
  }
  else if (/select/.test(field.type)) {
    for (var i = 0; i < field.length; i++)
      if (field.options[i].selected && (field.options[i].value != this.blankValue))
        arr[arr.length] = field.options[i].value;
  }
  else if (/(checkbox|radio)/.test(field.type) && field.checked && (field.value != this.blankValue))
    arr[arr.length] = field.value;
  else if ( ! /(button|reset|submit)/.test(field.type) && (field.value != this.blankValue))
    arr[arr.length] = field.value;
  return arr;
}
function _VerifyForm_clearFirst (field, val) { return this._setField(field,  1, val, this.blankValue, true) }
function _VerifyForm_clearLast  (field, val) { return this._setField(field, -1, val, this.blankValue, true) }
function _VerifyForm_clearAll   (field, val) { return this._setField(field,  0, val, this.blankValue, true) }
function _VerifyForm_setFirst     (field, toval, val) { return this._setField(field,  1, val, toval,  true) }
function _VerifyForm_setLast      (field, toval, val) { return this._setField(field, -1, val, toval,  true) }
function _VerifyForm_setAll       (field, toval, val) { return this._setField(field,  0, val, toval,  true) }
function _VerifyForm_checkFirst   (field, val)        { return this._setField(field,  1, val,  true, false) }
function _VerifyForm_checkLast    (field, val)        { return this._setField(field, -1, val,  true, false) }
function _VerifyForm_checkAll     (field, val)        { return this._setField(field,  0, val,  true, false) }
function _VerifyForm_uncheckFirst (field, val)        { return this._setField(field,  1, val, false, false) }
function _VerifyForm_uncheckLast  (field, val)        { return this._setField(field, -1, val, false, false) }
function _VerifyForm_uncheckAll   (field, val)        { return this._setField(field,  0, val, false, false) }
function _VerifyForm__setField    (field, whichway, val, toval, valueorcheck) {
  var retval = false;
  if ( ! field.type && field.length ) {
    for (var i = (whichway == 1 ? 0 : field.length - 1); i < field.length && i >= 0; i += (whichway || -1))
      if (field[i].type && this._setField(field[i], whichway, val, toval, valueorcheck))
        if (whichway) return true;
        else retval = true;
    return retval;
  }
  if (valueorcheck) {
    if (/(file|password|text)/.test(field.type) && (typeof val != 'string' || field.value == val)) {
      field.value = toval;
      return true;
    }
  }
  else if (/select/.test(field.type)) {
    for (var i = (whichway == 1 ? 0 : field.length - 1); i < field.length && i >= 0; i += (whichway || -1)) {
      if ( typeof val != 'string' || field.options[i].value == val) {
        field.options[i].selected = toval;
        if (whichway) return true;
        else retval = true;
      }
    }
    return retval;
  }
  else if (/(checkbox|radio)/.test(field.type) && (typeof val != 'string' || field.value == val)) {
    field.checked = toval;
    return true;
  }
  return false
}
function _VerifyForm_validEmail (e) { return ( this._Email.test(e) && ! this._EmailBad.test(e) ) }