/* css menu pro IE */
activateMenu = function(nav) {
	if (document.all && document.getElementById(nav).currentStyle) {  
		var navroot = document.getElementById(nav);
		var lis=navroot.getElementsByTagName("LI");  
		for (i=0; i<lis.length; i++) {
			if(lis[i].lastChild.tagName=="UL"){
				lis[i].onmouseover=function() {
					this.lastChild.style.display="block";
				}
				lis[i].onmouseout=function() {                       
					this.lastChild.style.display="none";
				}
			}
		}
	}
}
window.onload= function(){
	activateMenu('nav'); 
}


var msgWin = window.msgWin;
/* popup pro obrazky a galerie */
function popup(alink, type) {
	var retValue = false;
	switch(type) {
		case 1: // img_from_link
			prefix = "/popup_image.php?path=";
			path = prefix + alink.href.substr(alink.href.indexOf("/img/")) + "&title=" + alink.getAttribute("TITLE");
			break;
		case 2: // gal_from_link
			prefix = "/popup_gallery.php?js=true&adr=";
			ppth = alink.href.substr(alink.href.indexOf("adr=") + 4)
			path = prefix + ppth;
			break;
	}
	
	if (msgWin != null && !msgWin.closed) { 
		msgWin.location.href = path;
		msgWin.focus();
	} else {
		msgWin = window.open(path, "_gallery","height=150,menubar=0,personalbar=0,resizable=1,scrollbars=0,toolbar=0,width=150,top=100,left=100,status=0");
		if (msgWin == null || typeof(msgWin) == "undefined") {
			retValue = true; 
			}
		else { 
			alink.target = "_gallery";
			msgWin.focus(); 
		} 
	} 
	return retValue; 
}

function mapShow(alink, todo) {
	td = Array("none", "block");
	document.getElementById('desc' + alink.id).style.display = td[todo];
}