/* THIS FUNCTION LOGS THE USER OUT */

//Default XMLHTTP Setup
var http = getHTTPObject();

function getHTTPObject() {
  var xmlhttp;
  if(window.XMLHttpRequest && !(window.ActiveXObject)) {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch(e) {
      xmlhttp = false;
    } // end catch.
  } else if(window.ActiveXObject) {
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(e) {
        xmlhttp = false;
      } // end catch.
    } // end catch.
  } // end else if.
  return xmlhttp;
} // end function.

function logout() {
  http.open("GET", "xml_proxy.php?action=logout", true);
  http.onreadystatechange = function (){  
    if(http.readyState == 4) {
      if(http.status == 200) {
        var results = http.responseText;
        window.location="../../../users/main.php";
      } // end if.
    } // end if.
  } // end function. 
  http.send(null);
} // end function.
