(function($){
	$.fn.tooltip = function(options) {
		var defaults = {
			offsety : 10
		};
		var options = $.extend(defaults, options);
		return this.each(function() {
			if($(this).attr('title') != ""){
				var text = $(this).attr('title');
				var toolTipHTML = "<div class='toolTipWrapper'><div class='toolTip'><div class='toolTipInner'>" + text + "</div></div></div>";
				$(this).removeAttr('title');
				$(this).before(toolTipHTML);
				var toolTip = $(this).prev(".toolTipWrapper");
				var curWidth = toolTip.width();
				var offsetx = curWidth - 111;
				offsetx = Math.ceil(offsetx/2)*(-1);
				toolTip.css({
					'margin-left' : offsetx
				});
				toolTip.hide();
				$(this).parent().hover(function(){
					toolTip.fadeIn(300);
				},
				function () {
					toolTip.fadeOut(300);
				});
			}
		});                    
	};
})(jQuery);