  
  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;
  }

  function requestDetail(value)
  {
    if(http)
    {
      document.body.style.cursor='wait';      
      http.open("GET", "requestDIRECTORY.php?action=detail&directory_id=" + value, true);
      http.onreadystatechange = updateAJAX;
      http.send(null);        
    }
  }
  
  function requestSearch(start)
  {
    if(http)
    {
      region  = document.sf.region.value;
      company = document.sf.company.value;
      keyword = document.sf.keyword.value;
      
      document.body.style.cursor='wait';      
      http.open("GET", "requestDIRECTORY.php?action=search&region_id=" + region + "&company=" + company + "&keyword=" + keyword + "&s=" + start, true);
      http.onreadystatechange = updateAJAX;
      http.send(null);        
    }
  }

  function requestLocate()
  {
    if(http)
    {
      company = document.sf.company.value;
      
      document.body.style.cursor='wait';      
      http.open("GET", "requestDIRECTORY.php?action=locate&&company=" + company, true);
      http.onreadystatechange = updateAJAX;
      http.send(null);        
    }
  }
  function requestSaveSearch(value)
  {
    if(http)
    {
      document.body.style.cursor='wait';      
      http.open("GET", "requestDIRECTORY.php?action=savesearch", true);
      http.onreadystatechange = updateAJAX;
      http.send(null);        
    }
  }

  function requestSaveDetail(value)
  {
    if(http)
    {
      document.body.style.cursor='wait';      
      http.open("GET", "requestDIRECTORY.php?action=savedetail", true);
      http.onreadystatechange = updateAJAX;
      http.send(null);        
    }
  }

  function requestSearchList(value)
  {
    if(http)
    {
      document.body.style.cursor='wait';      
      http.open("GET", "requestDIRECTORY.php?action=searchlist", true);
      http.onreadystatechange = updateAJAX;
      http.send(null);        
    }
  }

  function requestSavedList(value)
  {
    if(http)
    {
      document.body.style.cursor='wait';      
      http.open("GET", "requestDIRECTORY.php?action=searchlist", true);
      http.onreadystatechange = updateAJAX;
      http.send(null);  
    }
  }

  function updateAJAX()
  {
    if (http.readyState == 4) 
    {
//      alert(http.responseText);
      document.body.style.cursor='';
      eval(http.responseText);
    }
  }
  
  function addOption(text,value)
  {
    theSel=document.calc.finish;
    theSel.options[theSel.length] = new Option(text,value);
  }  
  
  var http= getHTTPObject();


