
jQuery(document).ready(function () {

    // adding hover functionality for header navigation area (header menu)
    $("img.img-swap").hover(
            function () { this.src = this.src.replace("_off", "_on"); },
            function () { this.src = this.src.replace("_on", "_off"); }
            );

    // adding drop down feature to header menu
    var $menuItems = $('img.dm-menu_class');
    $menuItems.each(function (index) {
        var $this = $(this);
        if ($this.hasClass("noDropDownMenu") == false) {
            $this.click(function () {
                $(this).next('ul.dm-the_menu').slideToggle('medium');
            });
        }
    });

    // ceebox functionality
    //    debugging = true;

    //    $.fn.ceebox.videos.base.param.allowScriptAccess = "sameDomain" //added to kill the permissions problem
    //    $.extend($.fn.ceebox.videos, {
    //        uctv: {
    //            siteRgx: /uctv\.tv\/search\-details/i,
    //            idRgx: /(?:showID=)([0-9]+)/i,
    //            src: "http://www.uctv.tv/player/player_uctv_bug.swf",
    //            flashvars: { previewImage: "http://www.uctv.tv/images/programs/[id].jpg", movie: "rtmp://webcast.ucsd.edu/vod/mp4:[id]", videosize: 0, buffer: 1, volume: 50, repeat: false, smoothing: true }
    //        }
    //    });

    //    $(".ceebox").ceebox({ titles: false, borderColor: '#dcdcdc', boxColor: "#fff" });

    //    //$("map").ceebox();
    //    $(".ceebox2").ceebox({ unload: function () { $("body").css({ background: "#ddf" }) } });
    //    $("#testlink").click(function () {
    //        $.fn.ceebox.overlay();
    //        $.fn.ceebox.popup(testhtml, { onload: true, htmlWidth: 600, htmlHeight: 450 });
    //        return false;
    //    });

});

function addEventCategoryFilter(eventCategoryDropDown) {
    var $select = $("#" + eventCategoryDropDown);
    var $searchResultItems = $("ul.searchResultList li");
    $select.change(function () {
        $searchResultItems.hide();
        if (this.options[this.selectedIndex].value == "") {
            $searchResultItems.show();
        }
        else {
            $("li.category" + this.options[this.selectedIndex].value).show();
        }
    });
}

function showArticlesOnHomePage() {
    $(function () {
        var $homePageFlashContainer = $("#homePageFlashContainer");
        $homePageFlashContainer.removeClass("withoutArticles");
        $homePageFlashContainer.addClass("withArticles");
        var $articlesContainer = $("#homePageArticlesContainer").appendTo("#dm-button3").show();
    });
}
