var msgWin = window.msgWin;
/* popup pro obrazky a galerie */
function popup(alink, type) {
	var retValue = false;
	switch(type) {
		case 1: // img_from_link
			prefix = "/areal/popup_image.php?path=";
			path = prefix + alink.href.substr(alink.href.indexOf("/img/")) + "&title=" + alink.getAttribute("TITLE");
			break;
		case 2: // gal_from_link
			prefix = "/areal/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; 
}

window.onload = function() {
	h = document.getElementById("logoImg");
	headers = Array("head00","head01");
	current = 0;
	setTimeout("changeHeader()",6000);
}

function changeHeader() {
	todo = current > 0 ? 0 : 1;
	h.className = headers[todo];
	current = todo;
	setTimeout("changeHeader()",6000);
}

emph = false;
function highlightID(id) {
	if(emph) {
		emph.className = emph.className.replace(" emph", "");
	}
	if(obj = document.getElementById(id)) {
		obj.className += " emph";
		emph = obj;
	}
}