// JavaScript Document
$(document).ready(function(){
	$('#section-2').css('display','block');
});
$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) { 
	$(pager).find('.tab a').removeClass('active-tab') 
	.filter('.tab a:eq('+currSlideIndex+')').addClass('active-tab'); 
	var active = currSlideIndex;    
};

function tabCycle(tabs) {
	$('#media-container').cycle({
		fx: 'fade',
		timeout: '3600',
		speed: '400',
		cssAfter: {display: 'none'},
		autostop: '1',
		autostopCount: '4', // set to 4 for production....
		//before: onBefore,
		pagerEvent:  'mouseover',
		pager:  '#tabs-container',
		activePagerClass: 'active-slide',
		pagerAnchorBuilder: function(idx, slide) { 
			return '<div class="tab" id="tab-'+(idx+1)+'"><a class="inactive-tab" href="'+'#media-'+(idx+1)+'" title="' + tabs[idx] + '"><strong>' + tabs[idx] + '</strong></a></div>';
		}
	}); 
	$('.inactive-tab').hover(
		function() {
			$(this).addClass('tab-hover');
			$('#media-container').cycle('pause');
		},
		function() {
			$(this).removeClass('tab-hover');	
		}
	);
	$('.inactive-tab').click(function(){
		$('#media-container').cycle('pause');
	})
}
