function logout()
{
	var myMask = new Ext.LoadMask(Ext.getBody(), {msg: GetTextInLanguage('LOGIN_FORM_MESSAGE_PLEASE_WAIT', selectedLanguage)}); 
	myMask.show();																	
	var req = Ext.Ajax.request({
		url : 'data/login.php' , 
		params : { action : 'logout' },
		method: 'POST',
		success: function ( result, request ) { 
			myMask.hide();
			try
			{
				var jsonData = Ext.util.JSON.decode(result.responseText);
				if (jsonData['status'] == 'ok')
					document.location = 'index.php';
				else
					Ext.MessageBox.alert(GetTextInLanguage('FAILED_MESSAGE', selectedLanguage), jsonData['message']); 
			}
			catch (err)
			{
				myMask.hide();
				Ext.MessageBox.alert(GetTextInLanguage('FAILED_MESSAGE', selectedLanguage), result.responseText); // XXX
			}	
		},
		failure: function ( result, request) { 
			myMask.hide();
			Ext.MessageBox.alert(GetTextInLanguage('FAILED_MESSAGE', selectedLanguage), GetTextInLanguage('INTERNAL_ERROR', selectedLanguage)); 
		} 
	});	
}
