﻿$(document).ready(function() {

    // sets the page name in the main content pane
    function setPageName(pageName) {
        $("#div_page_name").text(pageName);
        $("#div_page_name_bg").text(pageName);
    }

    // sets up the fade effects for twitter
    function setupTwitter() {

        $("#div_twitter").hover(function() {
            $(this).animate({ opacity: 1 }, 200);
        },
            function() {
                $(this).animate({ opacity: 0.4 }, 200);
            });
        $("#div_twitter").css({ opacity: 0.4 });
    }


    if (!$.browser.msie) {
        $("#menu_items li").hover(function() {
            $(this).stop(true, false).animate({ fontSize: "1.2em" }, 150);
            $("#div_page_description").text($(this).attr("description"));
            $("#div_page_description").stop(false, true).animate({ opacity: 1 }, 200);
        },
                    function() {
                        $(this).animate({ fontSize: "1em", backgroundColor: "black" }, 200);
                        $("#div_page_description").stop(false, true).animate({ opacity: 0 }, 300);
                    }
                );
    } else {
        $("#menu_items li").hover(function() {
            $("#div_page_description").text($(this).attr("description"));
            $("#div_page_description").stop(false, true).animate({ opacity: 1 }, 200);
        },
                    function() {
                        $("#div_page_description").stop(false, true).animate({ opacity: 0 }, 300);
                    }
                );
    }

    setupTwitter();

    $("#menu_items li").bind("click", function() {
        $("li").removeClass("menu_item_selected");
        $(this).addClass("menu_item_selected");
    });

    setPageName("home");
});

