//FUNKCE PRO MENU
function sbalMenu()
{
	prizpusobObsah();
	for(i=0;i<=20;i++)
	{
		if(document.getElementById('subMenu'+i)!=null)
			document.getElementById('subMenu'+i).style.display="none";
	}
	document.getElementById('subMenuPocasi').style.display="none";
}
function rozbalSbalMenu(id)
{
	if(document.getElementById('subMenu'+id)!=null)
	{
		if(document.getElementById('subMenu'+id).style.display=="none")
		{
			document.getElementById('subMenu'+id).style.display="block";
			nastavSessionPHP("nastav",id);
		}
		else 
		{
			document.getElementById('subMenu'+id).style.display="none";
			nastavSessionPHP("zrus",id);
		}
	}
}
function rozbalMenu(id)
{
	document.getElementById('subMenu'+id).style.display="block";
}
function prizpusobObsah()
{
	//OTESTOVANI NA IE6
	var prohlizec=navigator.userAgent;
	var testMSIE=prohlizec.indexOf("MSIE 6");
	//KDYZ JE MENU VYSSI NEZ OBSAH (MENU RELATIVNE, OBSAH ABSOLUTNE - ROZTAHUJE MENU)
	var vyska_obsah=document.getElementById('obsah').clientHeight;
	var vyska_pravy_s=document.getElementById('sloupec_reklama').clientHeight;
	if(vyska_obsah>document.getElementById('stred').style.minHeight)
	{
		if(testMSIE>=0)
		{
			document.getElementById('stred').style.height=vyska_obsah+"px";
		}
		else
		{
			document.getElementById('stred').style.minHeight=vyska_obsah+"px";
		}	
	}
	//KDYZ JE REKLAMA VYSSI NEZ OBSAH
	if(vyska_obsah<vyska_pravy_s)
	{
		if(testMSIE>=0)
		{
			document.getElementById('stred').style.height=document.getElementById('sloupec_reklama').clientHeight+"px";
			document.getElementById('obsah').style.height=document.getElementById('sloupec_reklama').clientHeight-2+"px";
		
		}
		else
		{
			document.getElementById('stred').style.minHeight=document.getElementById('sloupec_reklama').clientHeight+"px";
			document.getElementById('obsah').style.minHeight=document.getElementById('sloupec_reklama').clientHeight-2+"px";
		}
	}
}
//FUNKCE PRO MAPU
var timerPopisek;
function vypisText(text,i)
{
	clearTimeout(timerPopisek);
	var delka=text.length;
	var vypsat="";
	i+=1;
	vypsat=text.substring(0,i);
	if(document.getElementById('mapa_popisek')!=null)
		document.getElementById('mapa_popisek').innerHTML=vypsat;
	timerPopisek=setTimeout("vypisText('"+text+"',"+i+")",100);
	if(i>=delka)
	{
		clearTimeout(timerPopisek);
	}
}
//STATISTIKA NAVSTEVNOSTI A NASTAVENI KLIENTU
function statistika()
{
	document.getElementById('statistika').innerHTML='<a href="http://www.toplist.cz/stat/1047507"><img style="position: absolute; left: 0px; top: 0px; border-style: none; width: 1px; height: 1px;" src="http://toplist.cz/dot.asp?id=1047507&amp;logo=s&amp;http='+escape(document.referrer)+'&amp;wi='+escape(window.screen.width)+'&amp;he='+escape(window.screen.height)+'&amp;cd='+escape(window.screen.colorDepth)+'" alt="TOPlist"/></a>';
}