

$(document).ready(
    function()
    {
        $("div.scrollable").scrollable({ vertical:'true', items:'ul', size: 2}).circular().autoscroll(4000);
        $("body").css("font-size", $.cookie('fontSize'));
        $("div#moduleArea").equalHeights();
        // Text resizer
        $("span#textSmaller").click(
            function()
            {
                // Minimum font size - 12px
                newFontSize = getFontSize()-2;
                if( newFontSize >= 12 ) //ANN
                {
                    $.cookie('fontSize', newFontSize + "px", { expires: 7 });
                    $("body").css("font-size", newFontSize + "px");
                    $("div#moduleArea").equalHeights();
                }
            }
        )
        $("span#textLarger").click(
            function()
            {
                // Maximum font size - 21px
                newFontSize = getFontSize()+2;
                if( newFontSize <= 21 ) //ANN
                {
                    $.cookie('fontSize', newFontSize + "px", { expires: 7 })
                    $("body").css("font-size", newFontSize + "px");
                    $("div#moduleArea").equalHeights();
                }
            }
        )
        $("form#search input[name='search']").click(
            function()
            {
                $(this).val('');
            }
        )
    }
)
// Get the font size of the body - returns value in pixels
function getFontSize()
{
    return parseFloat($("body").css("font-size"));
}
/*--------------------------------------------------------------------
 * JQuery Plugin: "EqualHeights"
 * by:    Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
 *
 * Copyright (c) 2008 Filament Group
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Description: Compares the heights or widths of the top-level children of a provided element
         and sets their min-height to the tallest height (or width to widest width). Sets in em units
         by default if pxToEm() method is available.
 * Dependencies: jQuery library
 * Version: 2.0, 08.01.2008
--------------------------------------------------------------------*/
$.fn.equalHeights = function(px) {
    $(this).each(function(){
        var currentTallest = 0;
        $(this).children().each(function(i){
            $(this).height('auto');
            $(this).css('min-height', '0');
            if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
        });
        // for ie6, set height since min-height isn't supported
        if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
        $(this).children().css({'min-height': currentTallest});
    });
    return this;
};