﻿//    script that needs to be included on every page.
$(document).ready(function(){
    //    add class to body so CSS knows that we have JS enabled
    $('body').addClass('js');
    if ($.cookie('text_size')) $('body').addClass($.cookie('text_size'));;
    
    //    add text resizer functionality
    $('#text-size a').click(function(){
        $('body').removeClass('textSm textMed textLg').addClass($(this).attr('class'));
        $.cookie('text_size', $(this).attr('class'), { path: '/' });
        return false;
    });
    
    //    weather dropdown
    $('#weather').dropdown({
        child:'#weatherConditions'
    });
    
    //    quicklinks dropdowns
    $('#quicklinks').dropdown({
        delay: 100,
        speedIn: 100,
        speedOut: 100
    });
    //    main nav dropdowns
    $('#main-nav > li div').prepend('<span></span>');    //    fills in gab between main nav item and nested dropdown item caused by 12px bar below nav
    $('#main-nav > li').dropdown({
        delay:100,
        speedIn:250,
        speedOut:150,
        child:'div'
    });
    
    //    split long dropdown list (main nav) into two columns
    $('#main-nav li div:last').addClass('double');
    $('#main-nav li div').divide({
        target:'ul',
        threshold:10
    });
    //    search box default text (toolbar)
    $('#tb-search').defaultText();
    
    //    default zebra stripe for tables
    $('table tr:odd').addClass('stripe');
});
