var url = "/scripts/friends.php?param="; // The server-side script 
var id = 0;

function updateName(sid,uid) { 
  id = sid;
  // display a quick message while the script is being processed 
  eval("document.getElementById('un"+id+"').innerHTML = '...saving...';"); 
//  var name = document.getElementById("email").value; 
  http.open("GET", url + id + "&uid=" + uid, true); 
  http.onreadystatechange = handleHttpResponse; 
  http.send(null); 
} 

function deleteName(sid,uid) { 
  url = "/scripts/friendsDelete.php?param=";
  id = sid;
  // display a quick message while the script is being processed 
  eval("document.getElementById('un"+id+"').innerHTML = '...saving...';"); 
//  var name = document.getElementById("email").value; 
  http.open("GET", url + id + "&uid=" + uid, true); 
  http.onreadystatechange = handleHttpResponse; 
  http.send(null); 
} 

function handleHttpResponse() {
  if (http.readyState == 4) { 
    results = http.responseText; 
    //var name = document.getElementById("email").value; 
    if(results == "") results = "Added to Friends List!"; 
    // the div in which the message appears 
    eval("document.getElementById('un"+id+"').innerHTML = results;"); 
  } 
} 

function getHTTPObject() { 
  var xmlhttp; 
  /*@cc_on 
  @if (@_jscript_version >= 5) 
    try { 
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e) { 
      try { 
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
      } catch (E) { 
        xmlhttp = false; 
      } 
    } 
  @else 
  xmlhttp = false; 
  @end @*/ 
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
    try { 
      xmlhttp = new XMLHttpRequest(); 
    } catch (e) { 
      xmlhttp = false; 
    } 
  } 
  return xmlhttp; 
} 
var http = getHTTPObject(); // We create the HTTP Object 
