$(function () {	
	$('#gallery').html($('.data:first').html());
	
	jQuery('#mycarousel').jcarousel({
        animation: 600
    });
	
	if ($('#gallery li img').length <= 1) {
		$('#gallery .jcarousel-prev, #gallery .jcarousel-next').css('display', 'none');
	}
	else {}
	
	$('#news_events ul li').hover (function() {
		$('.dark_blue').removeClass('dark_blue');
		$(this).addClass('dark_blue');
		
		var indexGallery = $($(this).children('.data')).html();
		
		$('#gallery').html(indexGallery);
		
		jQuery('#mycarousel').jcarousel({
	        animation: 600
	    });
		
		if ($('#gallery li img').length <= 1) {
			$('#gallery .jcarousel-prev, #gallery .jcarousel-next').css('display', 'none');
		}
		else {}
	}, function() {});
	
	/*$('img.captify').captify({
		speedOver: 'fast',
		speedOut: 'normal',
		hideDelay: 500,	
		animation: 'slide',		
		prefix: '',		
		opacity: '0.7',					
		className: 'caption-bottom',	
		position: 'bottom',
		spanWidth: '100%'
	});*/
	
	$('.sl').each(function () {

		if ($('.slider ul li', this).length >= 4) {
			
			$('.next, .prev', this).css('display','block');
			
			$('.slider', this).css('left', '-5000');
			
			$('.slider', this).jCarouselLite({
	    		btnNext: $('.next', this),
	    		btnPrev: $('.prev', this),
	    		circular: true,
	    		visible: 3
			});
			
			$('.slider a', this).lightBox();
		}
		
		else {
			/*$('.slider', this).addClass('slider_one');
			$('.slider', this).removeClass('slider');
			$(this).removeClass('sl');*/
			$('.slider_one a', this).lightBox();
			
			$('.slider a', this).lightBox();
		}
	});
	
	$('ul.only_video li img').click(function() {
		$('ul.only_video li img.active').removeClass('active');
		$(this).addClass('active');
	});
		
});
