        
function slideSwitch() {
    var $active = $('#fader_images IMG.active');

    if ( $active.length == 0 ) $active = $('#fader_images IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#fader_images IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}



$(function() {
    $("#newsticker").scrollable({circular: true, vertical: true}).autoscroll({ autoplay: true, interval: 5000 });
    $("#menu_bg").css('opacity',0.75);
    setInterval( "slideSwitch()", 5000 );
    
    $("a img").each(function() {
        if ( $(this).attr('hover') )  {
            var img = $(this);
            var src = $(this).attr('src');
            var hover_src = $(this).attr('hover');
            var cacheImage = document.createElement('img');
            cacheImage.src = hover_src;
            $(this).parent().parent().hover(
                function() {
                    $(img).attr('src',hover_src);        
                },
                function() {
                    $(img).attr('src',src);      
                }            
            );
        }
    });

	$(function() { //on DOM ready
		$("#partners").simplyScroll({  
			autoMode: 'loop',
			pauseOnHover: true,
			frameRate: 25,
			speed: 1
		});
	});

    
});


function showYoutube(id) { 
    $('#'+id).css({opacity: 0.0, display: 'block'}).animate({opacity: 1.0}, 500, function() {});    
    $('#youtube_layer').css({opacity: 0.0, display: 'block', height: $('#body').height()}).animate({opacity: 0.5}, 500);  
    // $('#body').css({overflow: 'hidden'});
}

function closeYoutube(id) {
    $('#'+id).animate({opacity: 0}, 400, function() {
        $('#'+id).css({display: 'none'})
    }); 
    $('#youtube_layer').animate({opacity: 0}, 400, function() {
        $('#youtube_layer').css({display: 'none'})
    });     
    // $('#body').css({'overflow-y': 'auto'});
    
}


