function LayerErzeugen()
{
	this.Box;
	this.Geschwindigkeit = 20;
	this.Fade = false;
	this.Ausblenden = false;
	this.AusblendBox = "AusblendEbene";
	
	this.getPageSize = function()
	{
	
		var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
	
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
		return arrayPageSize;
	}
	
	
	//Transparenz Effekt
	OpacityRunter = function ()
	{
		if(!document.all)
		{
			document.getElementById(tempBox).style.opacity = Staerke / 100;
			document.getElementById(tempBox).style.filter = "alpha(opacity="+Staerke+")";
			document.getElementById(tempBox).style.mozopacity = Staerke / 100;
			if(Staerke < 99)
			{
			Staerke +=30;
			}
			else
			{
			clearInterval(x);
			Staerke = 100;
			}
		}
		else
		{
			clearInterval(x);
			Staerke = 100;
			document.getElementById(tempBox).style.opacity = Staerke / 100;
			document.getElementById(tempBox).style.filter = "alpha(opacity="+Staerke+")";
			document.getElementById(tempBox).style.mozopacity = Staerke / 100;
		}
	}
	OpacityRauf = function ()
	{
		if(!document.all)
		{
			document.getElementById(tempBox).style.opacity = Staerke / 100;
			document.getElementById(tempBox).style.filter = "alpha(opacity="+Staerke+")";
			document.getElementById(tempBox).style.mozopacity = Staerke / 100;
			if(Staerke > 10)
			{
			Staerke -=30;
			}
			else
			{
			clearInterval(y);
			Staerke = 10;
			document.getElementById(tempBox).style.display = 'none';
			document.getElementById(tempBox).style.opacity = "0.0";
			document.getElementById(tempBox).style.filter = "alpha(opacity=0)";
			document.getElementById(tempBox).style.mozopacity = "0.0";
			}
		}
		else
		{
			clearInterval(y);
			Staerke = 10;
			document.getElementById(tempBox).style.display = 'none';
			document.getElementById(tempBox).style.opacity = "0.0";
			document.getElementById(tempBox).style.filter = "alpha(opacity=0)";
			document.getElementById(tempBox).style.mozopacity = "0.0";
		}
	}
	
	this.Opacweg = function ()
	{
		Staerke = 10;
		tempBox = this.Box;
		x = setInterval(OpacityRunter, this.Geschwindigkeit);
		document.getElementById(this.Box).style.display = 'block';
	}
	this.Opacdazu = function ()
	{
		Staerke = 100;
		tempBox = this.Box;
		y = setInterval(OpacityRauf, this.Geschwindigkeit);
	}
	//Div ein, ausblenden
	this.LayerAnzeigen = function ()
	{
		this.Event = function()
		{
			this.LayerAusblenden();
		}
		//Ausblend Ebene Erzeugen
		if(this.Ausblenden==true) 
		{
			FensterSizes = this.getPageSize()
			document.getElementById(this.AusblendBox).style.height = FensterSizes[1]+"px";
			document.getElementById(this.AusblendBox).style.display = "block";
		}
		
		if(this.Fade==true)
			this.Opacweg();
		else
			document.getElementById(this.Box).style.display = 'block';
	}
		
	this.LayerAusblenden = function ()
	{	
		this.Event = function()
		{
			this.LayerAnzeigen();
		}
		//Ausblend Ebene Entfernen
		if(this.Ausblenden==true) document.getElementById(this.AusblendBox).style.display = "none";
		//
		if(this.Fade==true)
			this.Opacdazu();
		else
			document.getElementById(this.Box).style.display = 'none';
	}
	
	this.Event = function()
	{
		this.LayerAnzeigen();
	}
}