/**
 * Fallback fuer das Menue.
 * Setzt im IE 6 hover Klassen auf das Menue, damit dieses dort auch ausklappt.
 * @author Christian Hinz <christian.hinz@twt.de>
 * @author Manuel Meinhard <manuel.meinhard@twt.de>
 * @version $Id: $
 */

/**
 * Funktion zum setzen der Iframe-Layer Hoehe.
 * @author Pascal Streichert<pascal.streichert@twt.de>
 * @param HTMLElement Element welches das Event geworfen hat.
 * @param String sTmpId ID-Teilstueck fuer die Zuordnung der Elemente.
 * @return void
 */
function initLayerHeight(element, sTmpId, iAdditionalValue)
{
	if(element != null)
	{
		var sCnt = $(element).attr('id').substr(sTmpId.length);

		if ($('#'+sTmpId+'layerfix'+sCnt).height() == 0)
		{
			var iLayerChilds = eval('document.all.'+sTmpId+'layer'+sCnt+'.childNodes.length');
			var iLayerHeight = 0;

			for (var i = 0; i < iLayerChilds; i++)
			{
				iLayerTestHight = eval('document.all.'+sTmpId+'layer'+sCnt+'.childNodes['+i+'].offsetHeight');
				if (iLayerTestHight)
				{
					iLayerHeight+=iLayerTestHight
				} // if
			} // for

			iLayerHeight += iAdditionalValue;
			$('#'+sTmpId+'layerfix'+sCnt).height(iLayerHeight);
		} // if
	} // if
} // function

if (window.attachEvent){
	window.attachEvent("onload", function(){$("#hauptnavigation > li").bind("mouseenter",function(){$(this).addClass("sfhover"); initLayerHeight(this, 'mainmenu', 0);}).bind("mouseleave",function(){$(this).removeClass("sfhover");});});
	window.attachEvent("onload", function(){$("#mein-konto-layer li").bind("mouseenter",function(){$(this).addClass("sfhover");}).bind("mouseleave",function(){$(this).removeClass("sfhover");});});
	window.attachEvent("onload", function(){$("#warenkorb-layer > li#basketbox").bind("mouseenter",function(){$(this).addClass("sfhover"); initLayerHeight(this, 'basketbox', 46);}).bind("mouseleave",function(){$(this).removeClass("sfhover");});});
	window.attachEvent("onload", function(){$("#infobox button").bind("mouseenter",function(){$(this).addClass("sfhover");}).bind("mouseleave",function(){$(this).removeClass("sfhover");});});
	window.attachEvent("onload", function(){$(".produkt-verfuegbarkeit div").bind("mouseenter",function(){$(this).addClass("sfhover");}).bind("mouseleave",function(){$(this).removeClass("sfhover");$('.layer-verfuegbarkeit').css('visibility', 'hidden');$('.layer-verfuegbarkeit').css('display', 'none');});});
	window.attachEvent("onload", function(){$(".bearbeiten div").bind("mouseenter",function(){$(this).addClass("sfhover");}).bind("mouseleave",function(){$(this).removeClass("sfhover");});});
	}