var SimpleToolTip = Class.create();

SimpleToolTip.prototype = {
    initialize: function(element, tool_tip) {
        this.element  = $(element);
        this.tool_tip = $(tool_tip);

        this.showToolTip = this.showToolTip.bindAsEventListener(this);
        this.hideToolTip = this.hideToolTip.bindAsEventListener(this);

        this.setEvent();
    },

    setEvent: function() {
        Event.observe(this.element, 'mouseover', this.showToolTip);
        Event.observe(this.element, 'mouseout', this.hideToolTip);
    },

    showToolTip: function() {
        if (!this._setPosition) {
            this._setPosition = true;
            var position = Position.positionedOffset(this.element);
            this.tool_tip.style.position = 'absolute';
            this.tool_tip.className      = 'tool_tip';
            this.tool_tip.style.left     = position[0] + 15 + 'px';
            this.tool_tip.style.top      = position[1] + 20 + 'px';
        }
        this.tool_tip.show();
    },

    hideToolTip: function() {
        this.tool_tip.hide();
    }

}

