jQuery(document).ready(function() {
  //jQuery('#bd-default .center-box').addBigFatLink();
  
  //picture gallery for products
  if(document.getElementById('big-product-img')) {
    jQuery('a.lightbox').click(function() {
      jQuery(this).parent('li')
                  .addClass('active')
                  .siblings('li').removeClass('active');
      var newPicSrc = this.href;
      jQuery('#big-product-img').fadeOut(500, function() {
        this.src = newPicSrc;
        jQuery(this).fadeIn(500);
      });
      return false;
    });
  }
  
});



jQuery.fn.addBigFatLink = function() {
  return this.each(function() {
    //finde letzten Link im Container
    var lastLink = jQuery('a', this);
    if(lastLink) {
      jQuery(this).click(function() {
        window.location.href = lastLink.attr('href');
        return false;
      })
      .mouseover(function() {
        jQuery(this).addClass('hover');
      })
      .mouseout(function() {
        jQuery(this).removeClass('hover');
      })
    }
  })
}



