/*
function fixSize(win)
{
    var w = win.document.images[0].width;
    var h = win.document.images[0].height;
    
    var x = screen.width / 2 - w / 2;
    var y = screen.height / 2 - h / 2;
    
    win.resizeTo(w, h);
    win.moveTo(x, y);
}
*/

function showPicture(url)
{
    var w = 200;
    var h = 200;
    var x = screen.width / 2 - w/2;
    var y = screen.height / 2 - h/2;
    
    var options = "";
    options += "width="     + w + ",";
    options += "height="    + h + ",";
    options += "top="       + y + ",";
    options += "left="      + x + ",";
    options += "toolbar=no,location=no,status=no";

    var title = "Galerie";
    
    // html head
    var html = "<html><head>";
    html += "<title>" + title + "</title>";
    
    // script
    html += "<script type='text/javascript'>";
    html += "   function fixSize(){                 ";
    html += "   var w = document.images[0].width;   ";
    html += "   var h = document.images[0].height;  ";
    html += "   var x = screen.width / 2 - w / 2;   ";
    html += "   var y = screen.height / 2 - h / 2;  ";
    html += "   resizeTo(w, h); moveTo(x, y);}      ";
    html += "</script>";
    html += "</head>";
    
    // html body
    html += "<body onload='fixSize();' style='margin:0px'>";
    html += "<img src='" + url + "'>";
    html += "</body></html>";
    
    var newwin = window.open("about:blank", "newwin", options);
    
    newwin.document.write(html);
    newwin.document.close();
    
    //newwin.document.onload = fixSize(newwin);
    //newwin.document.captureEvents(Event.ONLOAD);
}
