bolha = {
	textos: null,

	revela: function (eo, el, op) {
		var coords = eo.getXY();
		var bubble = Ext.get('bolha');
		bubble.dom.innerHTML = bolha.textos[el.id];
		bubble.setStyle({display:'block'});
		var vert = bubble.getHeight() + 2;
		var hori = 16;
		bubble.stopFx().moveTo(coords[0]+hori, coords[1]-vert).show({duration: 0.5, block:true});
	},


	mostra: function (eo, el, op) {
		var coords = eo.getXY();
		var bubble = Ext.get('bolha');
		var vert = bubble.getHeight() + 2;
		var hori = 16;
		bubble.stopFx().moveTo(coords[0]+hori, coords[1]-vert).show();
	},

	apaga: function (eo, el, op) {
		if (el.id != 'bolha') {
			Ext.get('bolha').stopFx().hide({duration: 0.5, block:true});
		}
	},

	init: function (){
		Ext.select("*.bub").each(function(k){
			Ext.get(k.dom).on('mouseenter', bolha.revela);
			Ext.get(k.dom).on('mousemove', bolha.mostra);
			Ext.get(k.dom).on('mouseleave', bolha.apaga);
		})
	}
}

Ext.onReady(bolha.init);
