var showImageWin = null;

function showImage(path, width, height, title)
{
//  if (showImageWin != null && !showImageWin.closed)
//    showImageWin.close();
  showImageWin = window.open('/showImage.php?path=' + path + '&title=' + title, 'Preview', 'resizable=yes,width=' + width + ',height=' + height);
} // end func showImage

function fixFooter()
{
  var bodyElm = document.getElementsByTagName('body')[0],
      bodyDiv = getNode('body'),
      footer  = getNode('footer');

  bodyDiv.style.height = 'auto';

  var diff = bodyElm.clientHeight - footer.offsetHeight;

  footer.style.position = 'relative';
  footer.style.top      = '';

  if (diff > bodyDiv.offsetHeight || diff > getPageOffsetTop(footer)) {
    footer.style.position = 'absolute';
    footer.style.top = diff + 'px';
  }

  if (bodyElm.clientHeight > bodyDiv.offsetHeight)
    bodyDiv.style.height = bodyElm.clientHeight + 'px';
}

registerEvent(window, 'load', fixFooter);
if (!document.all || !document.all[0].currentStyle)
  registerEvent(window, 'resize', fixFooter);