timerWeather=null;function weather(b){this.url="http://weather.yahooapis.com/forecastrss?p=BEXX0005&u=c";this.DivID=b;this.salt=Math.floor(Math.random()*999999999);this.isIE=((navigator.userAgent.indexOf("MSIE")>=0&&navigator.userAgent.indexOf("opera")==-1&&document.all)?true:false);this.RootUrl="http://www.filigranes.be/";var h=document.getElementsByTagName("head")[0];if(h){var a=h.getElementsByTagName("script");var d=h.getElementsByTagName("link");var g=false;for(var f=0;f<a.length;f++){var c=a[f];if(c.src.indexOf("date.js")>0){g=true;break}}if(g==false){var e=document.createElement("script");e.type="text/javascript";e.src="http://www.filigranes.be/js/methods/date.js";h.appendChild(e)}}}GetWeatherData=function(c){var a="Unknown";var b=null;if(document.getElementById(c.DivID)){document.getElementById(c.DivID).className="Weather";if(b){divWeatherImg=document.createElement("div");divWeatherImg.id="img_"+c.salt;divWeatherImg.className="WeatherImage";if(c.isIE){b.onmouseover=function(){showTooltip(event,a);return false};b.onmouseout=function(){hideTooltip()}}else{b.onmouseover=function(d){showTooltip(d,a);return false};b.onmouseout=function(){hideTooltip()}}divWeatherImg.appendChild(b);document.getElementById(c.DivID).appendChild(divWeatherImg)}divWeatherText=document.createElement("div");divWeatherText.id="divtext_"+c.salt;divWeatherText.className="WeatherText";document.getElementById(c.DivID).appendChild(divWeatherText);pWeatherText=document.createElement("p");pWeatherText.id="text_"+c.salt;divWeatherText.appendChild(pWeatherText);document.getElementById(c.DivID).appendChild(document.createTextNode(""));c.RefreshHour();c.RefreshAsync()}new Ajax.Request(c.RootUrl+"Weather.ashx",{method:"get",onSuccess:function(d){c.OnGetData(d)},onFailure:function(){c.OnGetData()},parameters:{WeatherUrl:c.url,ms:new Date().getTime()}})};weather.prototype.OnGetData=function(h){if(timerWeather){clearInterval(timerWeather)}if(document.getElementById(this.DivID).hasChildNodes()){while(document.getElementById(this.DivID).childNodes.length>=1){document.getElementById(this.DivID).removeChild(document.getElementById(this.DivID).firstChild)}}if(h&&h.responseXML){var b=h.responseXML.getElementsByTagName("rss");if(b&&b.length>0){var e=b[0].getElementsByTagName("channel");if(e){var g=e[0].getElementsByTagName("item");if(g){var a="Unknown";var f=g[0].getElementsByTagName("yweather:condition");if(f&&f.length>0){if(f[0].attributes.getNamedItem("temp")){a=f[0].attributes.getNamedItem("temp").nodeValue+"° C"}}else{for(i=0;i<g[0].childNodes.length;i++){if(g[0].childNodes[i].nodeName=="yweather:condition"){if(g[0].childNodes[i].attributes.getNamedItem("temp")){a=g[0].childNodes[i].attributes.getNamedItem("temp").nodeValue+"° C"}}}}var c=g[0].getElementsByTagName("description");var d=null;if(c){if(c[0].childNodes.length>0){tempDiv=document.createElement("div");tempDiv.innerHTML=c[0].childNodes[0].nodeValue;if(tempDiv.getElementsByTagName("img")){d=tempDiv.getElementsByTagName("img")[0]}tempDiv.innerHTML=""}}if(document.getElementById(this.DivID)){document.getElementById(this.DivID).className="Weather";if(d){divWeatherImg=document.createElement("div");divWeatherImg.id="img_"+this.salt;divWeatherImg.className="WeatherImage";if(this.isIE){d.onmouseover=function(){showTooltip(event,a);return false};d.onmouseout=function(){hideTooltip()}}else{d.onmouseover=function(j){showTooltip(j,a);return false};d.onmouseout=function(){hideTooltip()}}divWeatherImg.appendChild(d);document.getElementById(this.DivID).appendChild(divWeatherImg)}divWeatherText=document.createElement("div");divWeatherText.id="divtext_"+this.salt;divWeatherText.className="WeatherText";document.getElementById(this.DivID).appendChild(divWeatherText);pWeatherText=document.createElement("p");pWeatherText.id="text_"+this.salt;divWeatherText.appendChild(pWeatherText);document.getElementById(this.DivID).appendChild(document.createTextNode(""));this.RefreshHour();this.RefreshAsync()}}}}else{var a="Unknown";var d=null;if(document.getElementById(this.DivID)){document.getElementById(this.DivID).className="Weather";if(d){divWeatherImg=document.createElement("div");divWeatherImg.id="img_"+this.salt;divWeatherImg.className="WeatherImage";if(this.isIE){d.onmouseover=function(){showTooltip(event,a);return false};d.onmouseout=function(){hideTooltip()}}else{d.onmouseover=function(j){showTooltip(j,a);return false};d.onmouseout=function(){hideTooltip()}}divWeatherImg.appendChild(d);document.getElementById(this.DivID).appendChild(divWeatherImg)}divWeatherText=document.createElement("div");divWeatherText.id="divtext_"+this.salt;divWeatherText.className="WeatherText";document.getElementById(this.DivID).appendChild(divWeatherText);pWeatherText=document.createElement("p");pWeatherText.id="text_"+this.salt;divWeatherText.appendChild(pWeatherText);document.getElementById(this.DivID).appendChild(document.createTextNode(""));this.RefreshHour();this.RefreshAsync()}}}else{var a="Unknown";var d=null;if(document.getElementById(this.DivID)){document.getElementById(this.DivID).className="Weather";if(d){divWeatherImg=document.createElement("div");divWeatherImg.id="img_"+this.salt;divWeatherImg.className="WeatherImage";if(this.isIE){d.onmouseover=function(){showTooltip(event,a);return false};d.onmouseout=function(){hideTooltip()}}else{d.onmouseover=function(j){showTooltip(j,a);return false};d.onmouseout=function(){hideTooltip()}}divWeatherImg.appendChild(d);document.getElementById(this.DivID).appendChild(divWeatherImg)}divWeatherText=document.createElement("div");divWeatherText.id="divtext_"+this.salt;divWeatherText.className="WeatherText";document.getElementById(this.DivID).appendChild(divWeatherText);pWeatherText=document.createElement("p");pWeatherText.id="text_"+this.salt;divWeatherText.appendChild(pWeatherText);document.getElementById(this.DivID).appendChild(document.createTextNode(""));this.RefreshHour();this.RefreshAsync()}}};weather.prototype.RefreshHour=function(){nowDate=new Date();var a="A Bruxelles, nous sommes le ";a+=nowDate.format("dddd d mmmm yyyy");document.getElementById("text_"+this.salt).innerHTML=a};RefreshAsyncFunction=function(a){try{a.RefreshHour()}catch(b){}};weather.prototype.RefreshAsync=function(){var a=this;try{timerWeather=setInterval(function(){RefreshAsyncFunction(a)},1000)}catch(b){}};