$(document).ready(function() {
	
		/* A$out infobulle sur la class .info-title*/
		$('*[title]').each(function() {
		if ($(this).hasClass('info-title')){
			//$(this).css('border','1px solid red');
			var saved_title = $(this).attr('title');
			$(this).hover(function() {
				$(this).attr('title', '');
				saved_htitle = $('<span class="htitle">'+saved_title+'</span>');
				if (saved_title.length > 30) saved_htitle.addClass('htitle-max');
				if (saved_title.length > 40) saved_htitle.addClass('htitle-max2');
				if (saved_title.length > 45) saved_htitle.wrapInner('<marquee behavior="alternate" scrolldelay="150"></marquee>');
				$('body').prepend(saved_htitle);
				$(this).mousemove(function(e) {
					var posLeft = e.pageX;
					var posTop = e.pageY + 14;
					saved_htitle.css({
						left: posLeft+'px',
						top: posTop+'px'
					});
				});
			}, function() {
				saved_htitle.remove();
				$(this).attr('title', saved_title);
			});
		}
	});
});

function popup_siteinfo(element, bookmaker_id, bookmaker_name, bookmaker_bonus){
	html = '<div class="site-info">';
	html +='<span class="left"><img src="/wp-content/themes/3c-seo/images/table-odds/book'+bookmaker_id+'-nomargins.png" alt="'+bookmaker_name+'" /></span>';
	html +='<span class="middle"></span>';
	html +='<span class="right">Bonus '+bookmaker_bonus+'</span>';
	html +='</div>'; 
	var siteinfo = $(html);
	$('body').prepend(siteinfo);
	var offsetLeft = siteinfo.find('.left').width();
	$(element).mousemove(function(e) {
		var posLeft = e.pageX - offsetLeft;
		var posTop = e.pageY + 14;
		siteinfo.css({
			left: posLeft+'px',
			top: posTop+'px'
		});
	}).mouseout(function() {
			siteinfo.remove();
	});
} 

