
// javascript proxy for webservices
// by Matthias Hertel
/* MailService */

proxies.WeatherService = {
url: "/_layouts/tamtam/WeatherService.asmx",
ns: "http://services.sharepoint.tamtam.nl/"
} // proxies.MailService

proxies.WeatherService.GetWeather = function () { return(proxies.callSoap(arguments)); }
proxies.WeatherService.GetWeather.fname = "GetWeather";
proxies.WeatherService.GetWeather.service = proxies.WeatherService;
proxies.WeatherService.GetWeather.action = "\"http://services.sharepoint.tamtam.nl/GetWeather\"";
proxies.WeatherService.GetWeather.params = ["locationcode"];
proxies.WeatherService.GetWeather.rtype = ["GetWeatherResult:x"];


function ShowWeather (htmlTargetID,retVal) {
   var htmlTarget = document.getElementById(htmlTargetID);
   htmlTarget.innerHTML = '';
   if ( retVal ) {
       var weatherDatas = retVal.getElementsByTagName('weather');
       var weatherData = weatherDatas[0];
       var locationName = weatherData.getAttribute('locationName');
       if ( locationName ) {
           var skycode = weatherData.getAttribute('skycode');
           var skytext = weatherData.getAttribute('skytext');
           var weatherUrl = weatherData.getAttribute('weatherUrl');
           var temperature = weatherData.getAttribute('temperature');
           var degreetype = weatherData.getAttribute('degreetype');
           var winddisplay = weatherData.getAttribute('winddisplay');
           var humidity = weatherData.getAttribute('humidity');
           htmlTarget.innerHTML = '';
           htmlTarget.innerHTML = '<img src="/_layouts/images/tamtam/weather/' + skycode + '.gif" alt="' + skytext + '" style="float:left"/>';
           htmlTarget.innerHTML += '<a href="' + weatherUrl + '&setunit=C" target="_blank">' + locationName + '</a>';
           htmlTarget.innerHTML += '<br />t: '+temperature+' &#176;'+degreetype+' w: '+ winddisplay +' h: '+humidity+'%';
       }
       else {
           htmlTarget.innerHTML = 'No Connection to MSN Weather could be made.';
       }
   }
   else {
       htmlTarget.innerHTML = 'No Connection to MSN Weather could be made.';
   }
 } // end of ShowWeather 