(function($){
	if (!$)	throw new Error("jQuery not loaded");

	$('.js-bord').live("click", function() {
		if($(this).hasClass('active')) {
			$(this).removeClass('active');
			$(this).next('.cnt-tab-block').css("display","none");
			
			}
			else {
			$(this).addClass('active');
			$(this).next('.cnt-tab-block').css("display","block");
			
			}
		return false;
	});

	$(document).ready(function() {

				$("a[rel=example_group]").fancybox({
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'titlePosition' 	: 'over',
					'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
					}
				});

				/*
				*   Examples - various
				*/

				$(".various1").fancybox({
					'titlePosition'		: 'inside',
					'transitionIn'		: 'none',
					'transitionOut'		: 'none'
				});
				
			   $("li.cnt-nav-elem").hover(function(){
				   $(this).find('ul').show();
			   }, function(){
				   $(this).find('ul').hide();
			   });
		  
			
	});
	$('a[rel~="external"]').live(
		'click',
		function(){
			$(this).attr('target', $(this).attr('target') || '_blank')
		}
	)

	$('.close').live("click",function () {
		$('.banners').slideUp();/*.animate({                  
		marginTop: "-=170px"    
		}, "show"); */
		$('.open').show();//.addClass('inc');
		//$(this).html("Показать");		
    });
$('.open').live("click",function () {
		/*$('#tpl-ligh-box').animate({                  
		marginTop: "0px"    
		}, 100);*/
		$('.banners').slideDown();
		$('.open').hide();//.removeClass('inc');
		//$(this).html("Скрыть");
    });
	
})(window.jQuery)
