// <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; windows-1250">

condenser = 0;
intervalID = null;
objId = null;
var selectImage = null;
menuBGcolor = "#ffffff";
menuBG2color = "#999899";
submenuColor1 = "#ffffff";
submenuColor2 = "#c0c0c0";

// Fce pro zobrazení příslušné nabídky hlavního menu
function showMenu(namez) {
	if (!document.all && !document.getElementById && !document.layers) return;

	if (intervalID) clearInterval(intervalID);					// smažeme případné časované skrytí menu
	clearMenuNow();												// smažeme menu
	
	// zobrazíme požadovanou nabídku
	var menuID = "menu" + namez;
	var subID = "sub" + namez;
	
	objId = document.getElementById(subID);					// použijeme metodu DOM
	objId.style.display = "";

	// zvýraznění butonku
	document.getElementById(menuID).style.backgroundColor = menuBG2color;
	document.getElementById(menuID).style.cursor = "pointer";
}



// Fce pro okamžité skrytí nabídky hlavního menu
function clearMenuNow(color) {
	if (!document.all && !document.getElementById && !document.layers) return;
	
	if(document.getElementById('sub1') != null) document.getElementById('sub1').style.display="none";
	if(document.getElementById('menu1') != null) document.getElementById('menu1').style.backgroundColor = menuBGcolor;

	if(document.getElementById('sub2') != null) document.getElementById('sub2').style.display="none";
	if(document.getElementById('menu2') != null) document.getElementById('menu2').style.backgroundColor = menuBGcolor;
	
	if(document.getElementById('sub3') != null) document.getElementById('sub3').style.display="none";
	if(document.getElementById('menu3') != null) document.getElementById('menu3').style.backgroundColor = menuBGcolor;
	
	if(document.getElementById('sub4') != null) document.getElementById('sub4').style.display="none";
	if(document.getElementById('menu4') != null) document.getElementById('menu4').style.backgroundColor = menuBGcolor;
	
	if(document.getElementById('sub5') != null) document.getElementById('sub5').style.display="none";
	if(document.getElementById('menu5') != null) document.getElementById('menu5').style.backgroundColor = menuBGcolor;
	
	if(document.getElementById('sub6') != null) document.getElementById('sub6').style.display="none";
	if(document.getElementById('menu6') != null) document.getElementById('menu6').style.backgroundColor = menuBGcolor;
	
	if(document.getElementById('sub7') != null) document.getElementById('sub7').style.display="none";
	if(document.getElementById('menu7') != null) document.getElementById('menu7').style.backgroundColor = menuBGcolor;
	
	if(document.getElementById('sub8') != null) document.getElementById('sub8').style.display="none";
	if(document.getElementById('menu8') != null) document.getElementById('menu8').style.backgroundColor = menuBGcolor;
	
	if(document.getElementById('sub9') != null) document.getElementById('sub9').style.display="none";
	if(document.getElementById('menu9') != null) document.getElementById('menu9').style.backgroundColor = menuBGcolor;
}



// Fce pro časované skrytí nabídky hlavního menu
function clearMenu() {
	condenser = 4;
	if (intervalID) clearInterval(intervalID);
	intervalID = setInterval(clearMenuInterval, 100, 0);
}



// Fce pro setInterval pro skrytí nabídky hlavního menu
function clearMenuInterval() {
	condenser -= 1;
	if (condenser <= 0) {
		clearInterval(intervalID);
		clearMenuNow();
	}
}



// preload images
function preparePage() {
	prepared = true;	
}



// zvýraznění položky menu
function itemOver(tdID) {
	if (intervalID) clearInterval(intervalID);									// smažeme případné časované skrytí menu
	document.getElementById(tdID).style.cursor = "pointer";
	//document.getElementById(tdID).style.backgroundColor = "#979797";
	tdID += "-t";
	document.getElementById(tdID).style.color = submenuColor2;
}

function itemOut(tdID) {
	//document.getElementById(tdID).style.backgroundColor = "#E9E9E9";
	tdID += "-t";
	document.getElementById(tdID).style.color = submenuColor1;
	clearMenu();
}


// zobrazi/skryje zadany objekt
function ShowHelp(namez, stav) {
	var element = ugetElementById(namez);
	if(stav) {
		element.style.display="";
	} else {
		element.style.display="none";
	}
}


// vrací objekt kompatibilní s DOM a IE4
function ugetElementById(ename) {
	var x = null;
	if (document.getElementById) {
		x = document.getElementById(ename);
	} else if (document.all) {
		x =  document.all.item(ename);
	}
	return x;
}


// otevře okno fotogalerie pod článkem
function windowopen (htm_source) {
	window.open (htm_source,'taktfoto','width=294,height=218,toolbar=0,location=0,directories=0,status=0,menubar=0,top=1,scrollbars=0,resizable=0');
}

// výměna fotografie v malé nebo fotogalerii
function gy_chngPhoto (im, detail, id) {
	selectImage = detail;
	var element = ugetElementById(id);
	element.src = "upload/" + im;

}

// otevře okno malé nebo velké fotogalerie
function gyPhotoopen (im) {
	if(selectImage != null) im = selectImage;
	window.open ('foto.htm?f='+im,'taktfoto','width=294,height=218,toolbar=0,location=0,directories=0,status=0,menubar=0,top=1,scrollbars=0,resizable=0');
}

// vymění text reference v pravém sloupci
function chngReftext (tx) {
	document.getElementById('tdiv').innerHTML=tx
}

// přidá adresu do oblíbených
function AddFavorite(linkObj,addUrl,addTitle)
{
  if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    linkObj.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  }
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
  return false;
}
