// ajax page

var xhr = null; 
function getXhr()
{
     if(window.XMLHttpRequest)xhr = new XMLHttpRequest(); 
else if(window.ActiveXObject)
  { 
  try{
     xhr = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) 
     {
     xhr = new ActiveXObject("Microsoft.XMLHTTP");
     }
  }
else 
  {
  alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
  xhr = false; 
  } 
}


function init()
{
loop();
}

function loop()
{
setTimeout('loop();',3000);
ShowDisplaymp();
}

 
function ShowPage(page)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('page').innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","ajax.php?page="+page,true);
xhr.send(null);
}

// ajax actualite

function Showchat(chat)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('postit').innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","ajax.php?chat="+chat,true);
xhr.send(null);
}

function ShowJournal(journal)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('journal').innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","ajax.php?journal="+journal,true);
xhr.send(null);
}


function ShowDisplaymp()
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('displaymp').innerHTML=xhr.responseText;
     }
    }
xhr.open("GET","displaymp.php",true);
xhr.send(null);
}


function showcontactmp(fam)
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('postit').innerHTML=xhr.responseText;
     }
    };
xhr.open("POST","chat.php",true);
 xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  // Nous envoyons à ajaxiris.php la valeur du radio
  var data = "postitchat="+fam;
  xhr.send("postitchat="+fam);
  

}


function Showmp()
{
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {
     document.getElementById('postit').innerHTML=xhr.responseText;
     }
    };
xhr.open("POST","chat.php",true);
 xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  // Nous envoyons à ajaxiris.php la valeur du radio


 
  
  var data='postitchat='+document.formcontactmp.postitchat.value+'&textmp='+document.formcontactmp.textmp.value;
    xhr.send(data);

alert(data);
 
 


}


 