var obj;
	
 if(window.XMLHttpRequest && !(window.ActiveXObject)) {
    	try {
			obj = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	obj = new ActiveXObject("Msxml2.XMLHTTP4.0");
      	} catch(e) {
        	try {
          		obj = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }

function findplayer(username) {
	
  var myRand=parseInt(Math.random()*99999999);  // cache buster
  var myurlperc = "http://www.callofcombat.com/ajax/add_friend.php?username="+username+"&random="+myRand;  //url to php script
  
  obj.open("GET", myurlperc , true);
  obj.onreadystatechange = useHttpResponse;
  obj.send(null);

}

function useHttpResponse() {
	
	
//Find how many usermaterials-------------------------------------------------

 if (obj.readyState == 4) {
    //alert(obj.status);
	var textout = obj.responseText;
	alert(textout);
	//add to friends
	//updateData();
 }
}