function Tooltip() {
	this.attach = function(type,msg,obj,side) {
		var qT = this.hide(obj);
		
		var newTooltip = document.createElement('div');
		newTooltip.className = "tooltip-holder "+side+"-tooltip";
		newTooltip.innerHTML = '<div class="tooltip '+type+'-tooltip"><div class="inner"><div class="gears">'+msg+'</div></div></div>';
		
		$(obj).append(newTooltip);
		newTooltip.side = side;
		newTooltip.show = function() {
			$(this).css('display','block');
			var tWidth = $('.tooltip',newTooltip).outerWidth();
			$(this).css('width',tWidth).css(this.side,-tWidth-5).children('.tooltip').css(this.side,tWidth).css('top',0);
			if (this.side=="left") var toAnimate = {'left':0,'opacity':1};
			else var toAnimate = {'right':0,'opacity':1};
			$('.tooltip',this).css('opacity',0).animate({'left':0,'opacity':1},1000,'easeInOutExpo');
		}
		newTooltip.hide = function() {
			$('.tooltip',this).stop().animate({'opacity':0,'top':-51},500,'easeInExpo',function(){$(this).parent().remove();});
		}
		setTimeout(function(){newTooltip.show();},(qT>0?500:0));
	}
	this.hide = function(obj) {
		var qT = $('.tooltip-holder',obj).each(function(){
			this.hide();
		}).length;
		return qT;
	}
	this.hasTooltip = function(obj,type) {
		if (type==null || type==undefined)
			var selector = "."+type+"-tooltip";
		else var selector = ".tooltip";
	}
}