// remove styles which hide menu
EventUtil.addEventHandler(window, "load", killStyles);
function killStyles() {
	if(document.styleSheets[0].cssRules) {
		document.styleSheets[0].deleteRule(0);
	} else {
		document.styleSheets[0].removeRule(0);	
	}
}

/******************************************************
author: DAroo, darooo7@interia.pl
do not remove this comment! (nie usuwać tego komentarza!)
******************************************************/

var $a=30; // czas rozwijania
var $b=30; // odstep czasowy pomiedzy rozwijaniem a pojawianiem sie
var $c=10; // odstep czasowy pomiedzy znikaniem a zawijaniem
var $d=80; // czas zwijania
var $e=20; // czas pojawiania sie / znikania

var $f=false; // opoznienie podczas otwierania
var $g=false; // opoznienie podczas zamykania

var $h="menu_1"; // ID glownego elementu <ul/> menu
var $i="visible";  // atrybut class elementów <li/>, ktore maja byc domyslnie rozwiniete

var $j=true; // stopniowe rozwijanie menu
var $k=1; // 1 - plynne rozwijanie i zmiana przezroczystosci; 2 - natychmiastowe rozwiniecie z plynna zmiana przezroczystosci; 3 - bez przezroczystosci, pojawianie sie / znikanie
var $l=true; // automatyczne zamykanie otwartych menu
var $m=true; // rozwijanie menu na klikniecie - true lub na najechanie myszka - false

var $n;var $o=[[]];var $p=[];var $q=[];var $r=[];var $s=[[]];var $t=[];var $u=1;EventUtil.addEventHandler(window,"load",menu_init);function menu_init(){var $z=document.getElementById($h);var $A=document.getElementsByTagName("li");lookForTheSpans($A);};function lookForTheSpans($A){for(var i=0;i<$A.length;i++){var $B=getSpan($A[i]);if($B){var $C=getInnerLIs($B);hideLIs($C);makeVisibleWithClass($B,$C);if($m)$B.onclick=function showHideMenu(){addEventToTheSpan(this);};else{;}}}};function getSpan($D){if($D.childNodes[0]&&$D.childNodes[0].nodeName=="SPAN")var $B=$D.childNodes[0];else if($D.childNodes[1]&&$D.childNodes[1].nodeName=="SPAN")var $B=$D.childNodes[1];else var $B=0;return $B;};function getInnerLIs($B){var $E=getUL($B);var $C=[];if($E.childNodes[0]&&$E.childNodes[0].nodeName=="LI")$C[0]=$E.childNodes[0];else $C[0]=$E.childNodes[1];var j=0;for(var i=0;$E.childNodes[i]||$E.childNodes[i+1];i++){if($E.childNodes[j]&&$E.childNodes[j].nodeName=="LI"){$C[i]=$E.childNodes[j];j=j+1;}else if($E.childNodes[j+1]&&$E.childNodes[j+1].nodeName=="LI"){$C[i]=$E.childNodes[j+1];j=j+2;}};return $C;};function getUL($B){if($B.nextSibling&&$B.nextSibling.nodeName=="UL")return $B.nextSibling;else if($B.nextSibling.nextSibling&&$B.nextSibling.nextSibling.nodeName=="UL")return $B.nextSibling.nextSibling;};function hideLIs($C){for(var j=0;j<$C.length;j++){$C[j].style.display="none";$C[j].style.opacity=0;$C[j].style.width="100%";$C[j].style.filter="alpha(opacity=0)";}};function makeVisibleWithClass($B,$C){var $F=$B.parentNode;if($F.className&&$F.className==$i){var $G=addToGlobalArray($C);$t.push($G);for(var j=0;j<$o[$G].length;j++){$o[$G][j].style.display="block";$o[$G][j].style.opacity=1;$o[$G][j].style.filter="alpha(opacity=100)";};$p[$G]=0;}};function addEventToTheSpan($B){$C=getInnerLIs($B);var $G=addToGlobalArray($C);if(typeof $p[$G]=="undefined")$p[$G]=Boolean($C[0].style.display=="none");animateMenu($G);};function addToGlobalArray($C){for(var i=0;i<$o.length;i++){if($o[i][0]==$C[0])return i;};$o.push($C);return $o.length-1;};function animateMenu($G){killOldMenuAnimation($q);killOldMenuAnimation($r);killOldMenuOpacity($s);if($l&&$u)closeOpenedMenus($G);if($p[$G]){$t.push($G);if($f)var $H=$o[$G].length*$a;else var $H=0;for(var j=0;j<$o[$G].length;j++){if($j)$q[j]=setTimeout('visibleControl('+$G+','+j+','+$p[$G]+')',$a*j);else visibleControl($G,j,$p[$G]);if($k==1)$r[j]=setTimeout('opacityControl('+$G+','+j+','+$p[$G]+')',$H+$b*j);else opacityControl($G,j,$p[$G]);};$p[$G]=0;}else{deleteOpenedMenu($G);if($g)var $H=$o[$G].length*$c+20*$e;else var $H=0;for(var j=$o[$G].length-1;j>=0;j--){var i=$o[$G].length-j-1;if($k==1)$r[i]=setTimeout('opacityControl('+$G+','+j+','+$p[$G]+')',$c*i);else opacityControl($G,j,$p[$G]);if($j)$q[i]=setTimeout('visibleControl('+$G+','+j+','+$p[$G]+')',$H+$d*i);else visibleControl($G,j,$p[$G]);};$p[$G]=1;}};function killOldMenuAnimation($I){do{clearTimeout($I[0]);$I.shift();}while($I.length);};function killOldMenuOpacity($s){for(var i=0;i<$s.length;i++){do{clearTimeout($s[i][0]);$s[i].shift();}while($s[i].length);}};function closeOpenedMenus($G){var $J=[[]];$J=getExcludedNodes($G);for(var i=$t.length-1;i>=0;i--){$u=0;for(var j=0;j<$J.length;j++){if($o[$t[i]][0]==$J[j][0]){$u=1;break;}};if(!$u){$q=[];animateMenu($t[i]);}};$u=1;};function getExcludedNodes($G){var $K=[];$K[0]=$o[$G][0].parentNode;for(var i=0;$K[i].parentNode.parentNode.getAttribute("id")!=$h;i++)$K[i+1]=$K[i].parentNode.parentNode;var $J=[[]];for(var i=0;i<$K.length;i++){if($K[i].previousSibling&&$K[i].previousSibling.nodeName=="SPAN")$J[i]=getInnerLIs($K[i].previousSibling);else $J[i]=getInnerLIs($K[i].previousSibling.previousSibling);};return $J;};function deleteOpenedMenu($G){for(var i=0;i<$t.length;i++)if($t[i]==$G)$t.splice(i,1);};function visibleControl($G,$L,$M){$q.shift();if($M){$o[$G][$L].style.display="block";}else{$o[$G][$L].style.display="none";}};function opacityControl($G,$L,$M){$r.shift();var $N=[];if($M){if($k==3)opacity($G,$L,20);else{for(var i=0;i<=20;i++){$N[i]=setTimeout('opacity('+$G+', '+$L+', '+i+')',$e*i);}};$s.push($N);}else{if($k==3)opacity($G,$L,0);else{for(var i=20;i>=0;i--){$N[20-i]=setTimeout('opacity('+$G+', '+$L+', '+i+')',$e*(20-i));}};$s.push($N);}};function opacity($G,$L,$O){if($s[$L])$s[$L].shift();else $s[$o[$G].length-$L-1].shift();$D=$o[$G][$L];$D.style.opacity=$O/20;$D.style.filter="alpha(opacity="+5*$O+")";}