addEvent('load', menu);


/*udela rozklikavaci menu */

function menu() {
	if(navigator.appName=='Microsoft Internet Explorer' && document.getElementById && !window.opera) {
		var menu = document.getElementById('menu');	
		var li = menu.getElementsByTagName('li');		
		for(var i=0; i<li.length; i++) {
			li[i].onmouseover = function(){
									this.className+=' hover';
									if (this.className.indexOf('submenu') != -1) {
 									  this.firstChild.className +=' submenuOn';
 									}
								}
			li[i].onmouseout = function(){
			                        if (this.className.indexOf('submenu') != -1) {
									  this.className = this.className.replace(' hover','');
									  this.firstChild.className = this.firstChild.className.replace(' submenuOn','');
									}  
								}
		   						
		}
	}
}

   
/** addEvent pro dokument, ne pro jednotlive elementy
    s osetrenym bugem pro Operu */
  
function addEvent(evType, fn) {
  if(checkBrowser('opera') && typeof document.addEventListener != 'undefined') {
      document.addEventListener(evType, fn, false);
  } else if(typeof window.addEventListener != 'undefined')  {
      window.addEventListener(evType, fn, true);
  } else if(typeof window.attachEvent != 'undefined') {
      window.attachEvent("on"+evType, fn);
  }
}

/** fce pro rozpoznani prohlizece */
 function checkBrowser(string) {
   var detect = navigator.userAgent.toLowerCase();
   if (detect.indexOf(string) != -1) {
      return true;
   }
   return false;   
 }