
$(function(){

	/*@cc_on
	@if (@_jscript_version <= 5.8)
		$('.js-pie').each(function(){ PIE.attach(this); });
	@end
	@*/

	// Fix for content area
	$('.g-content img').each(function(){ $(this).addClass('img-float-' + $(this).css('float')); });

	$('a[rel="gallery"]').colorbox({ 'photo': true, 'current': 'Изображение {current} из {total}' });

	$('.block-photos-sidebar .gallery p')
	
	$('.block-photos-sidebar .gallery').each(function(){
		var gallery = $(this);
		gallery.find('p').show().css({opacity: 0});
		gallery.find('p:first').addClass('top').css({opacity: 1.0});
		setInterval(function(){
			var current = gallery.find('p.top');
			var next = current.next().length ? current.next() : gallery.find('p:first');
			current.removeClass('top');
			next.addClass('top').css({opacity: 0}).animate({opacity: 1.0}, 1000);
			setTimeout(function(){ current.css({opacity: 0}); }, 1000);
		}, 5000);
	});

});


