var DOM = (document.getElementById && !document.all);
var IE = (document.all);
var NN = (document.layers);

var mX, mY;

if(NN) document.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
document.onmousemove = mPos;

function oFind(n,d) {if(!d) d=document;if(IE) return d.all[n];if(DOM) return d.getElementById(n);if(NN) return findLayer(n,document)}
function findLayer(name, doc) {var i, layer;for (i = 0; i < doc.layers.length; i++) {layer = doc.layers[i];if (layer.name == name) return layer;if (layer.document.layers.length > 0) {layer = findLayer(name, layer.document); if (layer != null) return layer;}}return null;}
function oContentHeight(o) {if(NN) return o.document.height; else if(IE) return o.scrollHeight; else if(DOM) {var th = o.style.height; o.style.height = "auto";var h = o.offsetHeight;o.style.height = th;return h;}}
function oContentWidth(o) {if(NN) return o.document.width; else if(IE) return o.scrollWidth; else if(DOM){var tw = o.style.width; o.style.width = "auto";var w = o.offsetWidth;o.style.width = tw;return w;}}
function mPos(e) {mX = evtX(e);mY = evtY(e);}
function writeTo(o, t) {if(NN) {o.document.open();o.document.write(t);o.document.close()} else {o.innerHTML = t}}
function scLeft() {if(NN) return window.pageXOffset; else return document.body.scrollLeft;}
function scTop() {if(NN) return window.pageYOffset; else return document.body.scrollTop;}
function evtX(e) {if(NN||DOM) return e.pageX; else return window.event.clientX+scLeft();}
function evtY(e) {if(NN||DOM) return e.pageY; else return window.event.clientY+scTop();}
function oLeft(o) {if(NN) return o.left; else if(IE) return o.style.pixelLeft; else return parseInt(o.style.left)}
function oTop(o) {if(NN) return o.top; else if(IE) return o.style.pixelTop; else return parseInt(o.style.top)}
function oWidth(o) {if(NN) return o.clip.width; else if(IE) return o.clientWidth; else return parseInt(o.style.width)}
function oHeight(o){if(NN) return o.clip.height; else if(IE) return o.clientHeight; else return parseInt(o.style.height)}
function oShow(o) {if(NN) o.visibility = "show"; else o.style.visibility = "visible";}
function oHide(o) {if(NN) o.visibility = "hide"; else o.style.visibility = "hidden";}
function oShowDisp(o,t) {if(NN) o.display = t; else o.style.display = t;}
function oHideDisp(o) {if(NN) o.display = "none"; else o.style.display = "none";}
function isVisible(o) {return (NN) ? (o.visibility == "hide") : (o.style.visibility == "hidden")}
function wWidth() {if(NN||DOM) return window.innerWidth-16; else return document.body.clientWidth;}
function wHeight() {if(NN||DOM) return window.innerHeight-16; else return document.body.clientHeight;}
function shiftX(o,x) {if(NN) o.left = x; else o.style.left = x}
function shiftY(o,y) {if(NN) o.top = y; else if(IE) o.style.top = y; else o.style.top = (y + 'px')}
function shiftTo(o,x,y) {if(NN) o.moveTo(x,y); else {o.style.left = x; o.style.top = y}}

function shiftBy(o,x,y) {if(NN) o.moveBy(x,y); else {o.style.pixelLeft += x; o.style.pixelTop += y}}

function sWidth(o,w) {if(NN) o.document.width = w; else o.style.width = w;}
function sHeight(o,h){if(NN) o.document.height = h; else o.style.height = h;}
function sAlpha(o,x) {if(NN||DOM) return; else eval(o.id + '.filters.alpha.opacity = ' + x)}
