cms_inittab.push(function()
 {
	var RE=/~b|~e|~~|~lt;|~gt;|~tilde;|~amp;|~q|~u/g;
	var rpl = {
		'~b':'<',
		'~e':'>',
		'~~':'~',
		'~lt;':'<',
		'~gt;':'>',
		'~tilde;':'~',
		'~u':'&',
		'~amp;':'&',
		'~q':'"'
	 }
	function decodeConfig(config)
	 {
		return config.replace(RE,function(a){return rpl[a];})
	 }
	function getconfig(e)
	 {
		var confstr=e.currentTarget.getAttribute("config");
		var config={};
		try
		{
			config=Y.JSON.parse(decodeConfig(confstr));
		}
		catch (ex)
		{
			config={error:ex};
		}
		
		return config;
	 }
	
	YUI().use("node","event","selector-css3","json","overlay", function(Y) {
		if ( Y.one(".dyn-tooltip[config]") )
		{
			var tt=new Y.Overlay({visible:false,width:120});
			tt.render();
			tt.get("contentBox").addClass("tooltip");
			Y.delegate("mouseover",function(e) {
				var el=e.currentTarget;
				var fn=null,ret=null;
				var config;
				el.set("title","");
				function showtooltip(html)
				 {
					tt.set("bodyContent",html);
					tt.set("align",{node:config.el||el,points:config.points||["tl","bl"]});
					if ( config.width )
						tt.set("width",config.width);
					tt.show();
				 }
				
				try
				{
					config=Y.JSON.parse(decodeConfig(el.getAttribute("config")));
					ret=config.html||config.title;
					if ( config.fun )
					{
						try
						{
							fn=new Function("config","calltooltip",config.fun);
							ret=fn.call(el,config,showtooltip)
						}
						catch (ex)
						{
						}
					}
					if ( ret!==false  )
						showtooltip(ret||config.html);
				}
				catch (ex)
				{
					Y.log('CATCH: mouseover: '+el.get("tagName"));
				}
				
			 },document,".dyn-tooltip[config]");
			Y.delegate("mouseout",function(e) {
				Y.log('mouseout');
				tt.hide();
			 },document,".dyn-tooltip[config]");
		}
	 });
 });
