var flag = "";
var subflag ="";
var divFlag ="";
var subNaviflag ="";
var sortimentFlag="";
var divtimer1;
var timerDivId;
var newwin;

function naviOn (obj) {
	var imgPath = obj.firstChild.src.split("_o");
	obj.firstChild.src = imgPath[0] + "_on.gif";
}

function naviOut (obj) {
	var imgPath = obj.firstChild.src.split("_o");
	if (obj != flag) {
		obj.firstChild.src = imgPath[0] + "_of.gif";
	}
}

function filterOn (divId){
	document.getElementById(divId).style.display = "block";
	timerDivId = divId;
	var divHeight = document.getElementById(divId).style.height.replace(/px/, "");
	var divTop = document.getElementById(divId).style.top.replace(/px/, "");
	if (divHeight < 100) {
		//alert (divHeight);
		document.getElementById(divId).style.top = eval(divTop) - 10 + "px";
		document.getElementById(divId).style.height = eval(divHeight) + 10 + "px";
		divtimer1 = setTimeout("filterOn(timerDivId)",1);
	} else {
		clearTimeout(divtimer1);
	};
}

function filterOut (divId){
	if (divFlag != divId) {
		clearTimeout(divtimer1);
		document.getElementById(divId).style.display = "none";
		document.getElementById(divId).style.height= "10px";
		document.getElementById(divId).style.top= "204px";
	}
}

function showDiv (divId) {
	clearTimeout(divtimer1);
	document.getElementById(divId).style.display = "block";
	document.getElementById(divId).style.height= "100px";
	document.getElementById(divId).style.top= "114px";	
}

function popup(url,name,eigenschaften) 
   {
   newwin = window.open("flash/" + url,name,"scrollbars=yes,width=300,height=430,left=100,top=200");
   newwin.focus();
   } 

function popneu(url,name,eigenschaften) 
   {
   newwin = window.open("flash/" + url,name,"width=300,height=150,left=100,top=200");   
   newwin.focus();
   } 

function popall(url,name,eigenschaften) 
   {
   newwin = window.open(url,name,eigenschaften);   
   newwin.focus();
   }
   
function showSortimentDetail (obj,sortimentId) {
	try {
		document.getElementById(sortimentFlag).style.display = "none";
		if (obj != subflag) {
			subflag.parentNode.style.backgroundColor='';
			subflag.style.color='#000';
		}
	} catch (ex) {
	   	sortimentFlag = "sortimentFlag";
	}
	document.getElementById(sortimentId).style.display = "block";
	sortimentFlag = sortimentId;
	subflag = obj;
   }
   
function subOn(obj) {
	obj.parentNode.style.backgroundColor='#C91100';
	obj.style.color='#fff';
}

function subOut(obj) {
	if (obj != subflag) {
		obj.parentNode.style.backgroundColor='';
		obj.style.color='#000';
	}
}

function subNaviOn(obj) {
	obj.parentNode.style.backgroundColor='#C91100';
	obj.style.color='#fff';
}

function subNaviOut(obj) {
	if (obj.href != subNaviflag) {
		obj.parentNode.style.backgroundColor='';
		obj.style.color='#fff';
	}
}

function getSubNaviFlag(linkname) {
	var result = "";
	var filename = "";
	for (var i = 0; i < document.getElementsByTagName("a").length; i++) {
		filename = document.getElementsByTagName("a")[i].href.split("/")
		if (filename[3] == linkname && document.getElementsByTagName("a")[i].className == 'navilink') {
			subNaviOn(document.getElementsByTagName("a")[i]);
			result = document.getElementsByTagName("a")[i].href;
		}
	}
	return (result);
}
function getNaviFlag(linkname) {
	var result = "";
	var filename = "";
	for (var i = 0; i < document.getElementsByTagName("a").length; i++) {
		filename = document.getElementsByTagName("a")[i].href.split("/")
		if (filename[3] == linkname && document.getElementsByTagName("a")[i].className != 'navilink') {
			naviOn(document.getElementsByTagName("a")[i]);
			result = document.getElementsByTagName("a")[i].href;
		}
	}
	return (result);
}
