var opera   =  !!(document.getElementById && !document.documentElement);
var ie      =  !!document.all;
var dom     =  !!document.getElementById;
var mac     =  !!(navigator.userAgent.indexOf("Mac")!=-1);

function xGetEId(e) {
	if (typeof(e) != 'string') return e;
	e = (document.getElementById) ? document.getElementById(e)
		: (document.all)          ? document.all[ e ]
		: (document.layers)       ? xLayer(e)
		: null;
	return e;
}

function xGetEIdSt(e) {
	e = xGetEId(e);
	if (e != null) return document.layers ? e : e.style;
	return null;
}

function xLayer(id, base) { 
	var i, layer, found = null;
	if (!base) base = window;
	for (i=0; i < base.document.layers.length; i++) {
		layer = base.document.layers[i];
		if (layer.id == id)	return layer;
		if (layer.document.layers.length) found = xLayer(id, layer);
		if (found) return found;
	}
	return null;
}

function iHeight() {
	if (window.innerHeight) return window.innerHeight;
	if (document.compatMode && document.compatMode == "CSS1Compat") return document.documentElement.offsetHeight - 5;
	if (document.body && document.body.offsetHeight) return document.body.offsetHeight - 4;
	return 0;
}

function iWidth() {
	if (window.innerWidth) return window.innerWidth;
	if (document.compatMode && document.compatMode == "CSS1Compat") return document.documentElement.offsetWidth - 4;
	if (document.body && document.body.offsetWidth) return document.body.offsetWidth - 4;
	return 0;
}

function lnavHide() {
	var olnav = xGetEId ("lnav");
	var img = olnav.src;
	imgSwap('lnav', olnav.src.replace(/jpg/, "gif"));
	setTimeout ("imgSwap('lnav', '"+img+"')", 2000);
}

function imgSwap(mid, img) {
	var oimg = xGetEId (mid);
	oimg.src = img;
}

function cssSwap(mid, css) {
	var ocss = xGetEId (mid);
	ocss.style.color = css;
}
function txtSwap(mid, txt) {
	var otxt = xGetEId (mid);
	otxt.innerHTML = txt;
}

