var activeTD = 'td_1';
var _theColor = '';

function setTheColor(couleur){
	_theColor = couleur;
}

function checkColor(elt){
	if(activeTD == elt){
		return '#ffffff';
	}else{
		return _theColor;
	}
}

function gE(elt){
	return document.getElementById(elt);
}

function loadDico(mot, elt){
	$('#'+elt).html("<div style=\"margin: auto; width: 100%; text-align: center; font-size: 15px; font-weight: bold;\"><br /><br />Chargement...</div>");
	$('#'+elt).load('/dicodina.php?mot='+mot);
	
	window.location.hash = "#dicodina";
}

function loadCodina(me, elt, page){
	activeTD = me;
	for(i = 1 ; i<=15 ; i++){
		if(gE("td_"+i)){
			gE("td_"+i).bgColor = checkColor("td_"+i);
		}
	}

	$('#'+elt).html("<div style=\"margin: auto; width: 100%; text-align: center; height: 300px; font-size: 15px; font-weight: bold;\"><br /><br /><br />Chargement...</div>");
	$('#'+elt).load(page);
	
	return false;
}

function GetId(id){
	return document.getElementById(id);
}
var infoBulleVisible=false;
 
function move(e) {
	if(infoBulleVisible) {
		if (navigator.appName!="Microsoft Internet Explorer") {
			GetId("curseur").style.left=e.pageX + 5+"px";
			GetId("curseur").style.top=e.pageY + 10+"px";
		} else {
			if(document.documentElement.clientWidth>0) {
				GetId("curseur").style.left=20+event.x+document.documentElement.scrollLeft+"px";
				GetId("curseur").style.top=10+event.y+document.documentElement.scrollTop+"px";
			} else {
				GetId("curseur").style.left=20+event.x+document.body.scrollLeft+"px";
				GetId("curseur").style.top=10+event.y+document.body.scrollTop+"px";
			}
		}
	}
}
 
function montreIB(elt) {
  if(infoBulleVisible==false) {
	  GetId("curseur").style.visibility="visible"; 
	  GetId("curseur").innerHTML = 'Cliquez ici pour voir la définition de "' + elt.innerHTML + '"'; 
	  infoBulleVisible=true;
  }
}
function cacheIB() {
	if(infoBulleVisible==true) {
		GetId("curseur").style.visibility="hidden"; 
		infoBulleVisible=false;
	}
}
document.onmousemove=move; 
