function ImageWindow(imageURL, imageTitle) {
    /* načtení obrázku */
    var imgw = 500;
    var imgh = 400;

    /* vytvoření html obsahu */
    var newtext = "";
    if( GetBrowser() == 'msie' || GetBrowser() == 'opera' ) {
      newtext += "<html><head><title>Foto</title></head><body onload=\"window.resizeTo(document.getElementById('viewimg').width+60, document.getElementById('viewimg').height+130);\" style=\"background-color: #FFFFFF;\">\n";
    }
    else {
      newtext += "<html><head><title>Foto</title></head><body onload=\"window.innerWidth=document.getElementById('viewimg').width+30; window.innerHeight=document.getElementById('viewimg').height+60;\" style=\"background-color: #FFFFFF;\">\n";
    }

    newtext += "<center><img id=\"viewimg\" src=\"" + ImageWindow.arguments[0] + "\" alt=\"\" onClick=\"window.close();\" /></center>";
    if(ImageWindow.arguments[1]) newtext += "\n<br /><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;\">" + ImageWindow.arguments[1] + "</span>";
    newtext += "\n</body></html>";

    /* otevření okna s náhledem */
    msg = open("","View","width=" + imgw + ",height=" + imgh + ",resizable=1,status=1,scrollbars=1");
    msg.document.write(newtext);
    msg.document.close();
    msg.focus();

    /* návrat false aby nebyl zpracován odkaz který spustil tohle okno */
    return false;
}

function GetBrowser() {
    var agt = navigator.userAgent.toLowerCase();

    if (agt.indexOf("opera") != -1) return 'opera';
    if (agt.indexOf("firefox") != -1) return 'firefox';
    if (agt.indexOf("msie") != -1) return 'msie';
    if (agt.indexOf("mozilla/5.0") != -1) return 'mozilla';
    if (agt.indexOf("netscape") != -1) return 'netscape';
    if (agt.indexOf("safari") != -1) return 'safari';
    return '???';
}
