

function Layer( layerName ){
	this.layerName = layerName;

	if( document.all ){
		this.layer = document.all[ this.layerName ];
		this.style = this.layer.style;
	}

	if( document.getElementById ){
		this.layer = document.getElementById( this.layerName );
		this.style = this.layer.style;
	}

	if( document.layers ){
		this.layer = document.layers[ this.layerName ];
		this.style = this.layer;
	}
	
	this.hide = hide;
	this.show = show;
	this.isVisible = isVisible;
	this.style.xpos = parseInt(this.style.left)
	this.style.ypos = parseInt(this.style.top)
	this.left = left;
	this.top = top;
	this.setLeft = setLeft;
	this.setTop = setTop;
	this.write = write;
	
}

// object function
function isVisible(){
	if( document.all || document.getElementById ){
		if( this.style.visibility == "hidden" ){
			return  false; 
		}else{
			return true; 
		}
	}
	if( document.layers ){
		if( this.style.visibility == "hide" ){
			return false; 
		}else{
			return true; 
		}
	}
}

// object function
function hide(){
	if( document.all || document.getElementById ){
		this.style.visibility = "hidden";
	}
	if( document.layers ){
		this.style.visibility = "hide";
	}
}

// object function
function show(){
	if( document.all || document.getElementById ){
		this.style.visibility = "visible";
	}
	if( document.layers ){
		this.style.visibility = "show";
	}
}

// object function
function left(){
	return parseInt( this.style.xpos );
}

// object function
function top(){
	return parseInt( this.style.top );
}

// object function
function setLeft( xpos ){
	this.style.xpos = xpos;
	this.style.left = this.style.xpos;
}

// object function
function setTop( ypos ){
	this.style.ypos = ypos;
	this.style.top = this.style.ypos;
}

// object function
function write( text ){

	if( typeof( this.layer.innerHTML ) != 'undefined' ) {
		this.layer.innerHTML = text;
	}else if( document.layers ) {
		this.layer.document.open();
		this.layer.document.write( text );
		this.layer.document.close();
	}else{
		if( document.all ){
			this.layer.innerHTML = text;
		}
		
	}
	
}	





