var rtop="#005DDD";
var ron="#0059A9";
var roff="#0059A9";
var topmargin=120;
var leftmargin=8;
var width=140;
var height=19;
var	blank=20;

var items=new Array();
	items[0]=new Array("Home");
	items[1]=new Array("Main Page");
	items[2]=new Array("Czech Raildays 2011");
	items[3]=new Array("Logo of the fair");
	items[4]=new Array("The fair area", "Maps of the area", "Stand construction – offer");
	items[5]=new Array("Exhibitors newsreel");
	items[6]=new Array("Catalogue 2009");
	items[7]=new Array("Fair Snapshots", "2004", "2005", "2007", "2008","2009");
	items[8]=new Array("Fair Newspaper");
	items[9]=new Array("Fair Statistics","Presented companies","Statistics");
	items[10]=new Array("Accomodation");
	items[11]=new Array("Ostrava City<br><br><img src=\"images/ostraval.jpg\" border=\"0\" alt=\"Ostrava\" width=\"125\" height=\"31\">");

var links=new Array();
	links[0]=new Array("http://www.railvolution.net")
	links[1]=new Array("index.php")
	links[2]=new Array("index.php?s=cr&r=11&d=index&lang=en");
	links[3]=new Array("index.php?d=logo&lang=en")
	links[4]=new Array("","index.php?d=areal&a=1&lang=en","index.php?d=zephyr&lang=en");
	links[5]=new Array("index.php?d=news&lang=en")
	links[6]=new Array("index.php?d=katalog&lang=en");
	links[7]=new Array("","index.php?s=cr&r=4&d=momentky&lang=en","index.php?s=cr&r=5&d=momentky&lang=en","index.php?s=cr&r=7&d=momentky&lang=en","index.php?s=cr&r=8&d=momentky&lang=en","index.php?s=cr&r=9&d=momentky&lang=en");
	links[8]=new Array("craildays8/fair-newspaper-2008.pdf");
	links[9]=new Array("","index.php?d=prehledfirem&lang=en","index.php?d=statistiky&lang=en");
	links[10]=new Array("index.php?d=accomodation");
	links[11]=new Array("http://www.ostrava.cz>");
	
var statuslink=new Array();
	statuslink[0]=new Array("Home");
	statuslink[1]=new Array("Main page");
	statuslink[2]=new Array("Logo of the fair");
	statuslink[3]=new Array("Czech Raildays 2011");
	statuslink[4]=new Array("The fair area", "Maps of the area", "Stand construction – offer");
	statuslink[5]=new Array("Fair News");
	statuslink[6]=new Array("Catalogue 2009");
	statuslink[7]=new Array("Fair Snapshots", "2004", "2005", "2007", "2008","2009");
	statuslink[8]=new Array("Fair Newspaper");
	statuslink[9]=new Array("Fair Statistics","Presented companies","Statistics");
	statuslink[10]=new Array("Accomodation");
	statuslink[11]=new Array("Ostrava City");
	
var nn=document.layers?true:false,N6=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1?true:false,conta=0,last=0;
var op=navigator.userAgent.toLowerCase().indexOf("opera")!=-1?true:false
var BrowserWidth=nn||op?window.innerWidth:N6?document.width:document.body.clientWidth;

if (nn)
	{
	for (i=0;i<items.length;i++)
		{
		var n=i;
		switch (i)
			{
			case 1 : topmargin = topmargin + blank; break;
			case 6 : topmargin = topmargin + blank; break;
			case 9 : topmargin = topmargin + blank; break;
			case 11 : topmargin = topmargin + blank; break;
		}
		links[i][0]?lnk="<a href=\""+links[i][0]+"\" class=\"menuIEb\">"+items[i][0]+"</a>":lnk=items[i][0];
		document.writeln("<LAYER NAME=mtop"+n+". position=absolute left="+leftmargin+" top="+eval(topmargin+i*height)+" width="+width+" height="+height+" clip=0,0,"+width+",15 bgColor="+roff+" visibility=visible onMouseOver=ShowMenu("+i+");expand('mtop"+i+".');conta++;On("+i+"); onMouseOut=last="+i+";collapse('mtop"+i+".');conta--;Off("+i+")><DIV ALIGN=left CLASS=menuNNb>"+lnk+"</DIV></LAYER>");
		for (l=1;l<items[i].length;l++)
			document.writeln("<LAYER NAME=mdep"+i+"."+l+" position=absolute left="+eval(leftmargin+width-10)+" top="+eval((topmargin+height*l+i*height)-10)+" width="+eval(width+10)+" height="+height+" clip=0,0,"+width+",15 bgColor="+roff+" visibility=hidden onMouseOver=expand('mdep"+n+"."+l+"');conta++;On("+i+"); onMouseOut=collapse('mdep"+n+"."+l+"');conta--;Off("+i+")  CLASS=menuNNb>&nbsp;<A HREF=javascript:expand('mdep"+n+"."+l+"') onClick=vai('"+links[i][l]+"',"+i+","+l+") CLASS=menuNN>"+items[i][l]+"</A></LAYER>");
		}
	}
	else
	{
	for (i=0;i<items.length;i++)
		{
		var n=i;
		switch (i)
			{
			case 1 : topmargin = topmargin + blank; break;
			case 6 : topmargin = topmargin + blank; break;
			case 9 : topmargin = topmargin + blank; break;
			case 11 : topmargin = topmargin + blank; break;
		}
		links[i][0]?lnk="<a href=\""+links[i][0]+"\" class=\"menuIEb\">"+items[i][0]+"</a>":lnk=items[i][0];
		document.writeln("<DIV ID=mtop"+n+". STYLE=\"position:absolute;z-index:180;left:"+leftmargin+";top:"+eval(topmargin+i*height)+";width:"+width+";height:"+height+";visibility:visible;cursor:hand\" onMouseOver=ShowMenu("+n+","+i+");conta++;On("+i+"); onMouseOut=last="+n+";conta--;Off("+i+")><DIV ALIGN=center CLASS=menuIEb><img src=\"images/butoff.gif\" width=\"18\" height=\"16\" name=\"i"+i+"\" border=\"0\" align=top>"+lnk+"</a></DIV></DIV>");
		for (l=1;l<items[i].length;l++)
			document.writeln("<DIV ID=mdep"+i+"."+l+" STYLE=\"position:absolute;z-index:181;left:"+eval(leftmargin+width-10)+";top:"+eval((topmargin+height*l+i*height)-10)+";width:"+eval(width+10)+";height:"+height+";background:"+roff+";visibility:hidden;cursor:hand\" onMouseOver=expand('mdep"+n+"."+l+"');conta++;On("+i+") onMouseOut=collapse('mdep"+n+"."+l+"');conta--;Off("+i+") CLASS=menuIE onClick=vai('"+links[i][l]+"',"+i+","+l+")>&nbsp;"+items[i][l]+"</DIV>");
		}
	}

timer=setInterval("MenuTime()",1000)

function MenuTime()
	{
	if (conta==0)
		{
		colorize(true)
		timer=setTimeout("colorize(false)",10);
		timer=setTimeout("showdeps(last,false)", 10);
		}
	}

function colorize(col)
	{
	color=col?ron:roff;
	for (i=0;i<items.length;i++)
		for (j=1;j<items[i].length;j++)
			{
		if (nn)
			document.layers["mdep"+i+"."+j].bgColor=color;
		else
			if(document.all)
				document.all["mdep"+i+"."+j].style.background=color;
				else
				document.getElementById('mdep'+i+"."+j).style.background=color;
			}
	}

function Off(img)
	{
		document.images["i"+img].src="images/butoff.gif";
	}

function On(img)
	{
		document.images["i"+img].src="images/buton.gif";
	}
function ShowMenu(n,img)
	{
	showdeps(last,false);
	showdeps(n,true);
	last=n;
	}
function showdeps(n,act)
	{
	if (conta==0)
		{
		act?stat="visible":stat="hidden";
	if (nn)
		for (i=1;i<items[n].length;i++)
			document.layers["mdep"+n+"."+i].visibility=stat;
	else
		for (i=1;i<items[n].length;i++)
			if(document.all)
				document.all["mdep"+n+"."+i].style.visibility=stat;
				else
				document.getElementById('mdep'+n+"."+i).style.visibility=stat;
		}
	}

function vai(dove,r,c)
	{
	if (c>0)
		lev=nn?document.layers["mdep"+r+"."+c]:(document.all)?document.all["mdep"+r+"."+c].style:document.getElementById("mdep"+r+"."+c).style;
	else
		lev=nn?document.layers["mtop"+r+"."]:(document.all)?document.all["mtop"+r+"."].style:document.getElementById("mtop"+r+".").style;
	if (nn)
		{
		lev.bgColor=roff;
		timer=setTimeout("lev.bgColor=ron",50)
		timer=setTimeout("lev.bgColor=roff",100)
		timer=setTimeout("lev.bgColor=ron",150)
		timer=setTimeout("lev.bgColor=roff",200)
		timer=setTimeout("lev.bgColor=ron",250)
		}
		else
		{
		lev.background=roff;
		timer=setTimeout("lev.background=ron",50)
		timer=setTimeout("lev.background=roff",100)
		timer=setTimeout("lev.background=ron",150)
		timer=setTimeout("lev.background=roff",200)
		timer=setTimeout("lev.background=ron",250)
		}
   	if (navigator.userAgent.toLowerCase().indexOf("msie")!=-1 && navigator.platform.toLowerCase().indexOf("mac")=="mac")
	   document.write("")
	timer=setTimeout("self.location.href='"+dove+"'",350);
	}

function expand(l)
	{
	LTop="mtop"+l.substr(4,l.indexOf(".")-4)+".";
	nn?document.layers[l].bgColor=rtop:(document.all)?document.all[l].style.background=rtop:document.getElementById(l).style.background=rtop;
	document.getElementById?document.getElementById(l).style.cursor=document.all?'hand':'pointer':'void(0)';
	if (l.substr(0,4)=="mdep")
		string=statuslink[l.substr(4,l.indexOf(".")-4)][l.substring(l.indexOf(".")+1,l.length)];
			else if (l.length>5)
			string=statuslink[l.substr(4,l.indexOf(".")-4)][0];
				else string="Home Page";
	window.status=string;
	timer=setTimeout("window.status=string",20);
	}

function collapse(l)
	{
	LTop="mtop"+l.substr(4,l.indexOf(".")-4)+".";
	nn?document.layers[l].bgColor=roff:(document.all)?document.all[l].style.background=roff:document.getElementById(l).style.background=roff;
	window.status="";
	}
