(function(){
YAHOO.namespace("gaia.app.profiles");

YAHOO.gaia.app.profiles.tooltip = function() {
 	return {
		// Initialization event for badges panel
		initBadges : function() {
			function showBadge(e, scope) {
				var el = YAHOO.util.Event.getTarget(e);
				if (el.tagName.toLowerCase() !== 'img') { return; }

				// Get the badge id and user id by parsing the alt tag
				var item_parts = el.getAttribute('hidden_alt').split(' - ');
				scope.tooltip = new YAHOO.gaia.widget.Tooltips.Badge(item_parts[0], item_parts[1], el);
				scope.tooltip.show();
				YAHOO.util.Short("#tooltip-badge .bd").css("height", "auto");
			};
			// add a listener to show each badge.
			YAHOO.util.Event.addListener('badges', 'click', showBadge, profiletooltip);
		}
	};
}();

// end anonymous function scope
})();
		
var profiletooltip = YAHOO.gaia.app.profiles.tooltip;
