
	
	

	
	
	/* CHANGE STYLE 
	if(this.location.href.indexOf("TextGrosse=0")>-1) {
		document.write('<link rel="stylesheet" href="css/ChangeStyle10.css" type="text/css">')
	} else if(this.location.href.indexOf("TextGrosse=2")>-1) {
		document.write('<link rel="stylesheet" href="css/ChangeStyle12.css" type="text/css">')
	} else {
		document.write('<link rel="stylesheet" href="css/ChangeStyle11.css" type="text/css">')
	}*/

function cm_bwcheck(){
	//In theory we should use object detection, but this script needs work-arounds for almost every browser...
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent.toLowerCase()
	this.dom=document.getElementById?1:0
	this.ns4=(!this.dom && document.layers)?1:0;
	this.ns47=(this.ns4 && (this.ver.search(/^4.7/))==0 )?1:0;
	this.ns7 = (this.agent.indexOf("netscape/7")>-1)?1:0;
	this.op=window.opera 
	this.moz=(this.agent.indexOf("gecko")>-1 || window.sidebar)
	this.ie=this.agent.indexOf("msie")>-1 && !this.op
	if(this.op){
		this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1)
		this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1)
		this.op7=this.dom&&!this.op5&&!this.op6 //So all higher opera versions will use it
	}else if(this.moz) this.ns6 = 1
	else if(this.ie){
		this.ie4 = !this.dom && document.all
  	this.ie5 = (this.agent.indexOf("msie 5")>-1)
  	this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
  	this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55
	}
	this.mac=(this.agent.indexOf("mac")>-1)
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7)
  this.usedom= this.ns6||this.op7//Use dom creation
  this.reuse = this.ie||this.op7||this.usedom //Reuse layers
  this.px=this.dom&&!this.op5?"px":""
	return this
}
var bw=new cm_bwcheck()
// start the x pos
var pos=15;
//flag for one div if he is open 1
var picLayer = new Array();
//timerID = 0
var timerID = new Array();
var selectID = new Array();

var RollOverCollor = "#D9EDD4";
var ParentBorder = "1px solid #000000";
var ParentWidth = "193";
var ParentTop = "144";
if(bw.mac&&bw.ie)
	var ParentTop = "146";

var ParentBackground = "#ffffff";

// set the position of the layers
function makePosition(img) {
	for(i=0; i<img.length; i++) {
		if(bw.ie4 || (bw.mac && bw.ie) ) {
			document.all['sub'+i].style.left = pos;
			document.all['dumsub'+i].style.left = pos;
		}
		else if(bw.ns4) {
			document.layers['sub'+i].left += pos;
			document.layers['dumsub'+i].left += pos;

			document.layers['sub'+i].onmouseout=hideNN;
			document.layers['sub'+i].onmouseover=showNN;
			
			document.layers['dumsub'+i].onmouseover=showNN;
			if(!bw.ns47)
				document.layers['dumsub'+i].onmouseout=hideNN;
		}
		else {
			document.getElementById('sub'+i).style.left += pos;
			document.getElementById('dumsub'+i).style.left += pos;
		}
		pos += document.images['roll'+i].width+1;
	}
	
	///alert(document.layers['sub4'].document.images[0].length)
}
// change the to rollover image
function changeImg(i) {
	if(timerID[i])
		clearTimeout(timerID[i]);
	
	if(picLayer[i] != 1) {
		if(bw.ie4) {
			if(menu.chi[i].length>2) {
			document.all['sub'+i].style.visibility = "visible";
			document.all['dumsub'+i].style.visibility = "visible";
			}
			oImg = eval('roll'+i);
			if(oImg.src != rollAImg[i])
				oImg.src = rollAImg[i];
		}
		else if(bw.ns4) {
			// clear all other
			for(iz=0; iz<menu.counter; iz++) {
				if(iz!=i) {
					document.layers['sub'+iz].visibility = "hide";
					document.layers['dumsub'+iz].visibility = "hide";
					document.images['roll'+iz].src = aImg[iz]
				}
			}
			if(menu.chi[i].length>2) {
			document.layers['sub'+i].visibility = "show";
			document.layers['dumsub'+i].visibility = "show";
			}
			oImg = document.images['roll'+i];
			if(oImg.src != rollAImg[i])
				oImg.src = rollAImg[i];
			
		}
		else {
			oImg = document.getElementById('roll'+i);
			oImg.setAttribute("src", rollImg[i].src)
			
			if(menu.chi[i].length>2) {
			document.getElementById('sub'+i).style.visibility = "visible";
			document.getElementById('dumsub'+i).style.visibility = "visible";
			}
		}
	}
	setTimeout('hideSelect()', 10);
	picLayer[i] = 1;
}

function hideSelect() {
	if(!bw.ns4)  {
		if(document.forms['MainForm']) {
			for(iForm=0; iForm<document.forms['MainForm'].length; iForm++) {
				selObj = document.forms['MainForm'][iForm]
				if(selObj.options)
					selObj.style.visibility="hidden";
			}//for
		}
	} else {
		if(document.layers['mainFormLayer']) 
			document.layers['mainFormLayer'].visibility="hide";
	}//if form
}//hideSelect()

function showSelect() {
	if(!bw.ns4)  {
		if(document.forms['MainForm']) {
			for(iForm=0; iForm<document.forms['MainForm'].length; iForm++) {
				selObj = document.forms['MainForm'][iForm]
				if(selObj.options)
					selObj.style.visibility="visible";
			}//for
		}
	} else {
		if(document.layers['mainFormLayer']) 
			document.layers['mainFormLayer'].visibility="show";
	}//if form
}//showSelect()

// change rollover image to normal one
function changeImgBack(i) {
	timerID[i] = setTimeout('changeImgB('+i+')',10);
}

function clearTimeOut(i) {
	clearTimeout(timerID[i]);
}
	

function changeImgB(i) {
		showSelect();
		if(bw.ie4 || (bw.mac && bw.ie) ) {
			document.all['sub'+i].style.visibility = "hidden";
			document.all['dumsub'+i].style.visibility = "hidden";
			oImg = eval('roll'+i);
		}
		else if(bw.ns4) {
			document.layers['sub'+i].visibility = "hide";
			document.layers['dumsub'+i].visibility = "hide";
			oImg = document.images['roll'+i];
		}
		else {
			document.getElementById('sub'+i).style.visibility = "hidden";
			document.getElementById('dumsub'+i).style.visibility = "hidden";
			oImg = document.getElementById('roll'+i);
			oImg.setAttribute("src", aImg[i])
		}
		
		if(oImg.src!=aImg[i])
			oImg.src = aImg[i];
	timerID[i] = null;
	picLayer[i] = 0;
}

function showNN() {
		if (this.id.search(/^dumsub/)==0)
			clearTimeOut(this.id.replace("dumsub", ""));
		else 
			clearTimeOut(this.id.replace("sub", ""));
	}
		
function hideNN(e) {
		if (this.id.search(/^dumsub/)==0)
			changeImgBack(this.id.replace("dumsub", ""));
		else
			changeImgBack(this.id.replace("sub", ""));
	}

function changeColor(p,i) {
	if(bw.mac && bw.ie) {
		document.all['tdA'+p+''+i].style.background=RollOverCollor;
		//document.all['tdB'+p+''+i].style.background="#006699";
		return;
	}
	if(!bw.ns4 && bw.dom) {
		document.getElementById('tdA'+p+''+i).className="SOver"
		return;
	}
	if(bw.ns4){
		document.layers['sub'+p].document.layers['tdA'+p+''+i].document.bgColor=RollOverCollor;
		//document.layers['sub'+p].document.layers['tdB'+p+''+i].document.bgColor='#006699';
		return;
	}
}
function clearAllRollOvers(p) {
	for(i=0;i<menu.chi[p].length;i++) {
		if( !bw.ns4 && bw.dom && !(bw.mac && bw.ie) ) {
			if(i!=0 && (i+1)<menu.chi[p].length)
			document.getElementById('tdA'+p+''+i).className="S"
		}
		else if(bw.mac && bw.ie) {
			if(i>0 && i<menu.chi[p].length-1) {
				document.all['tdA'+p+''+i].style.background=ParentBackground;
		 		//document.all['tdB'+p+''+i].style.background='#AAB9C9';
			}
		}
		else if(bw.ns4) {
			document.layers['sub'+p].document.layers['tdA'+p+''+i].document.bgColor=ParentBackground;
			if(i>0 && i<menu.chi[p].length-1) {
			//document.layers['sub'+p].document.layers['tdB'+p+''+i].document.bgColor='#AAB9C9';
			}
		}//if
	}//for
}//clearAllRollOvers



function createChilde(p, id, txt, desc, url, height, align){
	if(bw.mac && bw.ie) {
		if(txt!='') {
			///u="document.href='"+url+"'";
			cdStr ='<div id="tdA'+p+''+id+'" onmouseover="changeColor('+p+','+id+')" onmouseout="clearAllRollOvers('+p+')" onClick="document.location.href='+"'"+url+"'"+'" style="widht: '+(ParentWidth-2)+'px; background-color : '+ParentBackground+'; padding-left: 10px;  font-family: Arial, Helvetica; font-size: 11px; color: #000000; text-decoration: none; cursor:pointer; cursor:hand;" title="'+desc+'"><img src="""images/leer.gif""" width="165" height="2"><br>'+txt+'<br><img src="""images/leer.gif""" width="165" height="2"></div>';
			cdStr +='<div id="tdB'+p+''+id+'" onmouseover="changeColor('+p+','+id+')" onmouseout="clearAllRollOvers('+p+')"  onClick="document.location.href='+"'"+url+"'"+'" style="widht: '+(ParentWidth-2)+'px; background-color : '+ParentBackground+'; padding-left: 10px; cursor:pointer; cursor:hand;" title="'+desc+'"><img src="""../images/leer.gif""" width="152" height="1"></div>';
		} else
			return "";
	}
	else if(bw.ns4 && !bw.dom ) {
		if(txt) {
		cdStr ='<div id="tdA'+p+''+id+'" name="tdA'+p+''+id+'"  class="SNN"><a href="'+url+'" class="NavHead2" title="'+desc+'">'+txt+'</a></div>';
		cdStr +='<div id="tdB'+p+''+id+'" name="tdB'+p+''+id+'" class="SNNdummy"><a href="'+url+'" title="'+desc+'"><img src="""../images/leer.gif""" width="132" height="1" border="0"></a></div>';
		} else {
			if(align=="bottom")
				paddTop = '<img src="../images/leer.gif" width="'+(ParentWidth)+'" height="'+(height-1)+'"><img src="../images/blue.gif" width="'+(ParentWidth)+'" height="1">'
			else 
				paddTop = '<img src="../images/blue.gif" width="'+(ParentWidth)+'" height="1"><img src="../images/leer.gif" width="'+(ParentWidth)+'" height="'+(height-1)+'">'
			
			cdStr ='<div id="tdA'+p+''+id+'" name="tdA'+p+''+id+'" class="SNN" style="padding-left: 0px;">'+paddTop+'</div>';
		}
	}
	else {
		pDiv = document.getElementById("sub"+p);
		cDiv = document.createElement("DIV")
		
		if(txt) {
			//inster space betwean a text and upper and lower ITEM
			cDiv.innerHTML += '<img src="images/leer.gif" width="165" height="2"><br>'+txt+'<br><img src="images/leer.gif" width="165" height="2">';
			
			if(bw.ns7)
				cDiv.onmouseover= function (e) { clearAllRollOvers(p); changeColor(p,id); } 
			else
				cDiv.onmouseover= function (e) {  changeColor(p,id); } 
				
			cDiv.onmouseout= function (e) { clearAllRollOvers(p) }
			cDiv.onclick= function (e) { document.location.href=url; } 
			cDiv.className="S";
		} else {
			cDiv.innerHTML = '<img src="../images/leer.gif" width="130" height="'+(height-1)+'" border="0">';
			cDiv.className="Sdummy";
		}
		cDiv.display="none";
		cDiv.cursor="hand";
		cDiv.id = 'tdA'+p+""+id;
		cDiv.title=desc
		
		pDiv.appendChild(cDiv);
		cDiv.style.height=cDiv.offsetHeight;
		return "";
	} 
	
	return cdStr;
}			

function Child(p, id, txt, desc,url, height, align) {
	this.id=id;
	this.url=url;
	this.txt=txt;
	this.desc=desc;
	this.dStr=createChilde(p, id, txt, desc,url, height, align);
}


function createParent(id){
	if(bw.ns4) { cssStr = "SubMNN" } else { cssStr = "SubM" }
	if(bw.mac && bw.ie) {
		var cdStr = '<div id="dumsub'+id+'" name="dumsub'+id+'" onmouseover="clearTimeOut('+id+')" onmouseout="changeImgBack('+id+');" style="position : absolute; width : '+ParentWidth+'px; height: 2px; top : '+ParentTop+'px; left :  0px;  z-index : 1; visibility : hidden;"><img src="../images/leer.gif" title="" width="'+ParentWidth+'" height="2"></div>';
		cdStr += '<div id="sub'+id+'" onmouseover="clearTimeOut('+id+')" onmouseout="changeImgBack('+id+');" style="position : absolute; width: '+(ParentWidth)+'px; top : '+ParentTop+'px; left :  0px; background-color : '+ParentBackground+'; border-width : 1px;  border-style : solid; border-color : #000000; z-index : 90; visibility : hidden;">';
		cdStr += '<div style="widht: '+(ParentWidth-2)+'px; height: 4px; layer-background-color: '+ParentBackground+';"><img src="../images/leer.gif" title="" id="dummyimage" width="'+(ParentWidth-2)+'" height="4"></div>';
	} 
	else if(!bw.dom) {
		var cdStr = '<div id="dumsub'+id+'" name="dumsub'+id+'" onmouseover="clearTimeOut('+id+')" onmouseout="changeImgBack('+id+');" class="subDummy"><img src="../images/leer.gif" title="" width="'+ParentWidth+'" height="2"></div>';
		cdStr += '<div id="sub'+id+'" onmouseover="clearTimeOut('+id+')" onmouseout="changeImgBack('+id+');" class="'+cssStr+'">';
		cdStr += '<div style="widht: '+ParentWidth+'px; height: 7px; layer-background-color: '+ParentBackground+';"><img src="../images/leer.gif" title="" id="dummyimage" width="'+(ParentWidth-2)+'" height="4"></div>';
	} else {
		// add a dummy 
		pdDiv = document.createElement("DIV");
		pdDiv.innerHTML = '<img src="../images/leer.gif" title="" width="154" height="2">'
		pdDiv.className="subDummy"
		pdDiv.onmouseover= function (e) { clearTimeOut(id) }
		pdDiv.onmouseout= function (e) { changeImgBack(id) }
		
		pdDiv.id = "dumsub"+id;
		document.body.appendChild(pdDiv);
		
		pDiv = document.createElement("DIV");
		pDiv.id = "sub"+id;
		pDiv.style.position="absolute";
		
		// if there is a border width at NN has to be 2px smaler 
		BrowserParentWidth = (bw.dom&&!bw.ie) ? ParentWidth-2 : ParentWidth;
		
		pDiv.style.width=	BrowserParentWidth+"px";
		pDiv.style.border = ParentBorder;
		pDiv.style.top=		ParentTop+"px";
		pDiv.style.visibility="hidden";
		pDiv.onmouseover=function (e) { clearTimeOut(id) }
		pDiv.onmouseout=function (e) { changeImgBack(id) }
		pDiv.style.backgroundColor=ParentBackground;
	
		//pDiv.setAttribute("style", "position : absolute; width : 154px; top : 195px; left :  0px; background-color : #E4E9EF; layer-background-color : #E4E9EF; border-width : 1px; border-style : solid; border-color : #AAB9C9; z-index : 90; display : none;");
		document.body.appendChild(pDiv);
		return "";
	}
	return cdStr;
 }
 
 function createEndParent(){
	return '<div style="widht: '+ParentWidth+'px; height: 7px;><img src="../images/leer.gif" title="" id="dummyimage" width="'+ParentWidth+'" height="7"></div></div></div>';
}

function Parent(id) {
	this.id='par'+id;
	//this.childrens=0;
	this.dStr=createParent(id);
	
	if(!bw.dom || (bw.mac && bw.ie) ) {
	this.endStr=createEndParent();
	}
}

function Menu() {
	//parent array
	this.par = new Array();
	// children two dimensional array[par][child];
	this.chi = new Array();
	
	//to create parent and child
	this.parent = MakeMP;
	this.child 	= MakeMC;
	//this.par.length shorter
	this.counter=0;
}
function MakeMP(id) {
	this.par[id] = new Parent(id);
	this.chi[id] = new Array();
	this.counter++;
}//Menu
function MakeMC(p, id, txt, desc, url, height, align) {
	this.chi[p][id] = new Child(p, id, txt, desc, url, height, align);
}//Menu

	



function init() {
	if(!bw.dom || (bw.mac && bw.ie) ) {
		for(i=0; i<menu.counter; i++) {
			var str="";
			str += menu.par[i].dStr
				for(z=0; z<menu.chi[i].length; z++) {
					str += menu.chi[i][z].dStr;
				}//for z
			str += menu.par[i].endStr; 

			if(bw.ns4) {
				document.write(str);
				organizeLayers(i)
			}
			else { 
				document.write(str);
				if(bw.mac)
					organizeMacLayers(i)
			}
		}//for i 
	}//if(!dom)
}//init

function organizeMacLayers(ip) {
	macDivHeight=4;
	for(ci=0; ci<menu.chi[ip].length; ci++) {
		if( ci>0 && ci<(menu.chi[ip].length-1) ) {
		 	macDivHeight=macDivHeight+document.all['tdA'+ip+""+ci].clientHeight+1;
			//document.all['tdA'+ip+""+ci].onclick= function { window.document.location.href= }
		}
	}//for
	document.all['sub'+ip].style.height=(macDivHeight+7);
	
}

function organizeLayers(ip){
	pInt = 'sub'+ip;
	//..length/2 because he has this litle blue line
	oLay = document.layers[pInt].document.layers;
	var iPositonLayer=0;
	var str="";
	for(ci=0; ci<menu.chi[ip].length; ci++) {
		cInt = 'tdA'+ip+''+ci;
		cIntB = 'tdB'+ip+''+ci;

		oLay[cInt].top = iPositonLayer;
		oLay[cInt].resizeTo(152, oLay[cInt].document.height);
		if(ci>0 && ci<menu.chi[ip].length-1) {
			oLay[cIntB].top = iPositonLayer+oLay[cInt].document.height
			oLay[cInt].document.captureEvents(Event.MOUSEOVER | Event.MOUSEOVER);
			oLay[cIntB].document.captureEvents(Event.MOUSEOUT | Event.MOUSEOUT);
			oLay[cInt].captureEvents(Event.CLICK)
			oLay[cIntB].captureEvents(Event.CLICK)
			
			oLay[cInt].onmouseover = function (e) { 
				p = this.name.substr(3,1)
				c = this.name.substr(4,2)
				changeColor(p, c);
			}
			oLay[cIntB].onmouseover = function (e) { 
				p = this.name.substr(3,1)
				c = this.name.substr(4,2)
				changeColor(p, c);
			}
			oLay[cInt].onmouseout = function (e) { 
				p = this.name.substr(3,1)
				clearAllRollOvers(p);
			}
			oLay[cIntB].onmouseout = function (e) { 
				p = this.name.substr(3,1)
				clearAllRollOvers(p);
			}
			oLay[cInt].onclick = function (e) { 
				p = this.name.substr(3,1)
				c = this.name.substr(4,2)
				window.document.location.href=menu.chi[p][c].url 
			}
			oLay[cIntB].document.onclick = function (e) { 
				p = this.name.substr(3,1)
				c = this.name.substr(4,2)
				window.document.location.href=menu.chi[p][c].url 
			}
			oLay[cIntB].resizeTo(152, 1);
		}
		iPositonLayer += oLay[cInt].document.height+1;
	}
	document.layers[pInt].resizeTo(154, iPositonLayer-1 )
}


/* NORMAL JAVASCRIPT FUNCTIONS */
function RollImg(i, str) {
	// rollover teil fur die laender navigation
	if(str=='laender') {
		oImg = document.getElementById('laender'+i);
		if(oImg!=null)
			oImg.setAttribute("src", rollLaender[i].src)	
	}
	if(str=='footer') {
		oImg = document.getElementById('footer'+i);
		if(oImg!=null)
			oImg.setAttribute("src", rollFooter[i].src)	
	}
	if(str=='contentfooter') {
		oImg = document.getElementById('contentfooter'+i);
		if(oImg!=null)
			oImg.setAttribute("src", ContentrollFooter[i].src)	
	}
	if(str=='subnav') {
		oImg = document.getElementById('subnav'+i);
		if(oImg!=null)
			oImg.setAttribute("src", SubImg[i].src)	
	}
}

function RollImgBack(i, str) {
	// rollover teil fur die laender navigation
	if(str=='laender') {
		oImg = document.getElementById('laender'+i);
		if(oImg!=null)
			oImg.setAttribute("src", LaenderNavImg[i])	
	}
	if(str=='footer') {
		oImg = document.getElementById('footer'+i);
		if(oImg!=null)
			oImg.setAttribute("src", FooterNavImg[i])	
	}
	if(str=='contentfooter') {
		oImg = document.getElementById('contentfooter'+i);
		if(oImg!=null)
			oImg.setAttribute("src", ContentFooterNavImg[i])	
	}
	if(str=='subnav') {
		oImg = document.getElementById('subnav'+i);
		if(oImg!=null)
			oImg.setAttribute("src", SubNavImg[i])	
	}
	
}


