// define our success function
var timeHandleSuccess = 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('timePerth');
			if(div != null)
			{
				div.innerHTML = responseValue.PerthTime;
			}
			div = document.getElementById('timeBrisbane');
			if(div != null)
			{
				div.innerHTML = responseValue.BrisbaneTime;
			}
			div = document.getElementById('timeSydney');
			if(div != null)
			{
				div.innerHTML = responseValue.SydneyTime;
			}
			div = document.getElementById('timeAdelaide');
			if(div != null)
			{
				div.innerHTML = responseValue.AdelaideTime;
			}
		}
	}
}

// define our failure function
var timeHandleFailure = function(o)
{
	alert('ERROR: ' + o.responseText);
}

// define our callbacks
var timeCallback = { success:timeHandleSuccess, failure:timeHandleFailure };

function time(element, object)
{

//	showProgressImage('carsList');
	
	// kick off the request, specifying the url and the callback functions	
	YAHOO.util.Connect.asyncRequest('GET', '/Time.ajax', timeCallback);
}

