// JavaScript Document
var xmlHttp

function podmenu(alias,barva)
{ 

//document.getElementById("subMenu").innerHTML = "<center><img src=http://test.frserver.com/image/preloader.gif></center>"; 



xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } //getmenu.php?alias=domov&c=666666
var url="/js/getMenu.php"
url=url+"?alias="+alias
url=url+"&sid="+Math.random()
url=url+"&c="+barva
xmlHttp.onreadystatechange=function () {stateChanged(barva)}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged(barva) 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	var barva2=barva;
 	
	if(xmlHttp.readyState == 4) 
	{ 
		if(xmlHttp.status == 200) 
		{ 
	
			if (xmlHttp.responseText=="")
				barva="ffffff";
 				
				//document.getElementById("menuButton").style.backgroundColor="#"+barva;
				document.getElementById("subMenu").style.backgroundColor="#"+barva;
				document.getElementById("layerGlavaTop").style.backgroundColor="#"+barva2;
 				document.getElementById("subMenu").innerHTML=xmlHttp.responseText; 
				
		}
	}
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}