//handle click on tabs or CSS effects
function MakeTabSelected(SelectItem) {
    // remove selected tab class from previous item
    $(".featuredContent_TabSelected").removeClass("featuredContent_TabSelected");
    // add selected tab class to current item
    $(SelectItem).addClass("featuredContent_TabSelected");
    // move arrow to go with the current item (using 0 based index of list item)
    var listHeight = $("#featuredContent_Tabs > ul > li").css("height");
    if (listHeight.indexOf("px") > -1) {
        listHeight = listHeight.substr(0, listHeight.indexOf("px"));
    }
    var arrowTop = (listHeight - 1) * $(SelectItem).index() + $(SelectItem).index();
    $("#featuredContent_ArrowSelected").css("top", arrowTop);
    //hide navigation arrows if only one div in the list
    var nbScrollItems = $("#featuredContent_Panes > div:eq(" + $(SelectItem).index() + ") > div > div > div > div > div").size();
    if (nbScrollItems != 1) {
        $(".SliderNavigation").css("display", "block");
    }
    else {
        $(".SliderNavigation").css("display", "none");
    }
}

// allow tab navigation (with jquery tools from flowplayer.org)
$(function () {
    $("#featuredContent_Tabs ul").tabs("#featuredContent_Panes > div", { effect: 'fade', fadeOutSpeed: 400 });
});

