function ProdNaviAllesZu()
{
	var root = document.getElementById("prodnavi");
	var child = root.firstChild;
	while (child != null)	{
		if (child.id == 'li')		{
			ProdNaviEinAus(child);
		}
	child = child.nextSibling;
	}
}

function ProdNaviEinAus(parent)
{
	var child = parent.firstChild;
	while (child != null)	{
		if (child.id == 'liste')	{
			if (child.style.display == "none")
				child.style.display = "";
			else
				child.style.display = "none";
		}
		child = child.nextSibling;
	}
}


var ttIsInit = false;
var ttSoll = "hide";
var ttDelay = 500;
var ttText = "tooltip";
var ttX = 100;
var ttY = 100;
var ttTimeout = null;

function ttInit()
{
	if (ttIsInit)		return;
	document.write("<div id='tooltip'>"+ttText+"</div>");
	ttIsInit = true;
	ttHide();
}

function ttClear()
{
	if (ttTimeout)	{
		window.clearTimeout(ttTimeout);
		ttTimeout = null
	}
}

function ttShow(s, ev)
{
	var e = ev || window.event;
	ttClear();
	ttText = s;
	ttSoll = "show";
	ttX =  e.pageX || e.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
	ttY =  e.pageY || e.clientY + document.documentElement.scrollTop + document.body.scrollTop;
	ttX += 15;
	ttY += 15;
	//alert("y:"+e.y+"\n clientY:"+e.clientY+"\n pageY:"+e.pageY+"\n scrollY:"+e.scrollY+"\n de.scrollTop:"+document.documentElement.scrollTop+"\n b.scrollTop:"+document.body.scrollTop);
	ttTimeout = window.setTimeout("ttMake()", ttDelay);
	//ttMake();
}

function ttHide()
{
	ttClear();
	ttSoll = "hide";
	//window.setTimeout("ttMake()", ttDelay); 
	ttMake();
}


function ttMake()
{
	var obj = document.getElementById("tooltip");
	
	if (obj)	{
		switch (ttSoll)	{
			case 'show':
				obj.firstChild.nodeValue = ttText;
				obj.style.left = ttX+"px";
				obj.style.top = ttY+"px";
				obj.style.display = "";
			break;
			case 'hide':
				obj.style.display = "none";
			break;
		}
	}
	
	ttSoll = "";
}

function WKorbAdd(s, pid, bnr)
{
	window.open("/wkorb.php?"+s+"&action=add&pid="+pid+"&bnr="+bnr, "wkorb", "width=500,height=500,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=yes");
}

function WKorbShow(s)
{
	window.open("/wkorb.php?"+s, "wkorb", "width=500,height=500,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=yes");
}
