function updateCuaca(xml) {

	element = xml.getElementsByTagName('channel')[0];
	// childNodes[13] = location
	city = element.childNodes[13].attributes[0].nodeValue;
	country = element.childNodes[13].attributes[2].nodeValue;
	element = xml.getElementsByTagName('item')[0];
	// childNodes[11] = <yweather:condition>
	conditionName = element.childNodes[11].attributes[0].nodeValue; 
	imageCode = element.childNodes[11].attributes[1].nodeValue;
	temperature = element.childNodes[11].attributes[2].nodeValue; 
	date = element.childNodes[11].attributes[3].nodeValue; 
	
	var img = 'url('+cuacaImgUrl+'/'+imageCode+'.png)';
	$('cuaca-container').style.backgroundImage = img;
	$('cuaca-container').style.backgroundRepeat = 'no-repeat';
	$('cuaca-container').style.backgroundPosition = 'top left';
	$('cuaca-temp').innerHTML = temperature + "&deg;C";
	$('cuaca-location').innerHTML = '<a href="#" onclick="axpCuaca_getCuaca(); return false;">' + city + '</a>';
	$('cuaca-weather').innerHTML = conditionName;
	$('cuaca-time').innerHTML = date;
}


axpCuaca_getCuaca = function() {
	var ajaxWeatherRequest = new Ajax.Request(cuacaAjaxUrl,
	{
		 method: 'get',
		 onComplete : function( req ) { 
			xml = req.responseXML; 		//alert('req.responseXML');
			text = req.responseText; 	//alert(req.responseText);
			updateCuaca(xml);
		 } 
	});
}