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