var MMenu = Array (	// pole s odkazy: [url,title,nazev,...]
	["index.htm","blabla","Úvodní stránka"],
	["smsoperator.htm","odesilani sms, prihlaseni na Email, nyx...","parazitni formulare"],
	["#","","Hry",[
		["js_game.htm","blabla","Ultramegagamesa"],
		["./battleship/battleship.htm","blabla","Battleship"],
		["./tic-tac-toe/tic-tac-toe.htm","","Tic-tac-toe"],
		["./ping/","","Ping Pong"],
		["./zizala/","","Žížala"],
		["./warrior/","","Warrior"]
	]],
	["zkouska.htm","","dlouhý text",[
		["#","","pol 1/4"],
		["#","","pol 2/4"]
	]],
	["zkouska2.htm","","zkouška 2 (JS)",[
		["index.htm","blabla","Hlavní stránka"],
		["#","","Hry",[
			["js_game.htm","blabla","Ultramegagamesa"],
			["./battleship/battleship.htm","blabla","Battleship"],
			["./tic-tac-toe/tic-tac-toe.htm","","Tic-tac-toe"],
			["./ping/","","Ping Pong"],
			["./zizala/","","Žížala"],
			["./warrior/","","Warrior"]
		]],
		["zkouska.htm","","dlouhý text",[
			["#","","pol 1/4"],
			["#","","pol 2/4"]
		]],
		["odpocet/odpocet.htm","","Odpočet"],
		["zkouska2.htm","","zkouška 2 (JS)"]
	]],
	["#","úprava stránky","styly",[
		["./styly/0.htm","","první"],
		["./styly/1.htm","","druhý"],
		["./styly/2.htm","","třetí"]
	]],
	["odpocet/odpocet.htm","","Odpočet"],
	["pagereloader/index.htm","","Page Reloader"],
	["fotky.htm","","fotky"],
	["odkazy.htm","","odkazy"]
);
var MPodadresare = Array ( "battleship","tic-tac-toe","styly","odpocet","ping","zizala","warrior" );//pole podadresaru
///////////////////////////////////////////////////////////////////////////////
var MCasovac, MPrefix="";
function MVypni(idd) {	//vypne vsechny podpolozky pod idd
	var menu2=MMenu;
	for(var i=3;i<idd.length;i++) menu2=menu2[idd.substring(i,i+1)][3];
	MVypni_rek(menu2,idd);
	if (idd=="pol") document.getElementById("pol").style.visibility='visible';
}
function MVypni_rek(menu,idd) {
	for(var i=0;i<menu.length;i++) if (menu[i].length == 4) MVypni_rek(menu[i][3],idd+i);
	document.getElementById(idd).style.visibility='hidden';
}
function MStart(idd) {	//zapne odpočítávání k vypnutí polozky idd
	clearTimeout(MCasovac);
	MCasovac=setTimeout("MVypni(\""+idd+"\")", 200);
}
function MZobraz(idd) {	//zobrazí všechny položky až k idd
	clearTimeout(MCasovac);
	MVypni("pol");
	for(var i=3;i<idd.length;i++) document.getElementById(idd.substring(0,i+1)).style.visibility='visible';
}
function MTisk(menu,uroven,idd) {	// rekurzivne vypise cele menu
	if (uroven==0) document.write("<table id="+idd+">");
	else document.write("<table id="+idd+" class=podmenu"+/*uroven+*/" onMouseOver='MZobraz(\""+idd+"\");event.cancelBubble=true' onMouseOut='MStart(\"pol\");event.cancelBubble=true'>");
	for(var i=0;i<menu.length;i++) {
		document.write("<tr><td>");
		if (menu[i].length == 4) {
			document.write("<span style='position: absolute'>"); MTisk(menu[i][3],uroven+1,idd+i); document.write("</span>")
		}
		if (menu[i][0]!='#') document.write("<a href='"+MPrefix+menu[i][0]+"' title='"+menu[i][1]+"'");
		else document.write("<a");
//		document.write("<a href='"+MPrefix+menu[i][0]+"' title='"+menu[i][1]+"'");
		if (menu[i].length == 4) document.write(" class=dalsi onMouseOver='event.cancelBubble=true;MZobraz(\""+idd+i+"\")' onMouseOut='MStart(\""+idd+i+"\")'");
		document.write(">&nbsp;&nbsp;:::: "+menu[i][2]+"</a>")
	}
	document.write("</table>")
}
for(var MIi=0;MIi<MPodadresare.length;MIi++)
	if (window.location.pathname.indexOf(MPodadresare[MIi]+"/") > -1) MPrefix += "../";
	else if (window.location.pathname.indexOf(MPodadresare[MIi]+"\\") > -1) MPrefix += "../";
MTisk(MMenu,0,"pol");

