jQuery(function($) {    // not using $ because another script is using it (Google?)

    // highlight current page (there's no navigation generator to do this)
    var path = location.pathname;
    var pathPieces = path.split("/");
    var filename = pathPieces[pathPieces.length - 1];
    if(filename)
    {
        $("body").addClass(filename.replace(/\.php/, ""));
        $("#navCell a").each(function() {
            var href = $(this).attr("href");
            var hrefPieces = href.split("?");   // need to remove the PHP-generated user_token
            var href = hrefPieces[0];
            if(href == filename)
            {
                $(this).addClass("currentpage");
            }
        });
    }
    else
    {
        $("body").addClass("index");
        $("#navCell a").eq(0).addClass("currentpage");
    }


    // rollover colors
    if($.browser.msie && parseInt($.browser.version) <= 6) {
        $("#alumni_table tr.alumnus").hover(
            function() {
                $(this).addClass("ie6_rollover");
            },
            function() {
                $(this).removeClass("ie6_rollover");
            }
        );
    }

    // expand/collapse alumni descriptions (only the link is clickable)
    /*$("#alumni_table td.more a").click(function() {
        //$(this).parents("tr.alumnus").css("background-color", "#fcfaec");
        $(this).parents("tr.alumnus").toggleClass("active");
        $(this).parents("tr.alumnus").next("tr.details").toggle();
        if($(this).text() == "See More")
        {
            $(this).text("See Less");
        }
        else
        {
            $(this).text("See More");
        }
        return false;
    });*/

    // expand/collapse alumni descriptions (the entire row is clickable)
    $("#alumni_table tr.alumnus").click(function() {
        if($(this).children("td").children("a").text() == "")   // don't expand private entries (they're blank anyway)
        {
            return false;
        }
        $(this).toggleClass("active");
        $(this).next("tr.details").toggle();
        if($(this).children("td").children("a").text() == "See More")
        {
            $(this).children("td").children("a").text("See Less");
        }
        else
        {
            $(this).children("td").children("a").text("See More");
        }

        return false;
    });

});

