/**
 * Get Weather Information
 *
 * @author: Rilwis
 * @url: http://hontap.blogspot.com
 * @email: rilwis@gmail.com
 * @license: MIT License
 */

function showWeatherCallback(d){
	var c=d.query.results.weather.rss.channel,
		a=c.item.description.match(/http:\/\/[^"']*/);
		k=c.item.condition.temp;
		if (k<25) { 
				m="/images/20.gif";
		} else if(k>=25 && k<28){
				m="/images/28.gif";
		}else  {
				m="/images/30.gif";
		}
		b='<img style="vertical-align:bottom" height="50" width="50" src="'+m+'" /><br /> <span style="font-size:14px">'+k+"&deg;C</span><br/>";
		document.write(b)
	}
function showWeather(a){
	var c="//query.yahooapis.com/v1/public/yql?q=",
	d='use "http://github.com/yql/yql-tables/raw/master/weather/weather.bylocation.xml" as we;select * from we where location="'+a+'" and unit="c"',
	b=c+encodeURIComponent(d)+"&format=json&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=showWeatherCallback";
	document.write('<script type="text/javascript" src="'+b+'"><\/script>')
	};
