
function stopError() { return true; }
window.onError = stopError;

function easylayertool_ecma_showlayer(id) { document.getElementById(id).style.visibility = "visible"; }
function easylayertool_ecma_hidelayer(id) { document.getElementById(id).style.visibility = "hidden"; }
function easylayertool_ie_showlayer(id) { document.all.tags("div")[id].style.visibility = "visible"; }
function easylayertool_ie_hidelayer(id) { document.all.tags("div")[id].style.visibility = "hidden"; }
function easylayertool_ns_showlayer(id) { document.layers[id].visibility = "visible"; }
function easylayertool_ns_hidelayer(id) { document.layers[id].visibility = "hidden"; }

function easylayertool_show(id) { if(this.initialized) this._show(id); }
function easylayertool_hide(id) { if(this.initialized) this._hide(id); }
function easylayertool_init() { this.initialized = true; }

function easylayertool_reg(id) { this.layers[this.layers.length] = id; }

function easylayertool_dummy(id) { }

function easylayertool_reset() {
  for( i=0; i< this.layers.length; i++ ) {
    if( this.layers[i] != this.sticky_id )
      this.hide(this.layers[i]);
  }
}
function easylayertool_sticky(id) {
  if( this.sticky_id!="" ) this.hide(this.sticky_id);
  this.sticky_id = id;
}

function EasyLayerTool() {
  this.initialized = false;
  if(document.getElementById && (navigator.userAgent.indexOf("MSIE")==-1) ) {
    this._show = easylayertool_ecma_showlayer;
    this._hide = easylayertool_ecma_hidelayer;
    this.reg  = easylayertool_reg;
  } else if(document.all) {
    this._show = easylayertool_ie_showlayer;
    this._hide = easylayertool_ie_hidelayer;
    this.reg  = easylayertool_reg;
  } else if(document.layers) {
    this._show = easylayertool_ns_showlayer;
    this._hide = easylayertool_ns_hidelayer;
    this.reg  = easylayertool_reg;
  } else {
    this._show = easylayertool_dummy;
    this._hide = easylayertool_dummy;
    this.reg   = easylayertool_dummy;
  }
  this.show = easylayertool_show;
  this.hide = easylayertool_hide;
  this.init = easylayertool_init;
  this.reset = easylayertool_reset;
  this.sticky = easylayertool_sticky;

  this.layers = new Array;
  this.sticky_id = "";

  return this;
}


