﻿/// <reference path="../jquery-1.3.2-vsdoc.js" />

$(document).ready(function() {

    $("#header_link").click(function() {
        location = "/";
    });

    $("#navLeagues").unbind('click').bind('click', function() {

        var display = $("#league_selector_list").css("display");

        if (display == "none") {
            $(this).removeClass("off");
            $(this).addClass("on");

            $("#league_selector_list").fadeIn(function() {
                setTimeout(function() {
                    $("#league_selector_list").fadeOut("fast");
                    $("#navLeagues").removeClass("on");
                    $("#navLeagues").addClass("off");
                }, 6000);
            });
        }
        else {
            $("#league_selector_list").hide("fast");
            $(this).removeClass("on");
            $(this).addClass("off");
        }
    });

    $("#VisitStoreButton").click(function() {
        location.href = "http://CafePress.com/DCSH";
    });

    $("#site1, #site2, #site3").mouseover(function() {
        $(this).addClass("on");
    });

    $("#site1, #site2, #site3").mouseout(function() {
        $(this).removeClass("on");
    });

    $("#headlines_box #hb_tab1, #headlines_box #hb_tab2, #headlines_box #hb_tab3").click(function() {

        var id = $(this).attr('id');

        $("#headlines_box #hb_tab1").removeClass("on");
        $("#hb_tab1_content").css("display", "none");
        $("#headlines_box #hb_tab2").removeClass("on");
        $("#hb_tab2_content").css("display", "none");
        $("#headlines_box #hb_tab3").removeClass("on");
        $("#hb_tab3_content").css("display", "none");

        $("#headlines_box " + "#" + id).addClass("on");
        $("#" + id + "_content").css("display", "block");
    });

    $(".mainLeagueLinks").hover(function() {
        $('.pageLeagueLinks').hide();

        var id = '#' + $(this).attr('id') + 'PageLinks';
        $(id).show();
    });


    $("#eveloptLogo, #eveloptLink").mouseover(function(event) {
        var src = $("#eveloptLogo").attr("src");
        if (src == "/Content/images/logo_evelopt_off.png")
            $("#eveloptLogo").attr("src", "/Content/images/logo_evelopt_on.png");
        else
            $("#eveloptLogo").attr("src", "/Content/images/logo_evelopt_off.png");
    });

    $("#eveloptLogo, #eveloptLink").mouseout(function(event) {
        var src = $("#eveloptLogo").attr("src");
        if (src == "/Content/images/logo_evelopt_off.png")
            $("#eveloptLogo").attr("src", "/Content/images/logo_evelopt_on.png");
        else
            $("#eveloptLogo").attr("src", "/Content/images/logo_evelopt_off.png");
    });


    $(document).ready(function () {
        $(".tweet").tweet({
            username: "DCStreetHockey",
            join_text: "auto",
            avatar_size: 32,
            count: 3,
            auto_join_text_default: "",
            auto_join_text_ed: "",
            auto_join_text_ing: "",
            auto_join_text_reply: "",
            auto_join_text_url: "",
            loading_text: "Loading tweets..."
        });
    });

    $("#footer").stickyFooter();
});
