/* emion interaktive medien */
/* http://www.emion.de      */
/* mschmidt@20050112 1531   */


var navigaktiv = 0;
var navigtimer = 0;

function navig(button,subnavig)
	{
	var subnavig = document.getElementById(subnavig);
	var button = document.getElementById(button);

	if((button == 0) || (subnavig == 0)) { return; }

	button.onmouseover = function() //BUTTON_MOUSEOVER
		{
		if(navigaktiv)
			{
			navigaktiv.style.display = 'none';
			}
		this.aktiv(subnavig);

		if(navigtimer == 0) { return; }

		clearTimeout(navigtimer);
		}

	button.onmouseout = function() //BUTTON_MOUSEOUT
		{
		navigtimer = setTimeout('verstecken()',100);
		}

	button.onclick = button.onfocus = function() //BUTTON_ONCLICK
		{
		if(navigaktiv == 0)
			{
			this.aktiv();
			}
		else
			{
			navigaktiv.style.display = 'none';
			navigaktiv = 0;
			}
		return false;
		}

	button.aktiv = function(subnavig) //SUBNAVIG_ZEIGEN
		{
		var pos = position(this);
		if(pos.top == 0) //IE5MAC_FIX
			{
			pos.top = -10;
			}
		if(navigator.userAgent.toLowerCase().indexOf("gecko") > -1)
			{
//			subnavig.style.left = (pos.left) + 'px';
			subnavig.style.top = ((pos.top + this.offsetHeight) + 0) + 'px';
			subnavig.style.display = 'inline';
			navigaktiv = subnavig;
			}
		else
			{
//			subnavig.style.left = (pos.left) + 'px';
			subnavig.style.top = (pos.top + this.offsetHeight) + 'px';
			subnavig.style.display = 'inline';
			navigaktiv = subnavig;
			}
		}


	subnavig.onmouseover = function() //SUBNAVIG_MOUSEOVER
		{
		if(navigtimer == 0)	{ return; }
		clearTimeout(navigtimer);
		}

	subnavig.onmouseout = function() //SUBNAVIG_MOUSEOUT
		{
		navigtimer = setTimeout('verstecken()',100);
		}

	}


function verstecken()
	{
	if(navigaktiv)
		{
		navigaktiv.style.display = 'none';
		}
	}

function position(element)
	{
//	var left = 0;
	var top = 0;
	while(element != null)
		{
//		left += element.offsetLeft;
		top  += element.offsetTop;
		element = element.offsetParent;
		}
//	return {left:left,top:top}
	return {top:top}
	}


window.onload = function()
	{
	navig('schn_1_ma','schn_1');
	navig('schn_2_ma','schn_2');
	}
