var xmlhttp,httpCible;etatroule=0;
function Ajaxshow(str,url,cible)
{
httpCible=cible;
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
 document.getElementById(httpCible).innerHTML="<center><img height=\"64\" width=\"64\" src=\"../images/loading.gif\"/> Veuillez patienter</center>";
url=url+"?id="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById(httpCible).innerHTML=xmlhttp.responseText;

}
}
// deuxieme fonction ajax pour la suppression sur place on va devoir optimiser plus tard ******************************************************************
//********************************************************************************************************************************************
//********************************************************************************************************************************************
function Ajaxdel(str,url)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
 obj=document.getElementById(str);
 obj.innerHTML="<center><img height=\"64\" width=\"64\" src=\"images/loading.gif\"/> Veuillez patienter</center>";
url=url+"?id="+str;
url=url+"&sid="+Math.random();

xmlhttp.onreadystatechange=etatSuppression;
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
}

function etatSuppression()
{
if (xmlhttp.readyState==4)
{
obj.className="Cache";
}
}
//*****
function Ajaxupdate(str,url)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
 obj=document.getElementById(str);
 obj.className="Grise";
url=url+"?id="+str;
url=url+"&sid="+Math.random();

xmlhttp.onreadystatechange=etatSuppression;
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
}


// fin de ce genre de fonction
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;

}

//********************************************************************************************************************************************
//********************************************************************************************************************************************

function ecritureInterne(chaine,id){

document.getElementById(id).innerHTML=chaine;

} 

function AfficheProfil(){
page="?php";
document.getElementById("affichage").innerHTML=page;

}

function deroule(id,image){

if(etatroule==0){
document.getElementById(id).style.height="auto";
document.getElementById(image).innerHTML="<img src=\"../images/roule.png\"/>";
etatroule=1;

}
else
 if(etatroule==1){
document.getElementById(id).style.height="100px";
document.getElementById(image).innerHTML="<img src=\"../images/deroule.png\"/>";
etatroule=0;
}
}

