
/* Globals */

var hideLvl1;
var activeObj;



/* Events */

function mouseOverLvl1(obj)
{
	clearTimeout(hideLvl1);
	mouseOutLvl1Act(activeObj);
	activeObj = obj;
	
	var leftImg = obj.getElementsByTagName('img').item(0);
	obj.style.backgroundImage = 'url("/wcms_pm/kol_2008_se1_prod/images/mlvl1_bg_hover.jpg")';
	obj.style.color = '#ffffff';
	
	if (leftImg.className == 'mlvl1LeftImg')
	{
		leftImg.src = '/wcms_pm/kol_2008_se1_prod/images/mlvl1_left_hover.jpg';
	}
	else
	{
		leftImg.style.visibility = 'hidden';
	}
	
	var childBlock = document.getElementById('mlvl2Block_' + getId(obj));
	if (childBlock != null)
	{
		childBlock.style.display = 'block';
	}
}

function mouseOutLvl1(obj)
{
	hideLvl1 = setTimeout('mouseOutLvl1Act()', 500);
}

function mouseOutLvl1Act()
{
	if (activeObj == null)
	{
		return false;
	}
	var leftImg = activeObj.getElementsByTagName('img').item(0);
	activeObj.style.backgroundImage = '';
	activeObj.style.color = '';
	
	if (leftImg.className == 'mlvl1LeftImg')
	{
		leftImg.src = '/wcms_pm/kol_2008_se1_prod/images/mlvl1_left.jpg';
	}
	else
	{
		leftImg.style.visibility = '';
	}
	
	var childBlock = document.getElementById('mlvl2Block_' + getId(activeObj))
	if (childBlock != null)
	{
		childBlock.style.display = '';
	}
}

function mouseOverLvl2()
{
	clearTimeout(hideLvl1);
}

function mouseOutLvl2()
{
	hideLvl1 = setTimeout('mouseOutLvl1Act()', 500);
}

function mouseOverLvl2Item(obj)
{
	obj.style.backgroundImage = 'url("/wcms_pm/kol_2008_se1_prod/images/mlvl2_hover.gif")';
}

function mouseOutLvl2Item(obj)
{
	obj.style.backgroundImage = '';
}

/* Common functions */

function getId(obj)
{
	return obj.id.split('_')[1];
}

var p;
function popup(url, w, h, posL, posT, options) 
{
	var screenW = (screen.availWidth) ? screen.availWidth : 800;
	var screenH = (screen.availHeight) ? screen.availHeight : 600;
	if ((w != null) && (w <= 100)) w = 100;
	if ((w == null) || (w < 100) || (w> screenW)) w = screenW - 100;
	if ((h != null) && (h <= 100)) h = 100;
	if ((h == null) || (h < 100) || (h > screenH-120)) h = screenH - 120;
	if ( (posL == null) || (posL < 0) || (screenW < posL + w) ) posL = (screenW - w) / 2; // mitte des bildschirms
	if ( (posT == null) || (posT < 0) || (screenH < posT + h) ) posT = (screenH - h) / 2 - 20; // mitte des bildschirms
	if (posT < 0) posT = 0;
	if (p && (p.closed != true)) p.close();
	if (!options) options = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1';
	p = window.open(url, 'popup', options + ',width=' +w+ ',height=' +h+ ',left=' +posL+ ',top=' +posT);
	p.focus();
	return false;
}