// define our success function
var weatherHandleSuccess = function(o)
{
	if(o.responseText != undefined)
	{
		var jsonObject = eval("(" + o.responseText + ")");
		if(jsonObject.error == null)
		{
			var responseValue = jsonObject.value;
			// construct the same from the aspx page
			var div = document.getElementById('weatherSection');
			if(div != null)
			{
				div.innerHTML = responseValue.CurrentWeather;
			}
		}
	}
}

// define our failure function
var weatherHandleFailure = function(o)
{
	alert('ERROR: ' + o.responseText);
}

// define our callbacks
var weatherCallback = { success:weatherHandleSuccess, failure:weatherHandleFailure };

function weather(element, object)
{
	showProgressImage('weather');
	
	// kick off the request, specifying the url and the callback functions	
	YAHOO.util.Connect.asyncRequest('GET', '/Weather.ajax', weatherCallback);
}

