$(document).ready(function() {
    $("div.ultrabox").hide();

    // Make sure all image tags are of the correct height/width right away.
    $(".weight").find("img").width("65px");
    $(".weight").find("img").height("36px");

    $("#ultranav a.on").each(function(){
        var myDiv = $(this).attr("rel");
        $("#" + myDiv).show();
    });

    $("#ultranav a").click(function(){

        var myPage = $(this).attr("rel");

        $("div#main div.ultrabox:visible").hide();

        $("#" + myPage).show();

        $("#ultranav a").removeClass("on");

        $(this).addClass("on");

        return false;

    });

    $("#changer a").click(function() {
        // Update header
        $("#changer a").removeClass("on");
        $(this).addClass("on");

        // Make sure all image tags are of the correct height/width
        //$(".weight").find("img").width("65px");
        //$(".weight").find("img").height("35px");

        // Show new section to go with header
        $(".graphs").hide();
        var id = $(this).attr("href");
        $(id).show();        

        return false;
    });

});