(function($) {
    $(document).ready(function(){

        // equalize columns
        var cHeight = 0;
        var cMaxHeightTitleHeight = 0;
        $('.b-foot-col').each(function(){
            if ($(this).height() > cHeight) {
                cHeight = $(this).height();
                cMaxHeightTitleHeight = $(this).children()[0].offsetHeight;
                aux = $(this).find('.b-foot-body');
                cMaxHeightFooterBodyHeight = $(this).find('.b-foot-body').first().height();
            }
        });
        //alert(cMaxHeightTitleHeight);
        $('.b-foot-col').each(function(){
            if ($(this).height() != cHeight) {
                titleHeightDiff = $(this).children()[0].offsetHeight - cMaxHeightTitleHeight;
                $(this).find('.b-foot-body').height(cMaxHeightFooterBodyHeight - titleHeightDiff);
            }
        });
        //$('.b-foot .b-foot-body').height(cHeight);

                    $('.colorbox').colorbox({
                        maxWidth: '85%',
                        maxHeight: '85%',
                        current: '{current} of {total}',
                        slideshow: true,
                        slideshowAuto: false
                    });
                    $('.shopp-thickbox').colorbox({
                        maxWidth: '85%',
                        maxHeight: '85%',
                        current: '{current} of {total}',
                        slideshow: true,
                        slideshowAuto: false
                    });
                    $('a[rel="colorBoxSlideshow"]').bind('click',function(event){
                        $('.colorbox').colorbox({
                            maxWidth: '85%',
                            maxHeight: '85%',
                            current: '{current} of {total}',
                            slideshow: true,
                            slideshowAuto: true,
                            open: true,
                            onClosed: function() {
                                $('.colorbox').colorbox({
                                    maxWidth: '85%',
                                    maxHeight: '85%',
                                    current: '{current} of {total}',
                                    slideshow: true,
                                    slideshowAuto: false
                                });							
                            }
                        });
                        return false;
                    });

    });
})(jQuery);



