// left
function activateMenu(nav) {
    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
		var navroot = document.getElementById(nav);
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
		for (i=0; i<lis.length; i++) {
            /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {		
                   /* display the inner menu */
                   this.lastChild.style.display="block";
      			}
				lis[i].onmouseout=function() {                       
                    this.lastChild.style.display="none";
				}
            }
		}
	}
}

/* I do this differently on the test page to fix a problem float container problem in IE5 Mac*/
/*Uncomment the function below*/

window.onload= function(){
    activateMenu('leftNavInner');
	activateMenu('horizontalMenu');
}



/* hledani */
function checkSearch(f)
	{
	if(f.what.value.length<3)
		{
		alert("Zadejte prosím text pro vyhledávání");
		f.what.focus();
		return false;
		}
	}


function showSearch()
{
	document.getElementById('searchbox').style.display = 'block';
}
function hideSearch()
{
	document.getElementById('searchbox').style.display = 'none';
}

function preloadImages(the_images_array) 
{

	for(loop = 0; loop < the_images_array.length; loop++)
	{
   		var an_image = new Image();
		an_image.src = the_images_array[loop];
	}
}

var the_images = new Array('/images/pop-up-right.gif','/images/pop-up-left.gif','/images/pop-up-top.gif','/images/pop-up-bottom.gif','/images/pop-up-close.gif');
preloadImages(the_images);


// fotogalerie
var newWindow="";
var flagwindow=0;
function OpenFoto(url, x, y)
	{
	if(x=='') x=500;
	if(y=='') y=375;
	if(flagwindow==1) closewin();
	newWindow=window.open(url, 'top', 'left=100,top=100,width='+x+',height='+y+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	flagwindow=1;
	}

function closewin()
	{
	if(flagwindow)
		{
		flagwindow=0;
		newWindow.close();
		}
	}

