// browser ermitteln
var ie =  document.all ? 1 : 0;
var ns4 = document.layers ? 1 : 0;
var ns6 = document.getElementById && !document.all ? 1 : 0;


function MyLayer(id){

    if (ie)       { this.css = document.all(id).style; this.obj = document.all(id);}
	else if (ns4) { this.css = document.layers[id]; this.obj = document.layers[id]; }
	else if (ns6) { this.css = document.getElementById(id).style; this.obj = document.getElementById(id); }


  this.scrollHeight=ns4?this.css.document.height:this.obj.offsetHeight;
  this.clipHeight=  ns4?this.css.clip.height:this.obj.offsetHeight

  //methods
  this.clipTo = MyLayerClipTo;
  this.show   = MyLayerShow;
  this.hide   = MyLayerHide;

  //mit inhalt füllen
  if (ie)       { this.conref = document.all[id]; }
	else if (ns4) { this.conref = document.layers[id].document; }
	else if (ns6) { this.conref = document.getElementById(id); }
  this.fill   = MyLayerFill;

  this.place = MyLayerPlace;


}

function MyLayerFill(inhalt)
{
	if (ns4) {
		with(this.conref) {
			open();
			write(inhalt);
			close();
		}
	} else {
		this.conref.innerHTML = "";
		this.conref.innerHTML = "\n" + inhalt + "\n";
	}
}

function MyLayerShow()
{
	this.css.visibility = (ns4) ? "show" : "visible";
}

function MyLayerHide()
{
	this.css.visibility = (ns4) ? "hide" : "hidden";
}



function MyLayerClipTo(t,r,b,l)
{
	if (ns4) {
		this.css.clip.top = t;
		this.css.clip.right = r;
		this.css.clip.bottom = b;
		this.css.clip.left = l;
	} else {
		this.css.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)";
	}
}


function MyLayerPlace(xPos,yPos) {
	if (ie) {
		if (xPos != 'stay') this.css.pixelLeft = xPos;
		if (yPos != 'stay') this.css.pixelTop = yPos;
	}
	if (ns4||ns6) {
		if (xPos != 'stay') this.css.left = xPos;
		if (yPos != 'stay') this.css.top = yPos;
	}
}








