
	
var newWin;
function imgPopUp(cont, winname,w,h) {
	var width = (w)? (w) : 700;
	var height = (h)? (h) : 500;
	

	width += 20;
	height += 70;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var param = "width=" + width +  ", height=" + height + ", left=" + left + ", top=" + top; 
	
		newWin = window.open("", winname, param + ',scrollbars=no, resizable=yes, menubar=no');
		newWin.resizeTo(width, height);
		setTimeout("putInWindow('" + cont + "')", 50);
		newWin.focus();
	
	return false;
}
function putInWindow(cont) {
	var newCont = "<html><head><title>Zoomansicht</title></head>";
	newCont += "<style type='text/css'>a img {border: none;} a:hover img {border: none;}</style>"
	newCont += "<body style='background: #A5AAB0;margin: 0; padding: 5px 5px 5px 5px; height: 100%'>"
	newCont += "<div style='position: absolute; z-index: 1; font: 11px Verdana, sans-serif; color:#8A8A8A; margin-top: 30%; text-align: center; width: 100%;'>Bild wird geladen...</div>"
	newCont += "<div style='position: relative; z-index: 100;'><a href='#' onclick='self.close();'><img src='"+ cont + "'></a></div>";	
	//newCont += "<div style='position: relative; z-index: 100;padding-top: 10px;  text-align: center; color: #606060; font-size: 11px; font-family: Arial, Helvetica, sans-serif;'>Zum Schließen bitte auf das Bild klicken</div>";
	newCont += "</body></html>";
	newWin.document.write(newCont);
	newWin.document.close();
}

var activMenuItem = "";

function enableDropdownMenu()
{
	var uls = document.getElementsByTagName('UL');
	for(var i = 0; i < uls.length; i++)
	{
		if (uls[i].className == 'dropdown')
		{
		 	var lis = uls[i].getElementsByTagName('li');
			var lisLength = lis.length;
			for (var j = 0; j < lisLength; j++)
			{
				var sUls = lis[j].getElementsByTagName('ul');
				if (sUls.length > 0)
				{
					if (lis[j].className != "activ")
					{
						sUls[0].oStatus = 0;
						initOpenClose(sUls[0]);

					} else {
						activMenuItem = sUls[0];
					}
				}

			}
		}
	}
}

	
var openedMenuItem = new Object();

function initOpenClose(obj)
{
	obj.li = obj.previousSibling.parentNode;
	obj.liHeight = xHeight(obj.li);
	obj.fadeOut = function ()
	{
		openedMenuItem = obj;
		var liHeight = xHeight(obj.li);
		var oHeight = xHeight(obj)+obj.liHeight;
		if (liHeight >= oHeight)
		{
			xHeight(obj.li, oHeight);
			clearInterval(obj.timeout);
		} else {
			xHeight(obj.li, liHeight + 4);
		}
	}
	obj.fadeIn = function ()
	{
		if (openedMenuItem == obj) { openedMenuItem = ""; }
		var liHeight = xHeight(obj.li);
		var oHeight = obj.liHeight;
		if (liHeight <= oHeight)
		{
			xHeight(obj.li, oHeight);
			clearInterval(obj.timeout);
		} else {
			xHeight(obj.li, liHeight - 5);
		}	
	}
	obj.startFading = function()
	{
		obj.oStatus = (obj.oStatus == 1)? 0 : 1;
		if (obj.oStatus == 1)
		{
			clearInterval(obj.timeout);
			obj.timeout = setInterval(obj.fadeOut, 1);
		} else {
			clearInterval(obj.timeout);
			obj.timeout = setInterval(obj.fadeIn, 1);
		}	
	}
	
	if (obj.parentNode.className != "active sub" && obj.className == "level2")
	{
		obj.parentNode.firstChild.onclick = function()
		{
			if(openedMenuItem.startFading && openedMenuItem != obj)
			{
				openedMenuItem.startFading();
			}
			obj.startFading();
			return false;
		}
	}
}
