//================================================
// 1k DHTML API
// serial#:20020202001
//================================================
// written by chris nott of dithered.com
//================================================
// modifications made by aaron of youngpup.net
// - "px" suffix on sW, sH, sX, and sY
// - gK (get kids)
// - sB (set background)
// - gP (getParent)
//================================================

d=document;l=(d.layers)?1:0;op=navigator.userAgent.toLowerCase().indexOf('opera')!=-1;cRE=/[^\d ]/g;
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){if(l)e.visibility='show';else e.style.visibility='visible';}
function hE(e){if(l)e.visibility='hide';else e.style.visibility='hidden';}
function sZ(e,z){if(l)e.zIndex=z;else e.style.zIndex=z;}
function sX(e,x){if(l)e.left=x;else if(op)e.style.pixelLeft=x;else e.style.left=x+"px";}
function sY(e,y){if(l)e.top=y;else if(op)e.style.pixelTop=y;else e.style.top=y+"px";}
function sW(e,w){if(l)e.clip.width=w;else if(op)e.style.pixelWidth=w;else e.style.width=w+"px";}
function sH(e,h){if(l)e.clip.height=h;else if(op)e.style.pixelHeight=h;else e.style.height=h+"px";}
function sC(e,t,r,b,x){if(l){X=e.clip;X.top=t;X.right=r;X.bottom=b;X.left=x;}else e.style.clip='rect('+t+'px '+r+'px '+b+'px '+x+'px)';}
function wH(e,h){if(l){Y=e.document;Y.write(h);Y.close();}if(e.innerHTML)e.innerHTML=h;}
function gK(e) {
	if (l) return e.layers;
	else {
		var a = [];
		var c = e.children || e.childNodes;
		for (var i = 0; i < c.length; i++) {
			if (c[i].tagName == "DIV") a[a.length] = c[i];
		}
		return a;
	}
}
function sB(e,i) {
	if (l) e.background.src = i;
	else e.style.backgroundImage = "url(" + i + ")";
}
function gP(e) {
	return l ? e.parentLayer : e.parent || e.parentNode;
}
function gC(e) {
	if (l) {
		with (e.clip) { return [top, right, bottom, left]; }
	}
	else {
		// i wonder how slow this is...
		// i figure it's faster than looping over the 
		// four elements and stripping the "px", but who knows.
		return e.style.clip.replace(cRE, '').split(" ");
	}
}