/**
 * JavaScript for tooltips
 * Based on David Walsh Blog david walsh blog
 * http://davidwalsh.name/mootools-12-tooltips-customize
 */

window.addEvent('domready', function() {
  
	//store titles and text
	$$('a.tooltip').each(function(element,index) {
		var content = element.get('title').split('::');
		element.store('tip:title', content[0]);
		element.store('tip:text', content[1]);
	});
  
	//create the tooltips
	var tooltip = new Tips('.tooltip',{
		className: 'tooltip',
		fixed: true,
		hideDelay: 50,
		showDelay: 50
	});

	tooltip.addEvents({
		'show': function(tip) {
			tip.fade('in');
		},
		'hide': function(tip) {
			tip.fade('out');
		}
	});
});
