
function getPokerTablesInfo()
{
// Obtain an XMLHttpRequest instance
  var req = newXMLHttpRequest();
  //alert(req);
  var host = window.location.host;
  //alert(host);
  // Set the handler function to receive callback notifications
  // from the request object
  var handlerFunction = getReadyStateHandler(req, parseTableInfo);
  req.onreadystatechange = handlerFunction;

  // Open an HTTP POST connection to the shopping cart servlet.
  // Third parameter specifies request is asynchronous.
  
  req.open("POST", "/PokerInfo", true);

  // Specify that the body of the request contains form data
  req.setRequestHeader("Content-Type", 
                       "application/x-www-form-urlencoded");

  // Send form encoded data stating that I want to add the 
  // specified item to the cart.
  req.send("f=0");
 
   window.setTimeout("getPokerTablesInfo()", 1000*60*10);
}
function jpts()
{
    var req = newXMLHttpRequest();
    var host = window.location.host;
   
    var handlerFunction = getReadyStateHandlerJackpots(req, getJacks);
    req.onreadystatechange = handlerFunction;
    req.open("POST", "/pokerJackpots", true);
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.send("");

    window.setTimeout("jpts()", 1000*60*10);
}


function newXMLHttpRequest() 
{
    var xmlreq = false;
    if (window.XMLHttpRequest) 
    {
        // Create XMLHttpRequest object in non-Microsoft browsers
        xmlreq = new XMLHttpRequest();
    } 
    else 
    //if(window.ActiveXObject != null)
    {
        // Create XMLHttpRequest via MS ActiveX
        try
        {
          // Try to create XMLHttpRequest in later versions
          // of Internet Explorer
          xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
        } 
        catch (e1) 
        {
          // Failed to create required ActiveXObject
    //alert("Failed to create required ActiveXObject");
          try {
            // Try version supported by older versions
            // of Internet Explorer
            xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
          } 
          catch (e2)
          {

            // Unable to create an XMLHttpRequest with ActiveX
           // alert(" Unable to create an XMLHttpRequest with ActiveX");
          }
        }
    }
    
    return xmlreq;
}

function getReadyStateHandler(req, responseXmlHandler) 
{
// Return an anonymous function that listens to the 
// XMLHttpRequest instance
    return function () 
    {

        // If the request's status is "complete"
        if (req.readyState == 4) 
        {

              // Check that a successful server response was received
              if (req.status == 200) 
             {

                // Pass the XML payload of the response to the 
                // handler function
                
                responseXmlHandler(req.responseXML);

              } 
               else 
              {
                // An HTTP problem has occurred
                //alert("HTTP error1: "+req.status);
              }
        }
    }
}
function getReadyStateHandlerActiveTables(req, responseXmlHandler) 
{
// Return an anonymous function that listens to the 
// XMLHttpRequest instance
    return function () 
    {

        // If the request's status is "complete"
        if (req.readyState == 4) 
        {

              // Check that a successful server response was received
              if (req.status == 200) 
             {

                // Pass the XML payload of the response to the 
                // handler function
                responseXmlHandler(req.responseXML);
                

              } 
               else 
              {
                // An HTTP problem has occurred
                //alert("HTTP error2: "+req.status);
              }
        }
    }
}

function getReadyStateHandlerJackpots(req, responseXmlHandler) 
{
// Return an anonymous function that listens to the 
// XMLHttpRequest instance
    return function () 
    {

        // If the request's status is "complete"
        if (req.readyState == 4) 
        {

              // Check that a successful server response was received
              if (req.status == 200) 
             {

                // Pass the XML payload of the response to the 
                // handler function
                responseXmlHandler(req.responseXML);
                

              } 
               else 
              {
                // An HTTP problem has occurred
                //alert("HTTP error2: "+req.status);
              }
        }
    }
}
