Cufon.replace('.myriad', {hover : true});
Cufon.replace('.top_link', {hover: true});

$(document).ready(function(){
    
    $('#nested_ul li ul, #nested_ul li p').hide();
    
    $('.datepicker').datepicker({
        dateFormat: 'yy-mm-dd'
    });
    
    $('.lightbox').fancybox({
        padding: 15,
        overlayColor: '#000',
        overlayOpacity: 0.9,
        titlePosition: 'over',
        type: 'image'
    });

    $('.top_link').hover(
        function() {
            $('.top_link').removeClass('menu_active');
            $(this).addClass('menu_active');
            
            $('#info_bar').html($(this).parent().find('ul, p').clone().show());
            $('#info_bar ul li a').corner('5px');               
            
            Cufon.refresh('.top_link');
        },
        function() {
            Cufon.refresh('.top_link');
        }
    );
    
    $('.native_block').appendTo('#right');
    
    //$('#footer_right ul li a').corner('5px');
    $('.corner').corner('5px');
    
    $('#welcome').cycle({
        timeout: 7500
    });
        
    $('#arrow_left').hover(
        function()
        {
            $(this).addClass('arrow_left_hover');
        },
        function()
        {
            $(this).removeClass('arrow_left_hover');
        }
    );
    
    $('.desc th, .tooltip').tooltip({
        fade: 250,
        delay: 0,
        track: true
    });
    
    $('#arrow_right').hover(
        function()
        {
            $(this).addClass('arrow_right_hover');
        },
        function()
        {
            $(this).removeClass('arrow_right_hover');
        }
    );
    
    $('#sponsor_images').cycle({
        fx: 'scrollLeft',
        next: '#arrow_right',
        prev: '#arrow_left'
    });    
        
    $('#slider').click(function(){
        if($('#sponsors').is(':hidden'))
        {
            $('#footer').css({
                background: 'url(img/background_footer.gif) repeat-x',
                height: '362px'
            });
            $('#sponsors').show();
        }                
        else
        {
            $('#footer').css({
                background: 'url(img/bg_footer_collapsed.gif) repeat-x',
                height: '241px'
            });  
            $('#sponsors').hide();
        }  
    });
});
