(function($) {
    $(function() {

        $('.sidebar .widgettitle').after('<div class="cl"></div>');

        $('.footer-push').height( $(window).height() - $('.wrapper-push').height() - $('#footer').height() -4);
        $(window).resize(function(){
            $('.footer-push').height(0);
            if ( ($(window).height() - $('.wrapper-push').height() - $('#footer').height())>0 ) {
                $('.footer-push').height( $(window).height() - $('.wrapper-push').height() - $('#footer').height());
            };
        });


        $('.sidebar .widget:last').addClass('last');
        $('.custom-pagination span:last').addClass('last');

        sidebar_height = $('.shell .container .section .sidebar').height();
        content_height = $('.shell .container .section .content').height();
        bb_height = $('.shell .container .section .bb').height();
        if (content_height>sidebar_height) {
            $('.shell .container .section .sidebar').height( content_height );
        }else if((content_height+bb_height)>sidebar_height){
            $('.shell .container .section .sidebar').height( (content_height+bb_height) );
        };

        $('.blink').focus(function(){
            var defVal = $(this)[0].defaultValue;
            if ($(this).val() == defVal) {
            $(this).val("");
            }
        })
        
        $('.blink').blur(function(){
            if ($(this).val() == "") {
            var defVal = $(this)[0].defaultValue;
            $(this).val(defVal);
            }
        })


        $('#releases-slider .slider-i ul').jcarousel({
            auto: 10,
            visible: 6,
            scroll: 1,
            wrap: "both",
            buttonPrevHTML: null,
            buttonNextHTML: null,
            initCallback: sliderInit
        });

    });

    function sliderInit(carousel){
        
        jQuery('#releases-slider a.next').bind('click', function() {
            carousel.next();
            return false;
        });

        jQuery('#releases-slider a.prev').bind('click', function() {
            carousel.prev();
            return false;
         });
    }
})(jQuery)





