var error = false;
function startLoading() {
	error=false;
	Element.hide('ajaxcontainer');
	Element.show('loading');
}

function endLoading() {
	Element.hide('loading');
	if(!error) Element.show('ajaxcontainer');
}

function failure() {
	alert('an error occured - please try again or contact support');
	error=true;
}