
// ... jquery FTW 

(function($) {

        $().ready(function() {
		 $('#top10-advisors-video-dynamic').hide();
	});

	var toggleVideos = function( qs1, qs2, qs3 ) {
		
		var static_container  = $('#top10-advisors-video-static');
		var dynamic_container = $('#top10-advisors-video-dynamic');

		if( $(static_container).is(':visible') ) {
			$.get( '_scripts/getTopAdvisorsVideo.php?aktid=' + qs1 + '&grp=' + qs2 + '&det=' + qs3,
				function( result ) {
				
					$(dynamic_container).html(result);
					$(static_container).hide();
					$(dynamic_container).slideDown('slow');

					$('#topAdvisorsToggleVideo').html( "Weniger Videos" );
					$('#topAdvisorsToggleVideo').attr('class', 'toplist-button shrink' );

			
				        // track page view
   				        if( typeof( pageTracker ) != 'undefined' ) {
					   var page = document.location.pathname;
					   page += '/top10-videos';
					   pageTracker._trackPageview(page);
				        } 
			});
		}
		else {
			$(dynamic_container).slideUp('slow');
			$(static_container).show();
			$('#topAdvisorsToggleVideo').html( "Top 10 Videos" );
			$('#topAdvisorsToggleVideo').attr('class', 'toplist-button expand' );
		}	
	};

	// export public function
	$.extend( this, {
		toggleTop10AdvisorsVideo: toggleVideos
	});

})(jQuery);


/// NEWS SLIDER
(function($) {
 $().ready( function() {
	var news = $('#news-slider').scrollable({
		api:true,
		size:1, 
		loop:true,
		speed: 600,
		interval: 4000
	});
			
	$('#news-slider .nav-prev').click( function() {
		news.prev();
	});

	$('#news-slider .nav-next').click( function() {
                news.next();
        });	
 });
})(jQuery);



