/*
 * KIMONO 1.0.0 - New Javascript
 *
 * Copyright (c) 2008 Rolando Romero (kimono.com.ar)
 * GPL LICENSE
 *
 * $Date: 2009-07-22 00:00:00 -0200
 *
 */

weather = function(param)
{
	$.ajax({
		type: "GET", 
		url: "proxy.php?service=weather&weather=" + param, 
		cache: false, 
		dataType: "xml", 
		success: function(xml) {
			$(xml).find('temp_c').each(function(){
				$("#weather_label1").html("Temperatura:");
				$("#weather_temp").html($(this).attr('data'));
				$("#weather_label2").html("&deg;");
			});
			$(xml).find('humidity').each(function(){
				$("#weather_label3").html("Humedad:");
				$("#weather_humi").html($(this).attr('data'));
			});
			img = $(xml).find('current_conditions > icon').attr('data');
			if (img!="") 
			{
				img = "<img src=\"template/puroshow_2009/images"+img+"\">";
			}
			else
			{
				img = "|";
			}
			$("#weather_icon").html(img);
		},
		beforeSend: function() {

		}
	});
}

$(document).ready(function() {
	weather("Buenos Aires, Argentina");
});