/* ------------------------------------ Zacatek scriptu pro leve menu ------------------------------------------ */ 
	function make_menu(bullet,decoration,styleClass,borderColor_over,background_over,borderColor_out,background_out,cellSpacing) {
		this.bullet=bullet;
		this.decoration=decoration;
		this.styleClass=styleClass;
		this.borderColor_over=borderColor_over;
		this.background_over=background_over;
		this.borderColor_out=borderColor_out;
		this.background_out=background_out;
		this.cellSpacing=cellSpacing;
		return this; 
	} 

	function vloz_h(id,hodnota) {
		this.id=id;  
		this.state=hodnota; 
		return this; 
	} 

 	function over(src,level) {
		src.style.borderColor = menuLevel[level].borderColor_over;
		src.style.background =	menuLevel[level].background_over;
	}

	function out(src,level) { 
		src.style.borderColor = menuLevel[level].borderColor_out;
		src.style.background =	menuLevel[level].background_out;
	}

	function changeState($id,$changeTo) {
		menu[$id.replace('m','')].state= $changeTo;
		i=($changeTo=="op")?2:1;
		if ( null != document.images[$id+"_pic"]) {
			if (null != document.images[$id+"_pic"].getAttribute("pic"+i)) {
				document.images[$id+"_pic"].src = document.images[$id+"_pic"]["pic" + i];
			}
		} 
	}

	function closeMenu() {
		level--;
		hodnota = "</td></tr></table>";  
		document.write(hodnota);
	}

	function getcookie(name) {
		cokie= document.cookie; poz=0;
		while (poz<cokie.length)	{	
			konec = poz+name.length+1;
			if (cokie.substring(poz,konec)==name+"=") {	
				konecret=cokie.indexOf(";",konec);
				if (konecret==-1) { konecret=cokie.length; 	}
				vysledek=unescape(cokie.substring(konec,konecret));
				return(vysledek);	
			}	
			poz=cokie.indexOf(" ",poz)+1;	
			if (poz==0) break;	
		};	
		return null;
	}

	function klikni(xxx,url) {
		cokie=''; id= xxx.id; id_p=id.replace('m','');
		if (!menu[id_p]) { menu[id_p]= new vloz_h("m"+id_p,"op"); }

		if (menu[id_p].state=="op") {
			changeState(id,"cl");
			xxx.parentElement.parentElement.rows[1].cells[1].style.display='none'
		} 
		else {
			changeState(id,"op");
			xxx.parentElement.parentElement.rows[1].cells[1].style.display=''
		}

		for (i=0;i<menu.length;i++) {
			if (!menu[i]) {	menu[i] = new vloz_h(c_menu,"cl");	}
			cokie += "m"+ i +"=" + menu[i].state + "|";
		}

		platnost = new Date();
		platnost.setTime(platnost.getTime()+8640000*24) // neco pres hodinu
		cokie=cokie.substring(0,cokie.length-1);
		hodnota= jmeno_cookie+"="+escape(cokie)+";expires="+platnost.toGMTString()+";path=/";
		document.cookie=hodnota;
		if (url) { document.location=url;	}
	}

	var relPos=0,level=0,c_menu = 0;

	function makeMenu($field,lev,url,onlyTextActive) { 
		var bulletsRight = false, currentBullet = 0, itemClass = "LeftMenuItem";
		var aktivni_cele = true;
		if (onlyTextActive == true) {aktivni_cele = false};
		c_menu++;	level ++;	id_p=-1;
		hodnota = "<table width=100% border=0 cellPadding=" + menuLevel[lev].cellSpacing + " cellSpacing=0 style='position: relative; top: -" + relPos + "px;'>"; /*style='position: relative; top: -5px;'*/
		if (!menu[c_menu]) menu[c_menu] = new vloz_h(c_menu,"cl");
		currentBullet= (menu[c_menu].state=="op")?1:0;
		hodnota += "<tr><td colspan=2 id=m"+c_menu+" class='flyoutLink'  onclick='klikni(this"+((aktivni_cele)?",\""+url+"\"":"")+");' onMouseOver='over(this,"+level+")' onMouseOut='out(this,"+level+")'>";

		 if (menuLevel[lev].bullet) {
			if (bulletsRight==false) {
				hodnota += "<TABLE width=100% border=0 cellPadding=0 cellSpacing=0 class=" + menuLevel[lev].styleClass + ">"
				hodnota += "<TR><TD width=12px valign='top'>"
				pole=menuLevel[lev].bullet.split("|");

				if (pole.length>1) {hodnota += "<img src='img/"+pole[currentBullet]+".gif' id=m"+c_menu+"_pic border='0' pic1='img/"+pole[0]+".gif' pic2='img/"+pole[1]+".gif'> "; 	}
				else {	hodnota += "<img src='img/"+menuLevel[lev].bullet+".gif' id=m"+c_menu+"_pic border='0'> "; }
				hodnota += "</TD><TD>"
				}
			else {
				hodnota += "<TABLE width=100% border=0 cellPadding=0 cellSpacing=0 class=" + menuLevel[lev].styleClass + "> <TR><TD>";
				}
			}
		if (url) { hodnota += "<a href='"+url+"'>"; }
		var formatingStart="", formatingEnd="", decor="";
		if (menuLevel[lev].decoration)  {
			decor=menuLevel[lev].decoration.toString()
	   		if (decor.indexOf("I") > -1) { formatingStart="<I>"; formatingEnd="</I>"; }
	   		if (decor.indexOf("B") > -1) { formatingStart += "<B>"; formatingEnd="</B>"+formatingEnd; }
	   		if (decor.indexOf("U") > -1) { formatingStart="formatingStart+<U>"; formatingEnd="</U>"+formatingEnd; }
	   		}
   		hodnota += formatingStart + $field + formatingEnd;
		if (url) { hodnota += "</a>"; }

		if (menuLevel[lev].bullet) {
	
		if (bulletsRight==false) {	hodnota += "</TD></TR></TABLE>"  }
		else {
			hodnota += "</TD><TD width=3px valign='top'>"
			pole=menuLevel[lev].bullet.split("|");
			if (pole.length>1) {
				hodnota += "<img src='img/"+pole[currentBullet]+".gif' id="+$id+"_pic border='0' pic1='img/"+pole[0]+".gif' pic2='img/"+pole[1]+".gif'> "; 
				} else {
					hodnota += "<img src='img/"+pole[0]+".gif' id="+$id+"_pic border='0'> ";
					}
			hodnota += "</TD></TR></TABLE>"
			}
		}
	
	   	hodnota += "</td></tr>\n";
	   	hodnota += "<tr><td width=5></td><td"+((menu[c_menu].state=="cl")?" style=display:none":"")+">\n"
		document.write(hodnota);
	 }
/* ------------------------------------ konec scriptu pro leve menu ------------------------------------------ */ 

/* ------------------------------------ scripty pro horni menu ------------------------------------------ */ 
  var realy;
  
  function rozbalmenu(id,left,top) {
    if (navigator.appName == "Netscape") {
/*	  	m=eval("document.menu"+id);
	  	m.left=left;  m.top=top;
	  	m.visibility='visible';   */
	 }
    else {
      m=eval("document.all.menu"+id);
	  m.style.left=left;  
	  m.style.top=top;
	  m.style.visibility='visible';
	}
  }
  
  function skryj(id) { 
  	if (realy) {
	   if (navigator.appName == "Netscape") {
/*		  m=eval("document.menu"+id);
	      m.visibility='hidden';  */
		}
		else {
		  m=eval("document.all.menu"+id);
		  m.style.visibility='hidden'; 
		 }
	 }
  }
  
  function zabalmenu(id) { 
  	co="skryj("+id+")"; 
	realy=true; 
	setTimeout(co,100); 
	co="skryj('sub"+id+"')"; 
	realy=true; 
	setTimeout(co,20); 
  }

 function submenu(id,left,top,obsah) {
	obsah=encodeSpaces(obsah)
	pole=obsah.split("|");
	text='<table width=100% onmouseover="realy=false;" onmouseout="zabalmenu(\'1\');"  class=top_submenu>';
	i=0; 
	while (pole[i]) { 
		text += "<TR><TD><TABLE width=100% border=0 cellSpacing=0><TR><TD onmouseover='topMenuOver(this);' onmouseout='topMenuOut(this);'>"; 
		//alert("0");
		pole2 = pole[i].split("@");
		//alert("1");
		if (pole2.length>1) {
			text += "<A href='" + pole2[1] + "'>" + pole2[0] + "</A>";
		}
		else {
			text += pole2[0];
		}
		//alert("2")
		text += "</TD></TR></TABLE></TD></TR>"; 
		i++; 
	}
	text = text + '</table>';
	m=eval("document.all.menusub"+id);
	m.style.left=left;	
	m.style.top=top; 
	m.innerHTML=text;	
	m.style.visibility='visible';
  }
  
  function encodeSpaces(encodedSpaces) {
	pole=encodedSpaces.split(" ")
	//alert(encodedSpaces + "#")
	i=0
	encodedSpaces=""
	while (pole[i]) {
		if (i < pole.length - 1) {
			encodedSpaces += pole[i] + "&nbsp"
		}
		else {
			encodedSpaces += pole[i]
		}
		i++
	}
	//alert(encodedSpaces)
	return encodedSpaces
  }

  function createTopMenuItem(parentItemId,$text,$href,content,left,top) {
	var ret = ""
	var closeTag = ""
	
	ret="<TR><TD><TABLE width=100% border=0 cellSpacing=0><TR><TD onmouseover='topMenuOver(this);' onmouseout='topMenuOut(this);'>";
	//alert("1");
	if ($href!="") { 
		//alert("2");
		if (content) {
			ret += "<A onmouseover='submenu(" + parentItemId + "," + left + "," + top + ",\"" + content + "\");' href='" + $href + "'>";
			ret += "<img src='img/SubmenuIndicatorSmall.gif' width='4' height='10' border='0' align='right'>";
		}
		else {
			ret += '<A onmouseover="skryj(\'sub' + parentItemId + '\');" href="' + $href + '">';
		}
		closeTag = "</A>";
	}
	else {
		//alert("3");
		if (content) {
			ret += "<SPAN onmouseover='submenu(" + parentItemId + "," + left + "," + top + ",\"" + content + "\");' style='color:white; font-size:10px; cursor:hand;'>";
			ret += "<img src='img/SubmenuIndicatorSmall.gif' width='4' height='10' border='0' align='right'>";
		}
		else {
			ret += "<SPAN onmouseover='skryj(\'sub\'" + parentItemId + ");' style='color:white; font-size:10px; cursor:hand'>";
		}
		closeTag = "</SPAN>";
	}
	//alert("4");
	ret += $text + closeTag	;
	
	ret += "</TD></TR></TABLE></TD></TR>";
	//alert(ret)
	return ret;
  }
  
  function topMenuOver(src) { 
	src.style.background = '#555555'
	//src.style.foreColor = '#000000'
  }
  
  function topMenuOut(src) { 
	src.style.background = '#000000'
	//src.style.foreColor = '#ffffff'
  }
  
/* ------------------------------------ konec scriptu pro horni menu ------------------------------------------ */ 
