(function($) {		
	$.fn.corners = function() {
		return this.each(function() { 			
			$(this).append('<span class="corner cr-top-left" style="top: 0; left: 0"></span>');
			$(this).append('<span class="corner cr-top-right" style="top: 0; right: 0"></span>');
			$(this).append('<span class="corner cr-bot-left" style="bottom: 0; left: 0"></span>');
			$(this).append('<span class="corner cr-bot-right" style="bottom: 0; right: 0"></span>');
			$(this).css({position: 'relative', zIndex: 1});
		});
	};
})(jQuery);

$(document).ready(function() {
	$('#header, #top-menu, #left-menu, .right-block, .main-block, #foot').corners();
	
	$('#top-search, #sb-input').each(function() {
		if (!this.value)
		{
			this.value = this.title;
			this.className = 'empty';
		}
		else
		if (this.value != this.title)
			this.className = '';
	})
	.bind('focus', function(){
		var t = $(this);
		if (t.hasClass('empty'))
		{
			t.val('');
			t.removeClass('empty');
		}
	})
	.bind('blur', function(){
		var t = $(this);
		if (t.val() == '')
		{
			t.val(this.title);
			t.addClass('empty');
		}
	});
});
