function equalHeight(group) {
    var tallest = 0;
    group.each(function() {
        var thisHeight = jQuery(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
}
var buttonDown = function()
{
  var src = jQuery("img", this).attr("src").split("_up.png").join("_down.png")
  jQuery("img", this).attr("src", src);
}
var buttonUp = function()
{
  var src = jQuery("img", this).attr("src").split("_down.png").join("_up.png")
  jQuery("img", this).attr("src", src);
}

var slideshowComplete = function()
{
  if (jQuery('#fancybox-outer #fancy-bg-frame-top').attr("id") != 'fancy-bg-frame-top')
  {
    jQuery('#fancybox-outer').append('<div id="fancy-bg-frame-top" class="fancy-bg"></div>')
    jQuery('#fancybox-outer').append('<div id="fancy-bg-frame-bottom" class="fancy-bg"></div>')
    jQuery('#fancybox-outer').append('<div id="fancy-bg-frame-left" class="fancy-bg"></div>')
    jQuery('#fancybox-outer').append('<div id="fancy-bg-frame-right" class="fancy-bg"></div>')
    if (ltie7)
    {
      DD_belatedPNG.fix('#fancy-bg-nw, #fancy-bg-ne, #fancy-bg-sw, #fancy-bg-se, #fancy-bg-n, #fancy-bg-s, #fancy-bg-w, #fancy-bg-e, #fancybox-close, #fancy-bg-frame-top, #fancy-bg-frame-bottom, #fancy-bg-frame-left, #fancy-bg-frame-right');
    }
    
  }
  var w = jQuery('#fancybox-inner').width();
  var h = jQuery('#fancybox-inner').height();
  jQuery('#fancy-bg-n').width(w-2*72);
  jQuery('#fancy-bg-s').width(w-2*72);
  jQuery('#fancy-bg-e').height(h-2*22);
  jQuery('#fancy-bg-w').height(h-2*22);
  jQuery('#fancybox-close').css("left", parseInt((w-105)/2));
  jQuery('#fancy-bg-frame-left').height(h-2*18);
  jQuery('#fancy-bg-frame-right').height(h-2*18);
  
  jQuery('#fancybox-right-ico').hover(function(){jQuery(this).addClass("fancybox-right-ico-hover")},function(){jQuery(this).removeClass("fancybox-right-ico-hover")})
  jQuery('#fancybox-left-ico').hover(function(){jQuery(this).addClass("fancybox-left-ico-hover")},function(){jQuery(this).removeClass("fancybox-left-ico-hover")})
  
  jQuery("#fancybox-wrap").hover(function() {
    //jQuery("#fancybox-title").slideDown();
  }, function() {
    //jQuery("#fancybox-title").slideUp();
  });
  jQuery('#fancybox-title').hide();
}

var fancySettings =
{
  'overlayOpacity': 0.8,
  'titlePosition': 'over',
  'showCloseButton': true,
  'padding': 0,
  'overlayColor': '#000',
  'cyclic':true, 
  'onComplete' : slideshowComplete
}
