var lbsetting = {
	fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
	// Configuration related to images
	imageLoading:			'templates/ss_public/images/lightbox/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
	imageBtnPrev:			'templates/ss_public/images/lightbox/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
	imageBtnNext:			'templates/ss_public/images/lightbox/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
	imageBtnClose:			'templates/ss_public/images/lightbox/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
	imageBlank:				'templates/ss_public/images/lightbox/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
};

$(document).ready(function(){
	$('#ct-tab .tab-head li').click(function(){
		var indeks = $(this).index();
		
		// Bypass when active
		if($(this).attr('class')!='aktif'){
			$('#ct-tab .tab-head .aktif').removeClass('aktif');
			
			$(this).addClass('aktif');
			
			$('#ct-tab .tabs .aktif').slideUp(400).fadeTo(400, 0, function(){
				$('#ct-tab .tabs .aktif').removeClass('aktif').hide();
				
				$('#ct-tab .tabs .tab-item:eq('+indeks+')').css('opacity', '0').slideDown(400).fadeTo(400,1).addClass('aktif');
			}); /**/
			
			/*
			$('#ct-tab .tabs .aktif').slideUp('slow').fadeTo(400, 0).removeClass('aktif').hide();
			$('#ct-tab .tabs .tab-item:eq('+indeks+')').css('opacity', '0').slideDown('slow').fadeTo(400,1).addClass('aktif');
			/**/
			
		}
		
		return false;
	});
	
	var indeks;
	
	function fadeSlide(){
		// Bypass when active
		if(!$('#slide-ct .slide:eq('+indeks+')').hasClass('aktif')){
			$('#slide-ct .aktif').fadeTo(400, 0, function(){
				$('#slide-ct .aktif').css('display', 'none').removeClass('aktif');
				$('#slide-ct .slide:eq('+indeks+')').css('opacity', '0').fadeTo(400, 1).addClass('aktif');
				
			});
		}	
	}
	
	function autoSlide(){
		if((indeks+1) < $('#slide-ct .slide').length){
			indeks++;
		}else{
			indeks = 0;	
		}
		
		fadeSlide();
	}
	
	var timerId = setInterval(autoSlide, 7000);
	
	$('#nav a').click(function(){
		indeks = $(this).index();
		
		clearInterval(timerId);
		
		fadeSlide();
		
		timerId = setInterval(autoSlide, 4000);
		
		return false;
	});
	
});

function brekele(){
	$('#ct-tab .tabs .aktif').fadeTo(400, 0); 
}
