// JavaScript Document
function sendMessage(from, to, mess)
{
 document.getElementById(('notification_area' + from + to)).innerHTML = "Envoi en cours...";
 document.getElementById(('notification_area' + from + to)).className = "busy";
 
 var _content="fromid=" + from + "&toid=" + to + "&message=" + mess
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("HTTP Request non support par le naviguateur")
  return
  } 
 var _url="http://www.debarena.com/fr/php/addMessage.php"
 xmlHttp.onreadystatechange=function(){stateChanged(from,to)}
 xmlHttp.open("POST",_url,true)
 xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 xmlHttp.send(_content)
}

function stateChanged(from,to) 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(('notification_area' + from + to)).innerHTML = xmlHttp.responseText;
 document.getElementById(('notification_area' + from + to)).className = "done";
 document.getElementById(('messarea' + from + to)).value = "";
 }
} 


function GetXmlHttpObject()
 { 
 var objXMLHttp=null
 if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest()
  }
 else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
 return objXMLHttp
 }
 
 function Toggle(id)
 {
	 el = document.getElementById(id);
	 if (el.style.display=="none") 
	 {
		 el.style.display="block"
	 }
	 else
	 {
		 el.style.display="none"
	 }
 }