<!--
// This function turns on or off the error styling
//  specified in a style sheet, by appending 'Err'
//  to the classname on the element.  For this to
//  work right, the object must have a class, and
//  the CSS files must specify both the regular class
//  and the error class formatting.
function ErrorFlag(eObj,err) {
  if (eObj) {
    if (err) {
      if( eObj.className.substr(-3,3) !='Err') eObj.className += 'Err'
    }
    else eObj.className = eObj.className.replace(/Err/,"")
  }
}

//This function checks if the innerHTML or 'value' of an object is
//  empty.  If so, it flags the object as an error.
function empty_chk(obj) {
  var oLen = 0
  if (obj.innerHTML) oLen = obj.innerHTML.length
  if (obj.value && oLen==0) oLen = obj.value.length
  if (oLen==0) ErrorFlag(obj, true)
  else ErrorFlag(obj, false)

}

// This gets OK/error messages for field error checking
//  (passed via AJAX Get/POST operation), and returns true on error
function Eget(reply,tagStr) {
  var str
  if ((str = xml_tag_value(reply,tagStr)) == null) return null
  else return (str != 'OK')
}

//-->

