/* showImage (<a>-tag containing the image)
   ----------------------------------------

   automagically finds the correct width, height
   and url of the big-sized image. */
var win;
function showImage(what,newWidth) {
    if(win) {
        win.close();
    }
    var url=what.firstChild.src;
    var image=url.replace(/^(.+)\/(.+)\.jpg$/i, '$1\/big\/$2\.jpg');
    var width=what.firstChild.width;
    var height=what.firstChild.height;

    var ratio=height/width;
    var newHeight=Math.round(ratio*newWidth);

    var top=Math.round((screen.height/2)-(newHeight/2));
    var left=Math.round((screen.width/2)-(newWidth/2));

    win=window.open('blank.htm?'+escape(image),'location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,image','width='+newWidth+',height='+newHeight+',left='+left+',top='+top);

    return false;
}
