var xmlHttp;
var div_id;
function getXmlHttpObject()
{
	var objXMLHttp=null;
	if (window.XMLHttpRequest)
 	{
 		objXMLHttp=new XMLHttpRequest();
 	}
	else if (window.ActiveXObject)
 	{
 		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
 	}
 	return objXMLHttp;
}
function show(country, this_div){
	
	div_id = this_div;
	xmlHttp=getXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("You are using a too old browser. Please update the browser.");
		return;
	}
	else
	{
		var url="clients.php";
		url=url+"?country="+country;
		xmlHttp.onreadystatechange=getClients;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}
function show_list(){
	
	xmlHttp=getXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("You are using a too old browser. Please update the browser.");
		return;
	}
	else
	{
		var url="clients_list.php";
		//url=url+"?country="+country;
		xmlHttp.onreadystatechange=getClients_list;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}
function getClients()
{
	if(xmlHttp.readyState!=4)
	{
		document.getElementById(div_id).innerHTML='Loading...';	
	}

	if(xmlHttp.readyState==4)
	{		
	document.getElementById(div_id).innerHTML=xmlHttp.responseText;		
	}
}
function getClients_list()
{
	if(xmlHttp.readyState!=4)
	{
		document.getElementById("clients_list").innerHTML='Loading...';	
	}

	if(xmlHttp.readyState==4)
	{		
	document.getElementById("clients_list").innerHTML=xmlHttp.responseText;		
	}
}
function show_details(cid)
{
	xmlHttp=getXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("You are using a too old browser. Please update the browser.");
		return;
	}
	else
	{
		var url="details.php";
		url=url+"?cid="+cid;
		xmlHttp.onreadystatechange=getDetails;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}
function getDetails()
{
	if(xmlHttp.readyState!=4)
	{
		document.getElementById("client_details").innerHTML='Loading...';
	}
	if(xmlHttp.readyState==4)
	{
		document.getElementById("client_details").innerHTML=xmlHttp.responseText;
	}
}

