 
var xmlHttp = createXmlHttpRequestObject();

 process();
var sessinoid = "sessinoid";
 
function createXmlHttpRequestObject() 
{
  
  var xmlHttp;
  
  try
  {
     
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    
    var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",

                                    "MSXML2.XMLHTTP.5.0",

                                    "MSXML2.XMLHTTP.4.0",

                                    "MSXML2.XMLHTTP.3.0",

                                    "MSXML2.XMLHTTP",

                                    "Microsoft.XMLHTTP");

   

    for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) 
    {
      try 
      { 
        

        xmlHttp = new ActiveXObject(XmlHttpVersions[i]);

      } 

      catch (e) {}

    }

  }

 

  if (!xmlHttp)

    alert("Error creating the XMLHttpRequest object.");

  else 

    return xmlHttp;

}

 

 

 

function process()
{ 
  if (xmlHttp)
  {
    try

    {
		
      xmlHttp.open("GET", "/getSessionId.php", true);                                               
      xmlHttp.onreadystatechange = getsessionID;  
      xmlHttp.send(null);                                                                                      
    
    }
    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }

  }
}
 
function getsessionID() 
{
  if (xmlHttp.readyState == 1)
  {
    
  }
  else if (xmlHttp.readyState == 2)
  {
   
  }
  else if (xmlHttp.readyState == 3)
  {
     
  }
  else if (xmlHttp.readyState == 4) 
  {
    

    if (xmlHttp.status == 200) 
    {
      try
      {
       
        sessinoid = xmlHttp.responseText;
		 
      }
      catch(e)
      {
       
        alert("Error reading the response: " + e.toString());

      }

    } 
    else
    {
       
      alert("There was a problem retrieving the data:\n" + 
       xmlHttp.statusText);

    }

  }

} 
