/**
 * Functions to adjust the page when the user logs out
 **/

/**
 * Log the member out from a member only area
 *
 * @param string location - the current location
 */
function logOutOfMemberArea(location) {
	window.id_registrant = '';
	new Ajax.Request("./php/ajax/logout.php", {
		asynchronous: false,
		onSuccess: function() {
			document.location.href="index.php?cont=startseite&location=" + location;
		}
	});
}

/**
 * Log the member out from a page accessible to everybody.
 * calls logoutFunction() if the current page has one.
 *
 * @param string location - the current location
 */
function logOutOfUnprotectedArea(location) {
	$('loginLinkHead').style.display = 'inline';
	$('loggedInUserLinks').style.display = 'none';
	window.id_registrant = '';
	new Ajax.Request("./php/ajax/logout.php", {
		asynchronous: false,
		onSuccess: function(){
			if (typeof logoutFunction != 'undefined') {
				logoutFunction(location);
			}
		}
	});
}
