// $Id: tooltips.js 565 2009-09-17 13:45:13Z pglh $
// The funky tooltips script
// Requires: jquery core

$(document).ready(
	function()
	{
		// Add text elements
		$(".add-js-tooltip .triggers *[title]").map( function() {
			//$(this.parentNode.parentNode).append('<p class="js-tooltip" id="js-tooltip-'+this.id+'"><strong>'+this.title.replace(/:(.*)/, '')+'</strong>'+this.title.replace(/(.*):/, '')+'</p>');
			$(this.parentNode.parentNode).append('<p class="js-tooltip" id="js-tooltip-'+this.id+'">'+this.title+'</p>');
			this.title = '';
		});

		// Add animations
		$(".add-js-tooltip .triggers *").hover(
			function()
			{
				$('.js-tooltip').hide();
				$('#js-tooltip-'+this.id).stop(true, true).animate({opacity: "show"/*, top: "-140"*/}, "fast");
			},
			function()
			{
				$('#js-tooltip-'+this.id).animate({opacity: "hide"/*, top: "-150"*/}, "slow");
			}
		);
	}
);
