var xmlHttp
function contact_list()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="iran.chat_contact_list.php?"
url=url+"&amp;sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function search_people(people)
{ 
document.getElementById('find').style.visibility="visible";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="iran.search_people.php?people="+people
url=url+"&amp;sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedP 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedP() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	document.getElementById("result").innerHTML=xmlHttp.responseText ;
 }  
}



function add_contact(id)
{ 
document.getElementById(id).src="images/already_in_basket.gif";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="iran.chat_add_contact_list.php?id="+id
url=url+"&amp;sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedCC
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangedCC() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 }  
}



function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	document.getElementById("contact_list").innerHTML=xmlHttp.responseText ;
 }  
}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
