<!--
/*-----
	Opjecte
*/

function newLay(id,width,height,zIndex,clip,top,left,bgcolor,findIn){
/*-----
	Eigenschaften
*/
	this.label = id;
	this.findIn = findIn;
	this.htmadr = "";	
	this.width = width;
	this.height = height;
	this.zIndex = zIndex;
	this.clip = clip;
	this.ptop = top;
	this.pleft = left;
	this.bgcolor = bgcolor;
	//this.ItemList = new Array(0);
	
/*-----
	Methoden
*/
	//this.add = addItem;
	this.setEl = setNewLayElement;
	this.getEl = getElement;
	this.pos = getElementPos;
	this.setPos = setElementPos;
	this.size = getElementSize;
	this.setSize = setElementSize;
	this.setVisi = setElementVisibility;
	this.fill = setElementContent;
	this.print = printLay;
	
	this.setEl();
}

/*-----
	browser check
*/

var browser;
with(navigator){
if (parseInt(appVersion) == 4 && userAgent.indexOf("MSIE") != -1){
	browser = "MSIE4x";
}
if (parseInt(appVersion) == 4 && appName == "Netscape"){
	browser = "NN4";
}
if (parseInt(appVersion) >= 5 && appName == "Netscape"){
	browser = "NN5+";
}
if ((appVersion.indexOf("MSIE 5") != -1 || appVersion.indexOf("MSIE 6") != -1 ) && userAgent.indexOf("MSIE") != -1){
	browser = "MSIE5";
}

var Mac = new Boolean();
if(appVersion.indexOf("Mac")!= -1)  Mac = true; 
}
/*-----
	browser check end
*/

/*-----
	helpfunctions
*/

function setNewLayElement()
{
switch(browser){
		case "MSIE4x":
			this.htmadr = eval("document.all." + this.label);
			break;
		case "NN4":
			this.htmadr = createLayer(this.label,null,this.pleft,this.ptop,this.width,this.height,'',this.bgcolor,'show',this.zIndex)
			break;
		case "MSIE5":
		case "NN5+":
			nLay = document.createElement("div");
			nLay.id = this.label;
			nLay.style.left = "0px";
			nLay.style.top = "0px";
			nLay.style.width = "0px";
			nLay.style.height = "0px";
			var bo = document.body;
			bo.appendChild(nLay);
			this.getEl();
			this.htmadr.style.position = "absolute";
			if(this.bgcolor != null) this.htmadr.style.background = this.bgcolor;
			this.htmadr.style.width = this.width;
			this.htmadr.style.height = this.height;
			this.htmadr.style.top = this.ptop;
			this.htmadr.style.left = this.pleft;
			//this.htmadr.style.clip = this.clip;
			this.htmadr.style.zindex = this.zIndex;

			break;
	}

}

function createLayer(id,nestref,left,top,width,height,content,bgColor,visibility,zIndex) {
		if (nestref) {
			var lyr = eval("document."+nestref+".document."+id+" = new Layer(width, document."+nestref+")")
		}
		else {
			var lyr = document.layers[id] = new Layer(width)
			eval("document."+id+" = lyr")
		}
		lyr.name = id
		lyr.left = left
		lyr.top = top
		if (height!=null) lyr.clip.height = height		
		if (bgColor!=null) lyr.bgColor = bgColor
		lyr.visibility = (visibility=='hidden')? 'hide' : 'show'
		if (zIndex!=null) lyr.zIndex = zIndex
		if (content) {
			lyr.document.open()
			lyr.document.write(content)
			lyr.document.close()
		}
		return lyr;
}

function getElement(){
	switch(browser){
		case "MSIE4x":
			this.htmadr = eval("document.all." + this.label);
			break;
		
		case "NN4":
			this.htmadr = searchLayer(document.layers,this.label);
			break;
		case "MSIE5":
		case "NN5+":
			this.htmadr = document.getElementById(this.label);
			break;
	}
}

function searchLayer(sbase,label) {
	for(var i = 0; i < sbase.length; i++) {
		if(sbase[i].name == label) {
			return sbase[i];
		}
		if(sbase[i].document.layers.length > 0){
			return searchLayer(sbase[i].document.layers,label);
		}
	}
}

function getDocSize(){
with(window){
	switch(browser){
		case "MSIE5":
		case "MSIE4x":
			return [document.body.clientWidth,document.body.clientHeight];
			break;
		
		case "NN4":
			return [innerWidth,innerHeight];
			break;
		
		case "NN5+":
			return [innerWidth,innerHeight];
			break;
	}
}
}

function getElementPos(){
with(this.htmadr){
	switch(browser){
		case "MSIE5":
		case "MSIE4x":
			return [parseInt(style.top),parseInt(style.left)];
			break;
		
		case "NN4":
			return [parseInt(top),parseInt(left)];
			break;
		
		case "NN5+":
			return [parseInt(style.top),parseInt(style.left)];
			break;
	}
}
}


function setElementPos(){
var params = setElementPos.arguments;
var ntop = params[0];
var nleft = params[1];

with(this.htmadr){
	switch(browser){
		case "MSIE5":
		case "MSIE4x":
			style.top = ntop;
			style.left = nleft;
			break;
		
		case "NN4":
			top = ntop;
			left = nleft;
			
			break;
		
		case "NN5+":
			// (km() for stnadard compliance mode we need px-values !!
			style.top = ntop +"px";
			style.left = nleft+"px";
			break;
	}
}
}

function getElementSize(){
with(this.htmadr){
	switch(browser){
		case "MSIE5":
		case "MSIE4x":
			return [parseInt(style.width),parseInt(style.height),parseInt(offsetWidth),parseInt(offsetHeight),parseInt(offsetWidth),parseInt(offsetHeight)];
			break;
		
		case "NN4":
			return [document.width,document.height,document.width,document.height,clip.width,clip.height];
			break;
		
		case "NN5+":
			return [parseInt(style.width),parseInt(style.height),parseInt(offsetWidth),parseInt(offsetHeight),160,100];
			break;
	}
}
}

function setElementSize(){
var params = setElementSize.arguments;
var width = params[0];
var height = params[1];

with(this.htmadr){
	switch(browser){
		case "MSIE5":
		case "MSIE4x":
			style.width = width;
			style.height = height;
			break;
		
		case "NN4":
			width = width;
			clip.height = height;
			break;
		
		case "NN5+":
			style.width = width;
			style.height = height;
			break;
	}
}
}

function setElementVisibility(){
var params = setElementVisibility.arguments;
var visi = params[0];
with(this.htmadr){
	switch(browser){
		case "MSIE5":
		case "MSIE4x":
			var hos = new Array("hidden","visible");
			style.visibility = hos[visi];
			break;
		
		case "NN4":
			var hos = new Array("hidden","visible");
			visibility = hos[visi];
			break;
		
		case "NN5+":
			var hos = new Array("hidden","visible");
			style.visibility = hos[visi];
			break;
	}
}
}

function setElementContent(){
var params = setElementContent.arguments;
var content = params[0];
with(this.htmadr){
	switch(browser){
		case "MSIE5":
		case "MSIE4x":
			innerHTML = content;
			break;
		
		case "NN4":
			document.open();
			document.write(content);
			document.close();
			break;
		
		case "NN5+":
			innerHTML = content;
			break;
	}
}
}
var msgwin = 0;

function printLay() {
	//if(!msgwin){
	var features = "locationbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,dependent=yes,alwaysRaised=yes,directories=no,width=300,height=250,screenX=0,screenY=0,left=0,top=0";
	msgwin =  window.open("","msgwin",features);
	//}

 	jetzt = new Date();
 	
	msgwin.document.writeln("<B><font size='3' face='Arial,Helvetica,Geneva,Sans-Serif'>" + this.label + "</font></B> <font color='blue' size='1' face='Arial,Helvetica,Geneva,Sans-Serif'>(" + jetzt.toLocaleString() + ")</font>:<br>");
	msgwin.document.writeln("<font size='1' face='Arial,Helvetica,Geneva,Sans-Serif'>Top:</font> <font color='green' size='1'>" + this.pos()[0] + "</font><br>");
	msgwin.document.writeln("<font size='1' face='Arial,Helvetica,Geneva,Sans-Serif'>Left:</font> <font color='green' size='1'>" + this.pos()[1] + "</font><br>");
	msgwin.document.writeln("<font size='1' face='Arial,Helvetica,Geneva,Sans-Serif'>Width:</font> <font color='green' size='1'>" + this.size()[2] + "</font><br>");
	msgwin.document.writeln("<font size='1' face='Arial,Helvetica,Geneva,Sans-Serif'>Height:</font> <font color='green' size='1'>" + this.size()[3] + "</font><br>");
	msgwin.document.writeln("<font size='1' face='Arial,Helvetica,Geneva,Sans-Serif'><hr><a href='#top'>top</a>&nbsp;&nbsp;<a href='JavaScript:close();'>close</a><hr></font><br><br>");
}
//-->
