<!--//--><![CDATA[//><!--

$(document).ready(function(){

    $("#nav a").each(function() {
        // Add active class to current page link in the menu
        if (location.href.indexOf(this.href) != -1) $(this).parent().addClass("active");

        // Expand lists when the user tabs through menu items
        $(this).focus(function() {
            $(this).parents('li').addClass('hover');
        });
        // Collapse lists again when the link loses focus
        $(this).blur(function() {
            $(this).parents('#nav li').removeClass('hover');
        });
    });
    
    var bodyTextSize=readCookie('textSize');
    if (bodyTextSize != null){
        $('html').css({ 'font-size': bodyTextSize + "px" });
        Cufon.refresh();
    }
    
    $('a#smallerText').click(function(e) {
        e.preventDefault();
        var bodyTextSize = parseInt($('html').css('font-size'));
        //alert(bodyTextSize);
        if (bodyTextSize > 8) {
            bodyTextSize -= 2;
            $('html').css({ 'font-size': bodyTextSize + "px" });
        }
        createCookie('textSize', bodyTextSize);
        Cufon.refresh();
    });

    $('a#largerText').click(function(e) {
        e.preventDefault();
        var bodyTextSize = parseInt($('html').css('font-size'));
        //alert(bodyTextSize);
        if (bodyTextSize < 38) {
            bodyTextSize += 2;
            $('html').css({ 'font-size': bodyTextSize + "px" });
        }
        createCookie('textSize', bodyTextSize);
        Cufon.refresh();
    });
});

//--><!]]>
