function getWeather(location){			
	var url = '/xml.php';
	
	var req = new Ajax.Request(url,{
		method: 'get',
		parameters: 'location=' + location,
		onSuccess: showResponse,
		onFailure: function(){alert('Failed')}
	});					
}

function showResponse(originalRequest){
	$('loading').style.display = 'none';
	var xml = originalRequest.responseXML;
	var currentConditions = xml.getElementsByTagName('cc');
	var cc = currentConditions[0];
	
	var loc = xml.getElementsByTagName('dnam');
	$('location').innerHTML = loc[0].firstChild.nodeValue;
	
	var high = cc.getElementsByTagName('tmp');
	$('high').innerHTML = high[0].firstChild.nodeValue;
	new Insertion.Bottom('high','&#176;');
	new Insertion.Top('high','Current Temp ');
	
	/*var low = xml.getElementsByTagName('low');
	$('low').innerHTML = low[0].firstChild.nodeValue;*/
	
	var t = cc.getElementsByTagName('t');
	$('type').innerHTML = t[0].firstChild.nodeValue;
	
	var icon = cc.getElementsByTagName('icon');
	var img = document.createElement('img');
	img.src = 'images/icons/' + icon[0].firstChild.nodeValue + '.jpg';
	new Insertion.Top('icon', '<' + img.tagName + ' src="' + img.src + '" />');
	$('icon').style.display = 'block';
}	
