function WSLayerAPI() {
	this.elDIv = null;
	this.style = null;

	this.initWSLayer = function( elDIV ) {
		this.elDIv = (this.NS4())? document.layers[elDIV] : (this.IE4())? document.all[elDIV] : (this.W3C())? document.getElementById(elDIV) : null;
		this.style = (this.NS4())? this.elDIv :(this.IE4() || this.W3C()) ? this.elDIv.style : null;
	}

	this.show = function() {
		if(this.NS4()) this.style.visibility = 'show';
		else this.style.visibility = 'visible';
	}

	this.hide = function() {
		if(this.NS4()) this.style.visibility = 'hide';
		else this.style.visibility = 'hidden';
	}

	this.getDivWidth = function(){
		var w = 0;
		try
		{
			if(this.NS4()) {
				w = (this.elDIv.document.width)? this.elDIv.document.width : this.elDIv.clip.width;
			} else if(this.IE5() || this.IE4()) {
				w = (this.style.pixelWidth)? this.style.pixelWidth : this.elDIv.offsetWidth;
			} else if(this.NS6()) {
				w = (this.style.width)? parseInt(this.style.width) : parseInt(this.elDIv.offsetWidth);
			} else if(this.W3C()){
				w = (this.style.pixelWidth)? this.style.pixelWidth : this.elDIv.offsetWidth;
			}	
		}
		catch (e) { w = 0; }	
		return w;
	}

	this.getDivHeight = function() {
		var h = 0;
		try
		{
			if(this.NS4()) {
				h = (this.elDIv.document.height)? this.elDIv.document.height : this.elDIv.clip.height;
			} else 	if(this.IE4() || this.IE5()) {
				h = (this.style.pixelHeight)? this.style.pixelHeight : this.elDIv.offsetHeight;
			} else if(this.NS6()) {
				h = (this.style.height)? parseInt(this.style.height) : parseInt(this.elDIv.offsetHeight);
			} else if(this.W3C()){
				h = (this.style.pixelHeight)? this.style.pixelHeight : this.elDIv.offsetHeight;
			}
		}
		catch (e) { h = 0; }
		return h;
	}

	this.moveTo = function(x,y) {
		if(this.NS4()) this.elDIv.moveTo(x,y);
		if(this.W3C() || this.IE4()) {		
			this.style.left=x+'px';		
			this.style.top=y+'px';
		}
	}

	this.writeDiv = function( text ) {
		if(this.OPERA6()) {
			return;
		} else if(this.NS4()){
			this.elDIv.document.open();
			this.elDIv.document.write(text);
			this.elDIv.document.close();
		} else if(this.W3C() || this.IE4() ) {
			this.elDIv.innerHTML = text;
		}
	}

	this.getDivLeft = function() {
		if(this.W3C()) return parseInt( this.style.left );
		else return 0;
	}

	this.getDivTop = function() {
		if(this.W3C()) return parseInt( this.style.top );
		else return 0;
	}

}

WSLayerAPI.prototype = new WSWindowApi();