/*********************************************
 ** errorhnd.js  --  supplies errorhandling **
 *********************************************
 ** Copyright (C) by XenoAntares, VI 2001 - **
 ** IX 2001. All rights reserved.  v1.0va   **
 *********************************************/

//******** Define Errorhandler
var ERR_DLGS        = false;
var ERRS_TO_CONSOLE = true;
var errorsOccurred  = false;
if (parseFloat(navigator.appVersion)>=4)  {
   if (!document.all) {  window.captureEvents(Event.ERROR);  }
   window.onerror = errHandler;
} // if UAVer >=4
var idErrNotify = 0;

function errHandler(msg, URL, lineNum)
{
   if (ERRS_TO_CONSOLE) {    // Report error to console.
      java.lang.System.out.println("");
      java.lang.System.out.println("XA-ErrorHandler captured following error:");
      java.lang.System.out.println("--> '"+msg+"' <--");
      java.lang.System.out.println("in file '"+URL+"'");
      java.lang.System.out.println("at line "+lineNum.toString()+".");
      java.lang.System.out.println("");
   }
//   if (idErrNotify!=null) clearTimeout(idErrNotify);
//   idErrNotify=setTimeout("errHandler",50000);
   errorsOccurred=true;
   // Allow or supress runtime error dialogs.
   return ( ERR_DLGS ? false : true )
}

function showErrors()
{
   if (errorsOccurred) {
      alert('WARNING: Error(s) occured...\n(see Java console)');
      errorsOccurred=false;
   }
   return true;
}
