function getCenteredWindowFeatures(iw,ih) {
    var width = iw;
    var height = ih;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
    return windowFeatures;
}

function ZoomImage(bimg,dx,dy,title){
  dx = dx+40;
  dy = dy+80;
  wf = getCenteredWindowFeatures(dx,dy) 
  picWnd = window.open("imgzoom.html", "zoomWnd", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,"+wf+"");
  picWnd.window.focus();
  picWnd.document.write("<html><title>"+title+"</title><body onBlur=\"window.close()\"><table width=\"100%\" height=\"100%\"><tr><td align=\"center\" valign=\"middle\"><img src='"+bimg+"' align=\"absmiddle\"></td></tr></table></body></html>");  
  picWnd.document.close();
}

function ZoomGalleryImage(lnk,dx,dy){
  //dx = dx+40;
  //dy = dy+60;
  wf = getCenteredWindowFeatures(dx,dy) 
  picWnd = window.open(lnk, "zoomWnd", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,"+wf+"");
  picWnd.window.focus();
}