$(document).ready(function(){
	initCodePopup();
	initTabs();
	initScroll();
});

function initCodePopup(){
	if($('.btn-code a').get(0)){
		var popupHeight = $('.content-info').height() -18;
		var asideHeight = $('.content-info').height();
		$('.code-popup').css('height', popupHeight);
		$('.aside-info').css('height', asideHeight);
		$('.btn-code a').click(function(){
			$(this).removeClass('active');
			$(this).addClass('active');
			$('.code-popup').css('left', '100%');
			return false;
		});
		$('.code-popup .btn-close').click(function(){
			$(this).parent().css('left', 9999);
			$('.btn-code a').removeClass('active');
		});
		$(".code-popup .copy").zclip({
			path: "/js/ZeroClipboard.swf",
			copy: function(){return $(".code-popup .textarea").val();}
		});
	}
}

function initTabs(){
	if($('#tabs').get(0)){
		$("#tabs").tabs();
	}
}

function initScroll(){
	if($('.scroll-pane').get(0)){
		$('.scroll-pane').jScrollPane();
	}
}
