$(document).ready(function ()
{
	$(".tabsmy").tabsmy();
});


jQuery.fn.tabsmy = function ()
{
	$(this).each(function ()
	{
		var _this = this;
		
		$(this).find(".tabs_title").click(function ()
		{
			var n = $(this).attr("_n");
			
			// Кнопка
				$(_this).find(".tabs_title").removeClass("tab_selected");
				$(this).addClass("tab_selected");
			
			// Текст
				$(_this).find(".tabs_text").hide();
				$(_this).find(".tabs_text_"+n).removeClass('hid').show();
			
			// Размеры POP
				_pop = $(this).closest(".pop");
				if ($(_pop).length)
				{
					$(_pop).pop_auto_resize().pop_resize_max();
				}
		});
	});
	
	return this;
};
