/**
 * @author J.Flenter
 *  creates the actual tooltip on all elements with the title attribute
 */


dojo.require("dijit.Tooltip");
dojo.require("ba.Util");

function initTip() {
	queryList = dojo.query("*[title]");
	dojo.forEach(queryList, function(tipElement){
		
		var tipId;
		if(tipElement.id){
				//tipId = tipElement.id;
		} else {
			tipId = ba.Util.generateId();
			tipElement.setAttribute("id", tipId);
		}
		var tt;
		tt = new dijit.Tooltip({label:dojo.attr(tipElement, "title"), connectId:[tipId], width: "150px"});
		tipElement.setAttribute("title", "");
	});
}

dojo.addOnLoad(initTip);

