﻿
//zmeni vzhled polozky v mnuSite podle id mnuTopic (mnuTopic je vkladano pomoci webbot, pokud neni, dam tam alespon prazdny span s prislusnym ID)
function SelectMnuSiteItem() {
	var idItem = '';
	if (document.getElementById('idMnuProdukty'))	{
		var idItem = 'idMnuSite1';
	}
	if (document.getElementById('idMnuBlankObchod'))	{
		var idItem = 'idMnuSite2';
	}
	if (document.getElementById('idMnuBlankKontakt'))	{
		var idItem = 'idMnuSite3';
	}
	if (document.getElementById('idMnuBlankPodpora'))	{
		var idItem = 'idMnuSite4';
	}
	
	if (idItem!='')	{
		document.getElementById(idItem).className = 'stMnuSite stMnuSiteActive';
	}
}


function DelLink() {
	if (document.location.pathname == '/') {
		var sHref = document.location.href + 'index.htm';
	}
	else {
		var sHref = document.location.href;
	}
	for (i=document.links.length-1;i>=0;i--) {
		if (sHref == document.links[i]) {
			document.links[i].parentNode.innerHTML = document.links[i].innerHTML;
		}
	}
}

//pri kliknuti na objekt (bunku v tabulce) skoci na href prvniho obsazeneho anchoru
function mnuNavigate(obj) {
	var coll = obj.getElementsByTagName('a');
	if (coll.length>0) { // obsahuje anchor
		var shref = coll.item(0).getAttribute('href')
		if ((shref!='') && (shref!=null)) {  //pokud neobsahuje anchor atribut href, Opera a IE vraci '', FireFox vraci null
			window.location.href=shref;
}	}	}


//inicializace menu
function MenuInit()
{
	SelectMnuSiteItem();
	DelLink();
}

