(function($){ 
	$.fn.toolTIP = function(){
		return this.each(function() {
			var text = $(this).attr("title");
			$(this).attr("title", "");
			if(text != undefined) {
				if (text.length > 0) {
					$(this).hover(function(e){
						var tipX = e.pageX + 0;
						var tipY = e.pageY + 25;
						$(this).attr("title", ""); 
						$("body").append("<div id='toolTIP' style='position: absolute; z-index: 9999999; display: none;'>" + text + "</div>");
						if($.browser.msie) var tipWidth = $("#toolTIP").outerWidth(true)
						else var tipWidth = $("#toolTIP").width()
						$("#toolTIP").width(tipWidth);
						$("#toolTIP").css("left", tipX).css("top", tipY).fadeIn("medium");
					}, function(){
						$("#toolTIP").remove();
						$(this).attr("title", text);
					});
					$(this).mousemove(function(e){
						var tipX = e.pageX + 0;
						var tipY = e.pageY + 25;
						var tipWidth = $("#toolTIP").outerWidth(true);
						var tipHeight = $("#toolTIP").outerHeight(true);
						if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
						if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
						$("#toolTIP").css("left", tipX).css("top", tipY).fadeIn("medium");
					});
				}
			}
		});
	}
})(jQuery);
