// JavaScript Document

var mouse_x = 0;
  
var mouse_y = 0;

function jajax(id_asso){
	var xhr_object = null;
	
	if(window.XMLHttpRequest) // Firefox
	   xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // Internet Explorer
	   xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else { // XMLHttpRequest non supporté par le navigateur
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
	   return;
	}
	
	var method   = "GET";
	var filename = "div_asso.php";
	var data     = "id_asso="+id_asso;
	
	 filename += "?"+data;
	
	
	xhr_object.open(method, filename, true);
	
	xhr_object.onreadystatechange = function() {
	   if(xhr_object.readyState == 4) {
		  var tmp = xhr_object.responseText;
		  affiche_div(tmp);
		  
	   }
	}
	
		
	xhr_object.send(data);
}

function affiche_div(txt){
	var obj = document.getElementById("savoir_plus");	
	
	//obj.style.width="200px";
	//obj.style.height="400px";
	obj.style.visibitity="visible";
	
	
	//alert(mouse_y);
	obj.style.left = mouse_x + "px";
	obj.style.top = mouse_y + "px";
	obj.style.width = obj.offsetWidth;
	obj.style.height = obj.offsetHeight;
	//alert(txt);
	obj.innerHTML=txt;
	
}


function register_position(){
  

  
     document.onmousemove = position;
  
	 //position();
 }
  
 function position(evt){
  
     if(!evt) evt = window.event;    
  
     mouse_x = evt.clientX;
  
     mouse_y = evt.clientY;
	 
	 //return mouse_x;
    document.getElementById("coordonnees").innerHTML = "X : "+mouse_x+" ; Y : "+mouse_y;
 }
