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

        //Fix height
        var contentElement = $('#content');
        var adsElement = $('#content #ads');

        if (contentElement != null && adsElement != null) {
            if (adsElement.height() > contentElement.height()) {
                if ($.browser.msie && $.browser.version == 6.0) { $(contentElement).children().css({ 'height': adsElement.height() }); }
                else $(contentElement).css({ 'min-height': adsElement.height() });
            };
        };

        //Fix click on images / lead mouse pointer
        var ListItems = ".list li";
        $(ListItems).css('cursor', 'pointer');

        $("#rssaccording h4").click(function () {
            //$("#rssaccording  ul").hide();
            $(this).parent().children("ul").toggle('fast');
        });

        $("#infolist a, .topstories .ourservices a, #ads .ourservices a, #submit_video .ourservices a, a.RSSinfo, .feedbackPopup a, a.fancy-iframe, .fancy-iframe a, .main_right .ourservices a, .tellAfriendPopup a").fancybox({
            'width': 900,
            'height': 506,
            'autoScale': false,
            'titleShow': false,
            'type': 'iframe',
            'onStart': function () { $('object').css("visibility", "hidden"); },
            'onClosed': function () { $('object').css("visibility", "visible"); }
        });

        $('#coop ul').cycle({
            fx: 'fade',
            speed: 3000,
            cleartypeNoBg: true
        });

        $('#topbanners ul').cycle({
            fx: 'fade',
            speed: 100,
            timeout: 10000,
            cleartypeNoBg: true
        });

        $("#rssaccording a").fancybox({
            'width': 540,
            'height': 506,
            'titleShow': false,
            'autoScale': false,
            'type': 'iframe'
        });

        //        $(".main_full dd").mouseenter(function () {
        //            $(".main_full dd").removeClass("big");
        //            $(".main_full dd").toggleClass('shrink', 1000);
        //            $(this).toggleClass('big', 1000);
        //        }).mouseleave(function () {

        $('#topslider').kwicks({
            max: 600,
            spacing: 5,
            duration: 150
        });

        $("#topslider li").click(function () {
            $("#rssaccording  ul").hide();
            $(this).parent().children("ul").show('fast');
        });


        $('#topslider li').hover(function () {
            $(this).children('.BannerLink').fadeIn('fast');
        }, function () {
            $(this).children('.BannerLink').fadeOut('fast');
        });

    });
});

