function okno(nazev,w,h)	{	//otevri okno o velikost w,h
	var w=window.open("foto.php?obr="+nazev,"_blank","width="+w+",height="+h+",menubar=yes");
	if (w) {
		w.focus();
		return true;
	}
	else return false;
}

//zobrazeni info bubliny:
var tout = false;
var bub, page_X, page_Y;
 
function getXY (e) {
    page_X = (window.Event) ? e.pageX : window.event.clientX + ietruebody().scrollLeft - ietruebody().clientLeft;
    page_Y = (window.Event) ? e.pageY : window.event.clientY + ietruebody().scrollTop  - ietruebody().clientTop;
    if (bub) {
      outer_width = (document.body.clientWidth) ? document.body.clientWidth : window.outerWidth;
      bub.style.left = ((page_X + 150 > outer_width) ? (outer_width - 150) : (page_X + 10)) + 'px';
      bub.style.top  = (page_Y + 5) + 'px';
    }  
}

function ietruebody() {
    return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
} 

function showInfo(infotext) {
    if (tout) window.clearTimeout(tout);
    if (!bub) bub = document.getElementById('bublina');
    bub.style.display = 'block';
    bub.innerHTML = infotext;
}

function hideInfo() {
    tout = window.setTimeout('hide_info()',500);
}
  
function hide_info() {
    if (!bub) bub = document.getElementById('bublina');
    bub.style.display = 'none';
    bub.innerHTML = '';
}
  
window.onload = function () {
    bub = document.getElementById("bublina");
	if (window.Event) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = getXY;
}

