ToolTip = function() {
	var _toolTip = null;
	var _wasTip = false;
	var _ctd = '';

	this.init = function() {
		var elms = arguments;
		for (var i = 0, l = elms.length; i < l; i++) {
			_addListeners(elms[i]);
		}
	};

	this.setToolTip = function(pStr) {
		_toolTip = $('#' + pStr) || null;
	};

	var _addListeners = function(pElm) {
		var elm = $("#" + pElm);

		elm.hover(_mouseOver, _mouseOut);
		_toolTip.hover(_mouseOverTip, _mouseOutTip);
	};

	var _mouseOver = function(e) {
		_ctd = $(this).attr('title');
		$(this).attr('title', '');
		var pos = $(this).offset();
		pos.width = $(this).width();
		pos.height = $(this).height();

		_toolTip.hide()
				.html('<b>' + _ctd.split(' ').join('&nbsp;') + '</b>')
				.css('left', (pos.left + (pos.width / 2) - _toolTip.width() - parseInt(_toolTip.css('padding-left')) - parseInt(_toolTip.css('padding-right')) + 'px'))
				.css('top', (pos.top + pos.height) + 'px');

		if (!_wasTip) {
			_toolTip.fadeIn('slow');
		} else {
			_toolTip.show();
		}
		_wasTip = false;
	};

	var _mouseOut = function(e) {
		$(this).attr('title', _ctd.split('&nbsp;').join(' '));
		_toolTip.hide();
		_wasTip = false;
	};

	var _mouseOverTip = function(e) {
		_toolTip.show();
		_wasTip = true;
	};

	var _mouseOutTip = function(e) {
		_toolTip.hide();
	};
};