	//*----- Check browser -----*/
	var NS4=(navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
	var IE4=(document.all)? true : false;
	var NS6=(parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
	
	//*----- Inicializace -----*/
	var OK = false;
	var LeftBase;
	
	window.onresize = Init;
	if(NS4||NS6) window.onresize = resize;
	
	function resize()
		{
		window.history.go(0);
		} 
	
	function Init()
		{
		if(NS4 || IE4 || NS6)
			{
			LeftBase = NS4 ? parseInt(document.images["thepoint"].x) : parseInt(document.images["thepoint"].offsetLeft);
				
			document.onmousemove = ChangeMenu	
			if (NS4 || NS6)	document.captureEvents(Event.MOUSEMOVE)
			for (i=0; i<submenuItems.length; i++) 
    		{				
    		if(submenuItems[i][0][0]!=null) eval('submenu' + i + ' = new NewMenu(' + i + ')');
    		}
			OK = true;
			}
		}
		
	function NewMenu(id)
		{
		this.css = NS4 ? document.layers["divMenu" + id] : NS6 ? document.getElementById("divMenu" + id).style : document.all["divMenu" + id].style;
		this.over = NS4 ? document.layers["divMenuOver" + id] : NS6 ? document.getElementById("divMenuOver" + id).style : document.all["divMenuOver" + id].style;
		//this.img = document.images["menu" + id];
		this.name = NS4 ? this.css : NS6 ? document.getElementById("divMenu" + id) : document.all["divMenu" + id];
		this.nick = "submenu" + id;
		this.src = eval("menu" + id + ".src");
		this.src1 = eval("menu" + id + "_1.src");
		
		this.tm = menuTop;			
		this.lm = menuDefs[i][1]+LeftBase;
		this.hm = menuHeight;
		this.wm = menuDefs[i][0];
		
		this.css.left = this.over.left = this.lm - 4;
		
		this.ts = NS4 ? parseInt(this.name.y) :  parseInt(this.name.offsetTop);
		this.ls = NS4 ? parseInt(this.name.x) :  parseInt(this.name.offsetLeft);		
		this.hs = NS4 ? parseInt(this.name.clip.height + this.ts) :  parseInt(this.name.offsetHeight + this.ts);
		this.ws = NS4 ? parseInt(this.name.clip.width + this.ls) :  parseInt(this.name.offsetWidth + this.ls);
				
		this.height = NS4 ? parseInt(this.name.clip.height) :  parseInt(this.name.offsetHeight);
		this.width = NS4 ? parseInt(this.name.clip.width) :  parseInt(this.name.offsetWidth);
		
		this.tp = 0;
		
		if (NS4)
			{
			this.css.clip.top = this.over.clip.top = 0
    	this.css.clip.right = this.over.clip.right = this.width
    	this.css.clip.bottom = this.over.clip.bottom = 1
    	this.css.clip.left = this.over.clip.left = 0	  	
			}
  	else
			{
  		this.css.clip = this.over.clip = "rect(0px " + this.width + "px 0px 0px)"		
  		}	
		
		this.Active = false;
		this.Show = Show;
		this.Hide = Hide;
		this.ClipTo = ClipTo;
		this.Clip = Clip;
		}
		
	function ChangeMenu(e)
		{	
		if (NS4 || NS6)
			{
			var x = e.pageX
			var y = e.pageY		
			} 
		if (IE4)
			{		
			var x = event.x+document.body.scrollLeft;
			var y = event.y+document.body.scrollTop;
			}
		//window.status = x + " : " + y;	
		for (i=0; i<submenuItems.length; i++) 
    	{
			if(submenuItems[i][0][0]!=null)
				{
    		sbm = eval('submenu' + i);
				if((x>sbm.lm && x<sbm.wm + sbm.lm && y>sbm.tm && y<sbm.hm + sbm.tm) || (x>sbm.ls && x<sbm.ws && y>sbm.ts-2 && y<sbm.hs+2 && sbm.Active)) sbm.Show();
				else sbm.Hide();
				if((x<sbm.ls || x>sbm.ws || y<sbm.ts-2 || y>sbm.hs+2) && sbm.Active) sbm.Clip(0);				
				}
    	}
		if(x<620 || x>753 || y<37 || y>113) HideBox('searchbox');
		if(x<428 || x>556 || y<139 || y>190) HideBox('configbox');
		if((x<104 || x>281 || y<150 || y>175) && (x<104 || x>205 || y<139 || y>150)) HideBox('performerbox');
		if((x<272 || x>448 || y<150 || y>175) && (x<272 || x>366 || y<139 || y>150)) HideBox('prestigebox');
		}			
	
	//*----- Otevři submenu -----*/
	function Show()
		{	
		if(this.Active) return;
		this.Active = true;
		//this.img.src = this.src1;
		this.css.visibility = "visible";		
		this.ClipTo()
		}
		
	//*----- Vysunutí menu -----*/
	function ClipTo(val) 
		{		
		if(val==0)
			{
			if (NS4) this.css.clip.bottom = 1
			else this.css.clip = "rect(0px " + this.width + "px 1px 0px)"
		}
		else
			{	
			this.tp += step;
			//window.status= this.height + " : " + this.tp
			if(this.tp<this.height+2)
				{
				if (NS4) this.css.clip.bottom = this.tp;
				else this.css.clip = "rect(0px " + this.width + "px " + this.tp + "px 0px)";
				setTimeout(this.nick + ".ClipTo()",1);
				}
			else if(this.tp>this.height)
				{
				if (NS4) this.css.clip.bottom = this.height;
				else this.css.clip = "rect(0px " + this.width + "px " + this.height + "px 0px)"
				}
			}
		}
		
	//*----- Změna pozadí submenu -----*/
	function Over(id,top)
		{
		sbmOver = eval('submenu' + id);
		sbmOver.Clip(top);
		}
	function Clip(top)
		{	
		top1 = top - submenuHeight;

		if (NS4)
			{
			this.over.clip.top = top1;
			this.over.clip.bottom = top;
			}
		else
			{
			this.over.clip = "rect(" + top1 + "px " + this.width + "px " + top + "px 0px)";			
			}
		this.over.visibility = "visible"
		}	
	
		
	//*----- Zavři submenu -----*/
	function Hide()
		{
		if(!this.Active) return;
		this.Active = false;
		this.tp = 0;
		//this.img.src = this.src;
		this.css.visibility = this.over.visibility = "hidden";	
		this.ClipTo(0)	
		}
	
	//*----- Preload obrázků -----*/
	function Preload(imgObj) 
		{	
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "obr/main_menu/'+imgObj+'.gif"');
		eval(imgObj+'_1 = new Image()');
		eval(imgObj+'_1.src = "obr/main_menu/'+imgObj+'.gif"');
		// eval(imgObj+'_1.src = "obr/main_menu/'+imgObj+'_1.gif"');
		}
		
	//*----- Přesun na stránku po kliknutí na submenu (IE only) -----*/
	function Go(where)
		{
		top.location.href = where
		}
		
	
	//*----- Vytvoř submenu -----*/	
	var submenuCss = '';
	submenuCss  = '<style type="text/css">';
	submenuCss += '<!--';	
	for (i=0; i<submenuItems.length; i++) 
		{
		if(submenuItems[i][0][0]!=null)
			{
						
			submenuCss += '#divMenu' + i + '{position: absolute; left: ' + menuDefs[i][1] + 'px; top: ' + submenuTop + 'px; visibility: hidden;}';
			submenuCss += '#divMenuOver' + i + '{position: absolute; left: ' + menuDefs[i][1] +  'px; top: ' + submenuTop + 'px; visibility: hidden;}';
			}
		}
	submenuCss  += '//-->';
	submenuCss  += '</style>';
		
	var submenuHtml = '';	
	for (i=0; i<submenuItems.length; i++) 
		{
		if(submenuItems[i][0][0]!=null)
		{		
			Preload('menu' + i);
			submenuHtml += '<div id="divMenu' + i + '">';
			submenuHtml += '<table border="0" cellspacing="0" cellpadding="0">';
			submenuHtml += '<tr>';
			submenuHtml += '<td>';	
			for (j=0; j<submenuItems[i].length; j++) 
  			{ 
				t = j * submenuHeight + submenuHeight + j;
				if(NS4)
					{
					submenuHtml += '<ilayer>';
					submenuHtml += '<layer height="' + submenuHeight + '">';						
					}
				submenuHtml += '<table border="0" cellspacing="0" cellpadding="0">';
				submenuHtml += '<tr>';
				submenuHtml += '<td height="' + submenuHeight + '" width="' + menuDefs[i][2] + '"  bgcolor="#d7dfd6" class="submenu" onmouseover="Over(' + i + ',' + t + ')">&nbsp;&nbsp;<a href="' + submenuItems[i][j][1] + '" target="' + submenuItems[i][j][2] + '" class="submenu">' + submenuItems[i][j][0] + '</a></td>';
				submenuHtml += '</tr>';
				submenuHtml += '<tr>';
				submenuHtml += '<td bgcolor="#ccd4cb"><img src="../obr/nic.gif" width="1" height="1" alt="" border="0"></td>';
				submenuHtml += '</tr>';
				submenuHtml += '</table>';
				if(NS4) 
					{					
					submenuHtml += '</layer>';	
					submenuHtml += '<layer height="' + submenuHeight + '" onmouseover="Over(' + i + ',' + t + ')">';
					submenuHtml += '<a href="' + submenuItems[i][j][1] + '" target="' + submenuItems[i][j][2] + '"><img src="../obr/nic.gif" width="' + menuDefs[i][2] + '" height="' + submenuHeight + '" border="0"></a>';
					submenuHtml += '</layer>';
					submenuHtml += '</ilayer><br>';					
					}
				}
			submenuHtml += '</td>';
			//submenuHtml += '<td bgcolor="#ffffff"><img src="../obr/nic.gif" width="1" height="1" alt="" border="0"></td>';
			submenuHtml += '</tr>';
			submenuHtml += '</table>';
			submenuHtml += '</div>';
			
			// menu over
			
			submenuHtml += '<div id="divMenuOver' + i + '">';
			submenuHtml += '<table border="0" cellspacing="0" cellpadding="0">';
			submenuHtml += '<tr>';
			submenuHtml += '<td>';
			for (j=0; j<submenuItems[i].length; j++) 
  			{ 
				if(NS4)
					{
					submenuHtml += '<ilayer>';
					submenuHtml += '<layer height="' + submenuHeight + '">';						
					}
				submenuHtml += '<table border="0" cellspacing="0" cellpadding="0">';
				submenuHtml += '<tr>';
				submenuHtml += '<td height="' + submenuHeight + '" width="' + menuDefs[i][2] + '"   bgcolor="#eff8f4" class="submenu1" onclick="Go(\'' + submenuItems[i][j][1] + '\')">&nbsp;&nbsp;<a href="' + submenuItems[i][j][1] + '" target="' + submenuItems[i][j][2] + '" class="submenu1">' + submenuItems[i][j][0] + '</a></td>';
				submenuHtml += '</tr>';
				submenuHtml += '<tr>';
				submenuHtml += '<td bgcolor="#ccd4cb"><img src="../obr/nic.gif" width="1" height="1" alt="" border="0"></td>';
				submenuHtml += '</tr>';
				submenuHtml += '</table>';
				if(NS4) 
					{					
					submenuHtml += '</layer>';	
					submenuHtml += '<layer height="' + submenuHeight + '">';
					submenuHtml += '<a href="' + submenuItems[i][j][1] + '" target="' + submenuItems[i][j][2] + '"><img src="../obr/nic.gif" width="' + menuDefs[i][2] + '" height="' + submenuHeight + '" border="0"></a>';
					submenuHtml += '</layer>';
					submenuHtml += '</ilayer><br>';					
					}
				}		
			submenuHtml += '</td>';
			//submenuHtml += '<td bgcolor="#ffffff"><img src="../obr/nic.gif" width="1" height="1" alt="" border="0"></td>';
			submenuHtml += '</tr>';
			submenuHtml += '</table>';
			submenuHtml += '</div>';		
			}
		}	
		
		// RollOver
		function RollOver(imgname)
			{
			boxId = NS4 ? document.layers["searchbox"] : NS6 ? document.getElementById("searchbox").style : document.all["searchbox"].style;
			boxId.visibility = "hidden";
			document.images[imgname].src = eval(imgname + "_1.src")
			}

		// RollOut
		function RollOut(imgname)
			{
			document.images[imgname].src = eval(imgname + ".src")	
			}

		// Preload obrázků
		//Preload('menu0')
		//Preload('menu2')
		//Preload('menu2')
		//Preload('menu3')
		//Preload('menu4')
		//Preload('menu5')
		//Preload('menu6')
		//Preload('menu7')
		//Preload('menu8')
		//Preload('menu9')
		//Preload('menu10')
		//Preload('menu11')
		//Preload('menu12')
		//Preload('menu13')
		//Preload('menu14')
		//Preload('menu15')
		
function ShowBox(id)
	{
	if((NS4 && document.layers[id]) || (NS6 && document.getElementById(id)) || (IE4 && document.all[id]))
		{
		boxId = NS4 ? document.layers[id] : NS6 ? document.getElementById(id).style : document.all[id].style;
		boxId.visibility = "visible";
		}
	}
	
function HideBox(id)
	{
	if((NS4 && document.layers[id]) || (NS6 && document.getElementById(id)) || (IE4 && document.all[id]))
		{
		boxId = NS4 ? document.layers[id] : NS6 ? document.getElementById(id).style : document.all[id].style;
		boxId.visibility = "hidden";
		}
	}
