function Security() {}

Security.contextPath = "";

/**
 * Button text
 */
Security.btnCancel = "<<uninitialized>>";
Security.btnLogout = "<<uninitialized>>";

/**
* Displays a dialog with the given title and body before logging a user out.
* @param title the text that goes into the title bar of the dialog
* @param body the message to display
*/
Security.logout = function(title, body) {
    var buttons = [
        { text: Security.btnCancel, isDefault:true },
        { text: Security.btnLogout, handler: Security.doLogout }
   ];

   MessageBox.displayDialog(title, body, buttons);
};

/**
* Redirect to the Acegi logout.
*/
Security.doLogout = function() {
    window.location = Security.contextPath + '/j_spring_security_logout';
};
