var errMsgFlag = false;

  function RFI_validate() {

    //alert("in RFI_validate()");

    var elem;
    var errs=0;
    // execute all element validations in reverse order, so focus gets
    // set to the first one in error.
    if (!validateUsers(document.forms.RFIform["00N00000004x1fY"],  'msg_potential', true)) errs += 1;
    // if (!validatePresent(document.forms.RFIform["00N00000004x1fY"],  'msg_potential')) errs += 1;
    if (!validateSelects  (document.forms.RFIform.country, 'msg_country', true)) errs += 1;
    if (!validateSelects  (document.forms.RFIform.state, 'msg_state', true)) errs += 1;
    if (!validatePresent(document.forms.RFIform.city,  'msg_city')) errs += 1;
    if (!validateEmail  (document.forms.RFIform.email, 'msg_email', true)) errs += 1;
    if (!validatePresent(document.forms.RFIform.phone,  'msg_phone')) errs += 1;
    if (!validatePresent(document.forms.RFIform.company,  'msg_company')) errs += 1;
    if (!validatePresent(document.forms.RFIform.title,  'msg_title')) errs += 1;
    if (!validatePresent(document.forms.RFIform.last_name,  'msg_last')) errs += 1;
    if (!validatePresent(document.forms.RFIform.first_name,  'msg_first')) errs += 1;

    // replace this with the inline error msg at the top.
    //if (errs>1)  alert('There are fields which need correction before sending');
    //if (errs==1) alert('There is a field which needs correction before sending');

    if((!errMsgFlag) && (errs > 0)) {
      
      errMsgFlag = true;

    // Message that appears at the top of the form
    var userMsg = '';
    if (errs>1)  userMsg = 'Please correct the fields indicated below.';
    if (errs==1) userMsg = 'Please correct the field indicated below.';
    
    // create a text node
    var msgNode = document.createTextNode(userMsg);
    
    // grab the existing container div and add the class name
    var userMsgBox = document.getElementById("validationMsg");
    userMsgBox.className = "errorBox";
    
    // append the text node to the div
    userMsgBox.appendChild(msgNode);
    
    // change the container's inline display to block
    userMsgBox.style.display = 'block';
    
    }

    return (errs==0);
  };
  
  
  
  
  
  
// for login form

var errMsgFlag2 = false;

  function LI_validate() {

   // alert("in LI_validate()");

    var elem;
    var errs=0;
    // execute all element validations in reverse order, so focus gets
    // set to the first one in error.
    if (!validatePresent(document.forms.login.password,  'msg_pw')) errs += 1;
    if (!validatePresent(document.forms.login.login,  'msg_un')) errs += 1;

    // replace this with the inline error msg at the top.
    //if (errs>1)  alert('There are fields which need correction before sending');
    //if (errs==1) alert('There is a field which needs correction before sending');

    if((!errMsgFlag2) && (errs > 0)) {
      
      errMsgFlag2 = true;

    // Message that appears at the top of the form
    var userMsg = '';
    if (errs>1)  userMsg = 'Please correct the fields indicated below.';
    if (errs==1) userMsg = 'Please correct the field indicated below.';
    
    // create a text node
    var msgNode = document.createTextNode(userMsg);
    
    // grab the existing container div and add the class name
    var userMsgBox = document.getElementById("validationMsg");
    userMsgBox.className = "errorBox";
    
    // append the text node to the div
    userMsgBox.appendChild(msgNode);
    
    // change the container's inline display to block
    userMsgBox.style.display = 'block';
    
    }

    return (errs==0);
  };

