<SCRIPT LANGUAGE="JavaScript">
   function getXmlHttpObject(){
      if (window.XMLHttpRequest)
         return new XMLHttpRequest();
      else if (window.ActiveXObject)
         return new ActiveXObject("Microsoft.XMLHTTP");
      else {
         alert("Obiekt XMLHttpRequest nie jest obsugiwany!");
         return null;
      }
   }

   function handleHttpResponse() {
      if (http.readyState == 4) {
         document.getElementById('load').
            innerHTML += ' [done]<br />Generowanie mapy...';
         results = http.responseText;
         if (!results.match('rss')) {
            document.getElementById('load').
            innerHTML = '[BD] Ten adres URL prawdopodobnie '+
               'nie jest zarejestrowany w GeoURL.';
         } else {
            document.forms[0].xmlsrc.value = results;
            document.forms[0].submit();
         }
      }
   }

   function loadMapData() {
      resetLoadDiv();
      showLoadDiv();
      var url = document.forms[0].url.value;
      var post_url = '/cgi-bin/geourlmap.cgi'
         post_data = 'url=' + url;
      http.open("POST", post_url);
      http.setRequestHeader('Content-Type', 
         'application/x-www-form-urlencoded; charset=iso-8859-2');
      http.send(post_data);
      http.onreadystatechange = handleHttpResponse;
      return false;
   }

   function resetLoadDiv() {
      document.getElementById('load').
         innerHTML = 'Loading map data ...';
   }

   function showLoadDiv() {
      document.getElementById('load').
      style.display = 'block';
   }

var http = getXmlHttpObject();
</SCRIPT>
