
	// Layer ein und ausblenden
var displaying = false;
var layer = false;

function showhide(layer) {
	if(displaying != false && displaying != layer)
	{
		var hidenr = displaying;
		displaying = false;
		showhide(hidenr);
	}
	thisLayer = document.getElementById(layer).style;
	//thisExpander = document.getElementById("shimage"+layerNr);
	if (thisLayer.display == "block") {
		thisLayer.display = "none";
		//thisExpander.src = "images/layout/expand.gif";
		displaying = false;
	}
	else {
		thisLayer.display = "block";
		//thisExpander.src = "images/layout/collapse.gif";
		displaying = layer;
	}
}




	// Tabmenü
var curtab;
curtab = new Array();
var curtabcont
curtabcont = new Array();

function tabhide(tabgroup,id) {

	if(curtab[tabgroup] != null ) {
		if(curtab[tabgroup].className == 'active') {
			curtab[tabgroup].className = '';
		}else{
			curtab[tabgroup].className = curtab[tabgroup].className.replace(" active","");
		}
		curtabcont[tabgroup].className = curtabcont[tabgroup].className.replace(" active","");
	}else{
		tablist = document.getElementById(tabgroup);
		if(tablist.childNodes.length > 1) {
			for (i=0;i< tablist.childNodes.length;i++) {
				el1 = tablist.childNodes[i];
					if(el1.nodeName == 'LI') {
						var oldtab = el1;
						if(oldtab.className == 'active') {
							oldtab.className = '';
						}else{
							oldtab.className = oldtab.className.replace(" active","");
						}
						var oldtabID = oldtab.id;
						var name = tabgroup+oldtabID.replace(tabgroup+'Tab','');
						var oldtabcont = document.getElementById(name);
						if(oldtabcont) {
							oldtabcont.className = oldtabcont.className.replace(" active","");
						}
					}
/* third level - currently not used due to customer decision
				for (j=0; j < el1.childNodes.length;j++) {
					if(el1.childNodes[j].nodeName == 'A') {
						var oldtab = el1.childNodes[j];
						if(oldtab.className == 'active') {
							oldtab.className = '';
						}else{
							oldtab.className = oldtab.className.replace(" active","");
						}
						var oldtabID = oldtab.id;
						var name = tabgroup+oldtabID.replace(tabgroup+'Tab','');
						var oldtabcont = document.getElementById(name);
						if(oldtabcont) {
							oldtabcont.className = oldtabcont.className.replace(" active","");
						}
					}
				}
*/
			}
		}
	}
	var tab = document.getElementById(tabgroup+"Tab"+id);
	tab.className += " active";

	var tabcont = document.getElementById(tabgroup+id);
	tabcont.className += " active";

	var tablink = document.getElementById(tabgroup+"Link"+id);
	if(tablink) {
		var linkUrl = tablink.href;
		linkUrl = linkUrl.replace(tabgroup+id,"");
		tablink.href = linkUrl;
	}
	
	curtab[tabgroup] = tab;
	curtabcont[tabgroup] = tabcont;
}






	// CSS-foldouts for stupid IE
function startList() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("mainnavi");
		parseNodes(navRoot);
	}
}
	// somehow a recursive call to a compacter version of this functin didn't work, so it got a little blown up and ugly
	// but in the end, it does the trick - so what :(
function parseNodes(basenode) {
	for (i=0; i < basenode.childNodes.length; i++) {
		node = basenode.childNodes[i];

		if (node.nodeName=="LI") {
			node.onmouseover=function() {
				this.className+=" over";
			}
			node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
			}

			if (node.childNodes.length > 1) {
				for(j=0;j < node.childNodes.length;j++) {
					if(node.childNodes[j].nodeName == "UL") {
						tmp = node.childNodes[j];
						for (k=0; k < tmp.childNodes.length; k++) {
							child = tmp.childNodes[k];
							if (child.nodeName=="LI") {
								child.onmouseover=function() {
									this.className+=" over";
								}
								child.onmouseout=function() {
									this.className=this.className.replace(" over", "");
								}
							}
						}
					}
				}
			}
		}
	}
}


// close layers
function closeLayer(id) {
	var layer = document.getElementById('flashLayer'+id);
	layer.style.display = 'none';
}

// open PopUpWindows
function popUp (url,name,width,height) {
		if(name == false) { var name = "sapBOPopup"; }
		if(width == false) { var width = 800; }
		if(height == false) { var height = 600; }
		window.open(url,name,"width="+width+",height="+height+",location=false,resizable=1,scrollbars=1");
		return false;
}

var css = '<style type="text/css">'
			+'div.tabhide {display:none;}'
			+'div.tabhide.active {display:block}'
			+'div.showhide,dd.showhide{display:none;}'
			+'</style>';
// write some css-values if javascript is enabled, for enhanced functionality provided with JS
document.write(css);