$(window).ready(function()
{
	$('#s').val('Поиск по блогу...');
	$('#s').focus(function() {
		$(this).val($(this).val() == 'Поиск по блогу...' ? '' : $(this).val());
	});
	$('#s').blur(function() {
		$(this).val($(this).val() == '' ? 'Поиск по блогу...' : $(this).val());
	});
	
	if (!$('#categories_menu li').hasClass('current-cat')) {
		$('#categories_menu li:first').addClass('current-cat');
	}
});

(function($) {
	$.fn.tipco = function() {
		return this.each(function() {
			$(this).hover(function() {
				var offset = $(this).offset();
				var element = $(this);
				var tipco = element.prev('span.tipco');
				
				if (tipco.length) {
					tipco.fadeIn(200).css({
						left: offset.left - ((tipco.outerWidth(true) - element.outerWidth(true)) / 2),
						top: offset.top - element.outerHeight(true)
					});
				}
			}, function() {
				$(this).prev('span.tipco').fadeOut(200);
			});
		});
	}
})(jQuery);
