function open_image(image){
	var url = "../../image.php?image="+image;
	okno = self.open(url,'obrazek','toolbar=no,menubar=no,location=no,directories=no,status=no');
	okno.focus();
}
function smazat(url){
	promenna = confirm('Opravdu chcete položku smazat?');
	if(promenna) location.href = url;
	wait();
}
/* 
 *  Změna rozměrů okna podle velikosti obrázku
 */
function res() 
{
    function rozmer(co, s) 
    {
        var sx=sy=0;
        var v=new RegExp("[xX]");
        if (typeof(co)!="object") 
        {
            co=document.getElementById(co);
        }
        if (!document.layers) 
        {
            sx=co.offsetWidth+20;
            sy=co.offsetHeight;
        }
    return (v.test(s)) ? sx : sy;
    }
    var pa=window.navigator.userAgent.toLowerCase();
    var osx=osy=osx2=osy2=0;
    osy+=(document.getElementById("close")) ? rozmer(document.getElementById("close"), "y") : 0;
    osy+=(document.getElementById("name")) ? rozmer(document.getElementById("name"), "y") : 0;
    osy+=(document.getElementById("photo")) ? rozmer(document.getElementById("photo"), "y") : 0;
    osy+=(document.getElementById("popiska")) ? rozmer(document.getElementById("popiska"), "y") : 0;
    osx+=(document.getElementById("photo")) ? rozmer(document.getElementById("photo").getElementsByTagName("img")[0], "x") : 0;
    if (document.all && pa.search("opera")==-1) 
    {
        if (osx!=document.body.clientWidth || osy!=document.body.clientHeight) 
        {
            window.self.resizeTo(osx, osy);
        }
    }
    else 
    {
        if (osx!=innerWidth || osy!=innerHeight) 
        {
            window.self.resizeTo(osx, osy);
        }
    }
    if (document.all && pa.search("opera")==-1) 
    {
        osy2=osy+(osy-document.body.clientHeight+60);
        osx2=osx+(osx-document.body.clientWidth);
    }
    else 
    {
        osy2=osy+(osy-innerHeight);
        osx2=osx+(osx-innerWidth);
    }
    if (osx!=osx2 || osy!=osy2) 
    {
        window.self.resizeTo(osx2, osy2);
    }
}

/* 
 *  Zakázání zobrazování kontextového menu po stisku pravého tlačítka myši
 */

function clickIE()
{
    if (document.all)
    {
        (message);return false;
    }
}
 
function clickNS(e) 
{
    if(document.layers||(document.getElementById&&!document.all))
    {
        if (e.which==2||e.which==3) 
        {
            (message);
            return false;
        }
    }
}

if (document.layers)
{
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS;
}
else
{
    document.onmouseup=clickNS;
    document.oncontextmenu=clickIE;
}

document.oncontextmenu=new Function("return false")