var Tooltip123 = Class.create( Tooltip, {
  initialize: function( $super, element, tool_tip, template ) {
    //$super( element, tool_tip );
    var options = Object.extend({
      default_css: false,
      margin: "0px",
	  padding: "5px",
	  backgroundColor: "#d6d6fc",
	  min_distance_x: 5,
      min_distance_y: 5,
      delta_x: 0,
      delta_y: 0,
      zindex: 1000
    }, arguments[2] || {});

    this.element      = $(element);

    this.options      = options;
    
   	this.initTooltipDiv( tool_tip, template );

    // hide the tool-tip by default
    this.tool_tip.hide();

    this.eventMouseOver = this.showTooltip.bindAsEventListener(this);
    this.eventMouseOut   = this.hideTooltip.bindAsEventListener(this);
    this.eventMouseMove  = this.moveTooltip.bindAsEventListener(this);

    this.registerEvents();
  },
  
  initTooltipDiv: function( tool_tip, template ) {
  	 // use the supplied tooltip element or create our own div
    if($(tool_tip)) 
    {
      this.tool_tip = $(tool_tip);
    } 
    else if( template != null ) 
    {
      var myTemplate = new Template( template );
      var html = myTemplate.evaluate( { content: tool_tip } );
      this.tool_tip = $(document.createElement("div")); 
      document.body.appendChild(this.tool_tip);
      this.tool_tip.addClassName("tooltip");
      this.tool_tip.innerHTML = html;
    }
    else 
    {
      this.tool_tip = $(document.createElement("div")); 
      document.body.appendChild(this.tool_tip);
      this.tool_tip.addClassName("tooltip");
      this.tool_tip.appendChild(document.createTextNode(tool_tip));
    }
  }
});