(function($) {
var w, nw, settings;
	$.fn.tooltip = function(tooltipTexts, options) {
		var texts = $.extend({'default':'no text'},tooltipTexts);
		var settings = $.extend({'cssWidth': 250},options);
		$(this).each(function() {
			if(texts[$(this).attr('id')] != undefined) {
				w = $('#' + $(this).attr('id')).width();
				nw = eval(w - settings.cssWidth)
				$('#' + $(this).attr('id')).focus(function() {
					$(this).animate({
						'width': Number(nw) + 'px'
					}, 500, function() {
						$(this).parent().append('<div class="textData">' + texts[$(this).attr('id')] + '</div>');
						$(this).parent().children('div').fadeIn(250);
						$(this).parent().children('div').css({
							'width': eval(settings.cssWidth - 60) + 'px'
						});
					});
				});
				$('#' + $(this).attr('id')).blur(function() {
					$(this).parent().children('div').fadeOut(200, function() {
						$(this).siblings('input, select, textarea').animate({
							'width': eval(Number(nw) + Number(settings.cssWidth)) + 'px'
						}, 500, function() {
							$(this).parent().children('div').remove();
						});
					});
				});
			}
		});
	};

})(jQuery);