/* ------------------------------------------------- *
 * Tooltip jQuery functions
 * ------------------------------------------------- */
$(document).ready(function(){
	$('.tooltip').each(function(){
		$(this).parent().addClass('active');
		$(this).parent().find('strong').wrapInner('<em/>');
		$(this).parent().parent().append('<div class="tipContent"></div>');
		var tipSpan = $(this).parent().find('span').clone();
		var toolTip = $(this).parent().parent().find('.tipContent');
		var textToInsert = ' - ';
		var tipTitle = $(this).attr('title');
		$(this).attr('title','');
		tipSpan.prependTo(toolTip);
		toolTip.find('span').after(textToInsert);
		toolTip.append(tipTitle);
	});

    $('.tooltip').mouseover(function(e){
		var toolTip = $(this).parent().parent().find('.tipContent');
		toolTip.css({'top':e.pageY-200,'left':e.pageX-50});
	}).mousemove(function(e){
		var toolTip = $(this).parent().parent().find('.tipContent');
		toolTip.css({'top':e.pageY-200,'left':e.pageX-50});
	}).mouseout(function(){
		var toolTip = $(this).parent().parent().find('.tipContent');
        toolTip.css({'top':'-9999px','left':'-9999px'});
	});
});
