/************************************************************
	Layers manipulation module
	copyright (c) 2003 by Andy V. Kasatkin (aka taker)
	http://www.taker.ru, taker@mail.ru
************************************************************/

function layerRef(id) {
	return (browser.dom) ? document.getElementById(id) : ((browser.ie4) ? document.all[id] : ((browser.nn4) ? document.layers[id] : null));
}

function Layer(id) {
	this.id = id;
	this.element = layerRef(id);
	this.style = (this.element) ? ((browser.nn4) ? this.element : this.element.style) : null;
	this.ok = (this.style) ? true : false;
	this.xpos = 0; this.ypos = 0;
	this.show = (this.ok) ? layerShow : stub;
	this.hide = (this.ok) ? layerHide : stub;
	this.move = (this.ok) ? layerMove : stub;
	this.get = (this.ok) ? layerGet : stub;
	this.set = (this.ok) ? layerSet : stub;
}

function layerShow() { this.style.visibility = (browser.nn4) ? 'show' : 'visible'; }
function layerHide() { this.style.visibility = (browser.nn4) ? 'hide' : 'hidden'; }
function layerMove(x,y) { this.style.left = x; this.style.top = y; this.xpos = x; this.ypos = y; }
function layerGet(property) { return this.style[property]; }
function layerSet(property, value) { this.style[property] = value; }
function stub() { void(0) };

