$.post('http://' + serverName + '/ajax.php',
	{
		'function' : 'getSessionVariable',
		'key' : 'loginAccepted'
	},

	function(xml) {
		var statusNode = $('FunctionStatus', xml).get(0);
		var success = intToBool(statusNode.getAttribute('success'));
		if(success === true) {
			statusNode = $('SessionVariable', xml).get(0);
			success = intToBool(statusNode.getAttribute('success'));
		}

		var variable = 0;
		if(success === true) {
			variable = stripslashes(statusNode.getAttribute('value'));
		}
			
		if(variable == 1) {
			alert('You are logged in now. You can add yourself to races on the USCF ' +
					'events calendar. See the \'Calendar\' page.');
		}
				
		$.post('http://' + serverName + '/ajax.php',
			{
				'function' : 'setSessionVariable',
				'key' : 'loginAccepted',
				'value' : '0'
			},
			
			function(xml) {
				// Do nothing; assume that the variable has been set
			}
		);
	}
);

