// Neue Layer werden mit: var MyEbene= new Layer("Layer1"); erzeugt.
// Der Layer muss in HTML definiert sein als:
// <div id=Layer1 style="position:absolute;"></div>
// Danach stehen die Routinien:
// MyEbene.BgColor, MyEbene.Left, MyEbene.Top,
// MyEbene.Write, MyEbene.Hide, MyEbene.Show
// zur Verfügung. 

var IsDoneWarning = false;

function Warning()
{
	if (IsDoneWarning) return;
	alert ("Teile dieser Seite funktionieren mit JavaScript.\nBitte verwenden Sie einen der folgenden Browser:\n\nMS-Internet Explorer\nNetscape Communicator.");
	IsDoneWarning=true;
}

function Layer(pName)
{
	this.Name=pName;
	this.BgColor=LBgColor;
	this.Show=LShow;
	this.Hide=LHide;
	this.Top=LTop;
	this.Left=LLeft;
	this.Write=LWrite;
	this.Clip=LClip;
}

function LBgColor(color)
{
	if (document.all) document.all[this.Name].style.backgroundColor=color
	else if (document.layers) document.layers[this.Name].bgColor=color
	else if (document.getElementById) document.getElementById(this.Name).style.backgroundColor=color
	else Warning();
}

function LShow()
{
	if (document.all) document.all[this.Name].style.visibility = "visible"
	else if (document.layers) document.layers[this.Name].visibility = "show"
	else if (document.getElementById) document.getElementById(this.Name).style.visibility = "visible"
	else Warning();
}

function LHide()
{
	if (document.all) document.all[this.Name].style.visibility = "hidden"
	else if (document.layers) document.layers[this.Name].visibility = "hide"
	else if (document.getElementById) document.getElementById(this.Name).style.visibility = "hidden"
	else Warning();
}

function LTop(x)
{
	if (document.all) document.all[this.Name].style.top = x
	else if (document.layers) document.layers[this.Name].top = x
	else if (document.getElementById) document.getElementById(this.Name).style.top = x
	else Warning();
}

function LLeft(x)
{
	if (document.all) document.all[this.Name].style.left = x
	else if (document.layers) document.layers[this.Name].left = x
	else if (document.getElementById) document.getElementById(this.Name).style.left = x
	else Warning();
}

function LWrite(str)
{
	if (document.all) document.all[this.Name].innerHTML = str
	else if (document.layers) {document.layers[this.Name].document.open(); document.layers[this.Name].document.write(str); document.layers[this.Name].document.close();}
	else if (document.getElementById) document.getElementById(this.Name).innerHTML = str
	else Warning();
}

function LClip(left, top, right, bottom)
{
	if (document.all) document.all[this.Name].style.clip = 'rect(' + top + ' ' +  right + ' ' + bottom + ' ' + left +')'
	else if (document.layers) {document.layers[this.Name].clip.left = left; document.layers[this.Name].clip.top = top; document.layers[this.Name].clip.bottom = bottom; document.layers[this.Name].clip.right = right;}
	else if (document.getElementById) document.getElementById(this.Name).style.clip = 'rect(' + top + ' ' +  right + ' ' + bottom + ' ' + left +')'
	else Warning();
}
