var MooTip = new Class({
	subject: false,
	orientation: 'left',
	offset:  { x: 0, y: 0 },

	initialize: function(subject, settings){
		if(settings.offset){ this.offset = settings.offset; }
		if(settings.orientation){ this.orientation = settings.orientation; }

		if(subject){ 
			this.subject = subject;
		} else {
			return false; 
		}

		this.start();
	},

	start: function(){
		var mTips = this.subject;

		var self = this;
		var toolTips = new Tips(mTips, {
				className: 'mooTip ' + this.orientation, 
				fixed: 'true', 
				showDelay: 500, hideDelay: 500,
				offset: self.offset,  /* 1.2.5 */
				offsets: self.offset, /* 1.2.1 - legacy */

				text: function(el){
					var content = el.getChildren('.description');
					return content[0].get('html');
				},

				onShow: function(toolTipElement){
						toolTipElement.fade('in');
				},

				onHide: function(toolTipElement){
						toolTipElement.fade('out');
				}
		});
	}
});

window.addEvent('domready', function(){
	var hpTips = new MooTip($$('#tags li'), { orientation: 'right', offset: { x: -80, y: -95 } });
	var naviTips = new MooTip($$('#navi li.lion'), { offset: { x: 200, y: -100 } });
});

