$(document).ready(
	function(){
		
		// tabs
		$('#tabs li').removeClass('active');
		if ($("#rubrikator").length == 0) $('#tabs li:first').addClass('active');
		else {
			$("#tabs_content1").hide();
		}
		$('#tabs a').each(function(){
			var href = $(this).attr('href');
			$("#tabs_content #"+href).hide();
		});
		
		var active_elem = $("#tabs li.active").find("a").attr("href");
		$("#tabs_content #"+active_elem).show();
		
		if ($("#tabs li.active").find("a").attr("href") == "tab1"){
				$("#tabs_content div.more_info_inner").removeClass("for_blog");
		}
		else{
			$("#tabs_content div.more_info_inner").addClass("for_blog");
		}
		
		$('#tabs a').click(function(){
			if ($("#rubrikator").length != 0){
				$("#tabs_content1").show();
			}
			$('#tabs a').each(function(){
				var href = $(this).attr('href');
				$("#tabs_content #"+href).hide();
			});
			var href = $(this).attr('href');
			$("#tabs_content #"+href).show();
			$("#tabs").find('li').removeClass('active');
			$(this).parents('li').addClass('active');
			
			if (href == "tab1"){
				$("div.more_info_inner").removeClass("for_blog");
			}
			else{
				$("div.more_info_inner").addClass("for_blog");
			}
			
			return false;
		});
		
		
		$("#rubrikator").ajaxStop(function(){
			if ($("#tabs li.active").length == 0) {
				$("#tabs_content1").hide();
				$('#tabs a').click(function(){
					$("#tabs_content1").show();
					$("#tabs").find('li').removeClass('active');
					$(this).parents('li').addClass('active');
				});
			}
		});
		
		$('.show-text').click(function() {
		if($('#'+this.name).css('display')=="none")
		$('#'+this.name).slideDown("slow");
		else
		$('#'+this.name).slideUp("slow");
		});
		
	}
);


