
/**
 * Global
 */

jQuery(document).ready(function()
{
    jQuery('a[rel="external"], a[href^="http://"], a[href^="/pdf"]').not('.map, .button.modal').click(function()
    {
        window.open(jQuery(this).attr('href'));
        return false;
    });

    setTimeout(function() {
        jQuery('#flashmessenger').fadeTo('slow', 0.01, function() { 
            jQuery(this).slideUp('fast');
        });
    }, 3000);

    jQuery('#top .scrollable').scrollable({ circular: true, clickable: false, easing: 'swing', size: 1, speed: 400 }).navigator().autoscroll({ interval: 7500 });
    jQuery('#featured-products .scrollable').scrollable({ circular: true, clickable: false, easing: 'linear', speed: 25000 }).autoscroll({ api: true, autoplay: true, autopause: true, interval: 1 });

    jQuery('ul.tabs').tabs('div.panes > div');

    jQuery('#top div.right ul li:nth-child(odd)').addClass('alt');

    jQuery('table tbody.zebra tr:nth-child(even)').addClass('alt');    

    jQuery('dl.expandable > dd').hide();
    jQuery('dl.expandable > dt a').click(function()
    {
        jQuery(this).parent().next().slideToggle('fast');
        jQuery(this).toggleClass('expanded');
        return false;
    });

    jQuery('#news #content td a').fancybox({
        'width' : '90%',
        'height' : '90%',
        'autoScale' : false,
        'centerOnScroll' : true,
        'overlayOpacity' : 0.75,
        'overlayColor' : '#000',
        'padding' : 16,
        'scrolling' : 'auto',
        'titleShow' : false,
        'transitionIn' : 'fade',
        'transitionOut' : 'fade',
        'type' : 'iframe'
    });
});

