function checkForm() {

        this.msgsep     = '\n';
        this.blank      = '';
        this.problem    = new Array();
        this.display    = new Array();

        this.addMssg    = _checkForm_addMssg;
        this.showAlrt   = _checkForm_showAlrt;
        this.ckValue    = _checkForm_ckValue;

return this;  }

function _checkForm_addMssg (field, msg) {
	if (field.value || field.focus) field.focus();
		this.problem[this.problem.length] = msg;
}

function _checkForm_showAlrt (head, foot) {

    if (this.problem.length) {
      err = head ? head + this.msgsep : '';
      err += this.problem.join(this.msgsep);
      err += foot ? this.msgsep + foot : '';
      alert(err);
     return false;
    }
    return true;
}

function _checkForm_ckValue (field) {
  if ( ! field.type && field.length ) {
    for (var x = 0; x < field.length; x++)
      if (field[x].type && this.ckValue(field[x]))
        return true;
    return false;
  }
  if (/select/.test(field.type))
    return (field.selectedIndex != -1 &&
(field.options[field.selectedIndex].value != this.blank));
  if (/(checkbox|radio)/.test(field.type))
    return ( field.checked && (field.value != this.blank) );
  if (/(button|reset|submit)/.test(field.type))
    return false;
  return (field.value != this.blank)
}


function checkIt (form) {

  var v = new checkForm();
  
  if ( ! v.ckValue(form.Name) )       v.addMssg(form.Name,      "»  Name", 2);
  if ( ! v.ckValue(form.Email) ) v.addMssg(form.Email,		"»  Email Address", 1);
  if ( ! v.ckValue(form.Phone) ) v.addMssg(form.Phone,		"»  Phone Number", 0);

  return v.showAlrt('Please Complete The Following\nFields In The Form:\n',
    '\nTo Return To The Form,\nPress "OK"');
}
