32 lines
902 B
JavaScript
32 lines
902 B
JavaScript
// This script is designed to support at a minimum IE 6
|
|
//
|
|
// All menu functions are defined outside of initMenu.
|
|
//
|
|
// This is so I'm not duplicating functions between-
|
|
// checks for what browser we have
|
|
|
|
function doLogoutAction() {
|
|
var logoutForm = document.getElementById("Form_Auth_Logout");
|
|
logoutForm.submit();
|
|
}
|
|
|
|
// Once the page has fully loaded, connect each button to its code
|
|
function initMenu() {
|
|
var logoutButton = document.getElementById("Menu_Auth_Logout");
|
|
|
|
if(window.addEventListener) {
|
|
logoutButton.addEventListener("click", doLogoutAction);
|
|
} else {
|
|
logoutButton.attachEvent('onclick', doLogoutAction);
|
|
}
|
|
}
|
|
|
|
// Register load / onload event
|
|
if(window.addEventListener) {
|
|
window.addEventListener('load', initMenu);
|
|
} else if(window.attachEvent) {
|
|
window.attachEvent('onload', initMenu);
|
|
} else {
|
|
alert("Unsupported browser.");
|
|
}
|