var Defentition = Class.create();
Defentition.prototype = {
	initialize: function(dfn, text) {
		this.dfn_tag = dfn
		this.defenition = text
		if (this.dfn_tag.observe) {
			this.dfn_tag.observe('mouseover', this.show.bindAsEventListener(self, this), false);
			this.dfn_tag.observe('mouseout', this.hide.bindAsEventListener(self, this), false);	
		}
		else { //branch for IE's poor event handling
			this.dfn_tag.onmouseover = this.show.bindAsEventListener(self, this);
			this.dfn_tag.onmouseout = this.hide.bindAsEventListener(self, this);
		}
	},
	show: function(self, context) {
		var self = (arguments[0].target)?arguments[0].target:arguments[0].srcElement;
		if (self.setStyle) {
			self.setStyle( { textDecoration: 'underline'});
		}
		else { //once again, cleaning up after IE
			self.style.textDecoration = "underline";
		}
		
		context.box = document.createElement('div');
		context.box.id = 'definition';
		context.box.innerHTML = context.defenition;
		document.lastChild.lastChild.appendChild(context.box);
		//Position.absolutize(context.box);
		pos = Position.cumulativeOffset(self);
		p_top = pos[1] - 176;
		p_left = pos[0] - 45;
		$(context.box).setStyle( { 'top': p_top+"px", 'left': p_left+"px"} );
		
	},
	hide: function(self, context) {  
		var self = (arguments[0].target)?arguments[0].target:arguments[0].srcElement;
		context.box.parentNode.removeChild(context.box); 
		if (self.setStyle) {
			self.setStyle( { textDecoration: 'none'}); 
		}
		else { //once again, cleaning up after IE
			self.style.textDecoration = "none";
		}
	}
}