/* Pobranie danych XML prognozy pogody dla danej lokalizacji. */
function getWeather(locationId){
   if (locationId == null || locationId.length=="") { return; }

   var url = "http://"+_host+"/s/weathxml/weatherSearch?&locId="+
      locationId+"&cc=*&dayf=2&prod=xoap&par="+
      partId+"&key="+licId;
   httpRequest("GET",url,true,handleResponse);
}

function getNewLocation(){
   var val = document.forms[0]._city.value;
   if(val.length != 0){
      _cit = val;
   } else {
      // Do wyszukania niezbdna jest przynajmniej jedna nazwa miasta.
      return;
   }
   var sval = document.forms[0]._state.value;
   if(sval.length != 0){
      _stat = sval;
      getLocation(_cit+","+_stat);
   } else {
      getLocation(_cit);    // Mona wyszukiwa jedynie nazw miasta.
   }
}
/* Parametrem moe by tylko nazwa miasta lub poczenie miasto,stan, 
jak na przykad Boston,MA. */
function getLocation(_lcity){
   if (_lcity == null || _lcity.length=="") {alert("returning"); return; }
   // Adres URL komponentu serwera; komponent nawizuje poczenie z Weather.com.
   var url = "http://"+_host+"/s/weathxml/addressSearch?city="+_lcity;
   httpRequest("GET",url,true,handleResponse);

}
