ToolTip = function(config) {
	this.id = Ext.id();
	this.html = '&nbsp;'
	this.height = 100;
	this.width = 200;
	this.alignment = 'r-l';
	this.alignoffset = [-5, 0];
	
	Ext.apply(this, config);
};

Ext.override(ToolTip, {
	show : function(anchor) {
		if (!this.el) {
			this.createDiv();
		}
		
		if (this.el) {
			this.el.show();
			this.el.alignTo(anchor, this.alignment, this.alignoffset);
		}
	},
	
	hide : function(anchor) {
		if (this.el) {
			this.el.hide();
		}
	},
	
	createDiv : function() {
		//create outer frame
		this.el = Ext.DomHelper.append(Ext.getBody(), {
			id: this.id + '_frame',
			tag: 'div',
			html: this.html,
			style: 'position:absolute;overflow:none;background-color:#eeeeee;border:solid 1px black;display:none;z-index:999;top:0;left:0;padding:10px;'
		}, true);
		
		if (this.width) {
			this.el.setWidth(this.width);
		}
		if (this.height) {
			this.el.setHeight(this.height);
		}
	}		
});
