var showImageWin = null;

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


function fixFooter()
{
  var bodyElm = document.getElementsByTagName('body')[0],
      bodyDiv = getNode('body'),
      footer  = getNode('footer'),
      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';
  }
}

registerEvent(window, 'resize', fixFooter);

$(
  function()
  {
    fixFooter();

    if ($('#gallery-wrapper').size()) {
      $('#gallery-wrapper')
        .prepend('<a class="prev"></a>')
        .append('<a class="next"></a>');

      $('.scrollable')
        .css({overflow: 'hidden', height: '55px'})
        .scrollable();

      Shadowbox.init({overlayOpacity:.9});
    }

  }
);

