/* ======================================
   Splash Slider Variables
   ====================================== */

var playSplashSlider,
currentSplash = 0,
slideTime = 7000;


/* ======================================
   Splash Slider
   ====================================== */

function splashStopTimer() {
	
	if( playSplashSlider ) {
		clearTimeout(playSplashSlider);
		playSplashSlider = null;
	}
	
}

function splashStartTimer() {
	
	splashStopTimer();
	playSplashSlider = setInterval(function(){
			splashNext();
	}, slideTime);
	
}

function splashNext()
{
  if ( currentSplash + 1 >= $('.main-content-carousel .thumbs > div').length)
  {
    currentSplash = 0;  
  }
  else {
    currentSplash++;
  }
  
  showContentById( currentSplash );
}

function showContentById(id)
{
  currentSplash = id;

  $('.main-content-carousel .thumbs > div .active-thumb').removeClass("active-thumb");
  $(".main-content-carousel .thumbs > div").eq(id).find('a').addClass('active-thumb');
  
 	
 	$(".stripViewer .panelContainer").animate({
 			left: -(633 * id)
 	}, 750, 'easeOutExpo' );
 	
  splashStartTimer();
}



jQuery(document).ready(function() {

	///////////////////////////////
	// Splash alani kodlari
	///////////////////////////////
	
	// Pager'a active sinifi ekler
	showContentById(0);
	
	$(".main-content-carousel .thumbs > div a").click(function() 
	{
	  var selectedCount = $(this).parent('div').index();
	  console.log(selectedCount);
	  showContentById(selectedCount);
	  return false;
	});
	
   	
});
