$(document).ready(function(){						   
	$('#slider-big-content').anythingSlider({
		width          : 606,
		height         : 358,
		toggleControls : false,
		startStopped   : false,
		theme          : 'raceroom-content',
		themeDirectory : 'css/theme-raceroom-content.css',
		resizeContents : true,
		buildNavigation : false,
		autoPlay       : false,
		infiniteSlides : false,
		animationTime  : 200
	}).bind('slide_begin', function(e, slider) {
		if( $("#slider-thumbs-content" ).length ) 
		{	
			$("#slider-thumbs-content a").each(function(i) {
				strActId = $(this).attr('id');
				$("#" + strActId).removeClass("act");
			});
	
			var iCurrentId = $('#slider-big-content').data('AnythingSlider').currentPage;
			iThumbSector = Math.ceil(iCurrentId/6);
			var iThumbCurrentId = $('#slider-thumbs-content').data('AnythingSlider').currentPage;
			if( iThumbSector != iThumbCurrentId )
			{
				$('#slider-thumbs-content').anythingSlider(iThumbSector);
			}
			
			$("#thumb-" + iCurrentId).addClass("act");	
		}
	})

	if( $("#slider-thumbs-content" ).length ) 
	{
		$('#slider-thumbs-content').anythingSlider({
			width          : 606,
			height         : 62,
			toggleControls : false,
			startStopped   : false,
			theme          : 'raceroom-thumbs-content',
			themeDirectory : 'css/theme-raceroom-thumbs-content.css',
			resizeContents : true,
			buildNavigation : false,
			autoPlay       : false,
			infiniteSlides : false
		})
		.find('a').click( function() {
			$("#slider-thumbs-content a").each(function(i) {
				strActId = $(this).attr('id');
				iIdPart = strActId.substr( 6, strActId.length );																
				$("#" + strActId).removeClass("act");
			}); 
			
			strActId = $(this).attr('id');
			iIdPart = strActId.substr( 6, strActId.length );
			$("#thumb-" + iIdPart).addClass("act");
			$('#slider-big-content').anythingSlider(iIdPart);
		})	
	}
});
