// JavaScript Document
//alert('infobulle.js');

var divIb;
$(document).ready(function(){
	divIb = $("<div class='infobulle' style='display:none'><h3>Titre</h3><p>Infos du projet</p></div>").get(0);
	$('body').append(divIb);
	// secu contre clignotement
	$(divIb).mouseenter(function(){$(this).hide()});						   
});

function bougeInfobulle(event)
{
	divIb.style.left = (event.clientX)+"px";
	divIb.style.top = (event.clientY+$(document).scrollTop())+"px";
}

function afficheInfobulle(event)
{
	//divIb.style.display = 'block';
	$(divIb).stop(true,true);
	bougeInfobulle(event);
	$(divIb).fadeIn('normal');
}

function masqueInfobulle(event)
{
	//divIb.style.display = 'none';
	$(divIb).stop(true,true);
	bougeInfobulle(event);
	$(divIb).fadeOut('normal');
}


// PROJETS

function afficheInfobulleProjet(oImg,e)
{
	var pinfos = psinfos[parseInt(oImg.alt)];
	$(divIb).empty();
	$(divIb).append($('<h3>').html(pinfos.advertiser));
	$(divIb).append($('<p>').html(pinfos.type + ', ' + pinfos.id));
	
		
	afficheInfobulle(e);
}
function masqueInfobulleProjet(oImg,e)
{
	masqueInfobulle(e);
}
