/**
 * @author franci
 */

function ajaxLink(link) {
	
	document.getElementById('divCentrale').innerHTML = "<img class='loadingIcon' src='img/loading.gif'>";

	/*var realIcon;
	
	realIcon = document.getElementById(icon).src;
	
	document.getElementById(icon).src = "img/icone/loading.gif";*/
	
	//Mozilla-based browsers

	if(window.XMLHttpRequest){
		request = new XMLHttpRequest();
	} else if (window.ActiveXObject){
		request=new ActiveXObject("Msxml2.XMLHTTP");
		if (! request){
			request=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	  request.onreadystatechange = function() {
		  
      if(request.readyState == 4) {
    	 // document.getElementById(icon).src = "img/"+icon+".png";
          document.getElementById("divCentrale").innerHTML = request.responseText;
      }
      
  }
  
  var ind = link.split("?");
  
  if (ind.length>1) {
	nocache = "&dummy=" + new Date().getTime();
  }  else {
	nocache = "?dummy=" + new Date().getTime();
  }                                     
  
  request.open("GET",link + nocache,true);
                                          
  request.send(null);
                                         
}