// JavaScript Document
/*function picwin(kep) {
window.open( "/popup.php?"+kep, "myWindow", "status = 1, height = 440, width = 440, resizable = 1" )
}*/

function picwin(img)
    {
        popup = window.open('','','toolbar=no,location=no,directories=no,menubar=no,resizable=yes,status=no,scrollbars=auto,width=200,height=100');

    var sz = " "
    + "function getElementStyle(elementId) {"
    + "  if (document.getElementById)"
    + "    return document.getElementById(elementId).style;"
    + "  else if (document.all) "
    + "    return document.all[elementId].style;"
    + "  else if (document.layers) "
    + "    document.layers[elementId];"
    + "}"
    + "function updateWindow() { "
    + "   getElementStyle('wait').display='none';"
    + "   window.resizeTo(document.images[0].width+40,document.images[0].height+100);"
    + "   window.clearInterval(timer);"
    + "}"
    + "var timer = null;"
    + "function checkImage() { "
    + "    if (document.images.length>0 && (document.images[0].width>0 || document.images[0].height>0)) { "
    + "        window.resizeTo(document.images[0].width+40,document.images[0].height+100);"
    + "        window.clearInterval(timer);"
    + "    } "
    + "}"
    + "timer = window.setInterval(checkImage, 500);";




        popup.document.open();
        var html;
        html  = "<html><head><script type='text/javascript'>"+sz+"</script></head>";
        html += '<body style="padding: 5px; margin:0">';
        html += '<div id="wait" name="wait" style="position:absolute;left:10px;top:10px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: black; background-color: #eee; padding: 2px;">Pillanat türelmet!</div>';
        html += '<img name=kep id=kep src="../images/'+img+'" style="border: solid 1px black;" border=0 onclick="self.close()" onload="';
        html += "updateWindow()";
        html += '"/></body></html>';
        if (popup.document.write != undefined) {
            popup.document.write(html);
        } else {
            popup.document.writeln(html);
        }
        popup.document.close();
    }

