$(function() {
    
    if ($.browser.webkit) 
        $('body').css('font-size', '13px');
    
    /*== MAIN NAV ==*/
    $('ul.menu > li').mouseover(function(ev) {
        $(this).find('.sub-menu').slideDown('fast');
    }).mouseout(function(ev) {
        var rt = ev.relatedTarget;
        if (!rt) {
            hideSubMenus();
            return;
        }
        var nn = rt.nodeName.toLowerCase();
        if (nn == 'li' || nn == 'a')
            var todo = 'noop';
        else
            hideSubMenus(); 
        
    });
    
    /* At the client's request, we're not ever to display the "Press" submenu */
    $('.menu-item-140 .sub-menu').remove(); 
    
    function hideSubMenus() {
        $('.sub-menu').hide();
    }
    
    /*== slideshow stuff ==**/
    $('.slideshow').cycle({
            fx: 'fade',
            timeout: 6000
    });
    
    $('.slideshow-pager').cycle({
            fx: 'fade',
            timeout: 8000,
            pager: '#pager',
            next: '#nextbox', 
            prev: '#prevbox' 
    });
    
    $('#pager a').html(''); 
    
    /*== accordion ==**/
    if ($('#accordion').length > 0)
        $("#accordion").accordion();
     
    /*== global left col navs ==**/
    // start by collapsing all tert. navs
    $('.children').hide();
    
    // now show the current tert. nav
    $('li.current_page_parent > ul.children').show();
    
    $('.lightbox').fancybox({
        width: '80%',
        height: '96%',
        scrolling: 'no'
    });
    
    $('.lightbox-med').fancybox({
        width: 640,
        height: 480,
        scrolling: 'no'
    });
});
