/**
*   @version $Id: menu.js 9 2008-01-16 11:27:42Z piotrj $
*	@package frontend
*	@author piotrj
*/

/**--------------------------------------------------------------------
*	ponizej kod dla menu rozwijanego
*---------------------------------------------------------------------*/

	/**
	*	Opis: funkcja ukrywa/odkrywa listy rozwijane
	*/
	function manageSelects()
	{
		clearTimeout( timeOutSelect );
		if( oSel = document.getElementsByTagName("SELECT") )
		{
			for( i = 0; i < oSel.length; i++ )
			{
				if( ( oSel[i].id != 'tbSelMonth' ) && ( oSel[i].id != 'tbSelYear' ) )
				{
					if( currentMenu == "" )
					{
						oSel[i].style.visibility = "visible";
					}
					else
					{
						oSel[i].style.visibility = "hidden";
					}
				}
			}
		}
	}

	/**
	*	Opis: funkcja powoduje, ze menu staje sie przezroczyste
	*/
	function setMenuOpaque()
	{
		if( oDiv = document.getElementsByTagName("DIV") )
		{
			for( i = 0; i < oDiv.length; i++ )
			{
				if( oDiv[i].className == "dropdown" )
				{
					oDiv[i].style.filter = "alpha(opacity=90)";
					//oDiv[i].style.-moz-opacity = "0.5";
					oDiv[i].style.opacity = "0.9";
				}
			}
		}
	}

/**-------------------------------------------------------------------*/

	var chosenMenu = -1;
	var menuTimeout = 0;

	/**
	*	Opis: funkcja zarzadza wyswietlaniem gornego menu
	*/
	function showMenu( aNr, aCount, aType, isEx )
	{
		clearTimeout( menuTimeout );
		num = 0;
		while( num < aCount )
		{
			if( isEx == 0 )
			{
				$( "menuDivTop"+num+"" ).style.display = "none";
				changeImage2( "topM"+num+"", 0 );
			}
			num++;
		}
		if( aType == 1 )
		{
			if( isEx == 0 )
			{
				$( "menuDivTop"+aNr+"" ).style.display = "block";
				changeImage2( "topM"+aNr+"", 1 );
			}
		}
		else if( ( aType == 0 ) && ( chosenMenu >= 0 ) )
		{
			if( isEx == 0 )
			{
				$( "menuDivTop"+chosenMenu+"" ).style.display = "block";
				changeImage2( "topM"+chosenMenu+"", 1 );
			}
		}
	}

	/**
	*	Opis: funkcja zarzadza wyswietlaniem gornego menu
	*/
	function hideMenu( aNr, aCount, aType, isEx )
	{
		menuTimeout = setTimeout( "showMenu( "+aNr+", "+aCount+", "+aType+", "+isEx+" )", 200 );
	}

/**-------------------------------------------------------------------*/

