//
// 20020202
// define some cross-browser functions
//


var xb_ie,xb_ns4,xb_dom;

xb_ie=(document.all)?1:0;
xb_ns4=(document.layers)?1:0;
xb_dom=(document.getElementById)?1:0;

if(!(xb_dom || xb_ns4)) {
  alert('This web page is not designed for your browser. Sorry.');
}

if(xb_dom) {
  xb_getElement=function (name) { return document.getElementById(name); }
}

if(xb_ns4) {
  xb_getElement=function (name) { return document.layers[name]; }
  xb_setVisibility=function (obj,vis) { obj.visibility=vis }
  xb_moveTo=function (obj,x,y) { obj.moveTo(x,y); }
  xb_getWidth=function (obj) { return obj.clip.width; }
  xb_getHeight=function (obj) { return obj.clip.height; }
} else {
  xb_setVisibility=function (obj,vis) { obj.style.visibility=vis }
  xb_moveTo=function (obj,x,y) { obj.style.left=x+'px'; obj.style.top=y+'px' }
  xb_getWidth=function (obj) { return obj.offsetWidth; }
  xb_getHeight=function (obj) { return obj.offsetHeight; }
}

if(xb_ie) {
  xb_getDocumentWidth=function(obj) { return document.body.clientWidth };
  xb_getDocumentHeight=function(obj) { return document.body.clientHeight };
} else {
  xb_getDocumentWidth=function(obj) { return window.innerWidth };
  xb_getDocumentHeight=function(obj) { return window.innerHeight };
}

if(xb_ns4) {
  xb_setEventHandler=function (obj,evnt,handler) { obj.captureEvents(Event[evnt.toUpperCase()]); obj['on'+evnt]=handler }
} else if(xb_ie) {
  xb_setEventHandler=function (obj,evnt,handler) { obj['on'+evnt]=handler }
} else if(xb_dom) {
  xb_setEventHandler=function (obj,evnt,handler) { obj.addEventListener(evnt,handler,false); }
}


