// ------------- // Global Events // ------------- if ( typeof hideAllMenus != 'undefined' ) { document.onclick = hideAllMenus; } // ------------------------- // Global Pointers/Variables // ------------------------- var oLoginForm = null; var oMyAccountWindow = null; var oHelpWindow = null; var sVisibleTableStyle = ( is_ie ) ? 'block' : 'table'; // ---------------------- // Initialisation Methods // ---------------------- function init() { // Hide the loading message var oLoadingDiv = document.getElementById( 'div_loading' ); if ( oLoadingDiv != null ) { oLoadingDiv.style.display = 'none'; } // Get the login form pointer oLoginForm = document.forms[ 'login' ]; if ( oLoginForm != null ) { oLoginForm.j_username.focus(); } // If there is a pageInit() function defined, call it if ( typeof pageInit != 'undefined' ) { pageInit(); } // If there is a menuInit() function defined, call it if ( typeof menuInit != 'undefined' ) { menuInit(); } } // ----------------- // Utility Functions // ----------------- function returnFalse() { return false; } function getLeft( oSource ) { var iReturnCoord = 0; while ( oSource != null ) { iReturnCoord += oSource.offsetLeft; oSource = oSource.offsetParent; } return iReturnCoord; } function getTop( oSource ) { var iReturnCoord = 0; while ( oSource != null ) { iReturnCoord += oSource.offsetTop; oSource = oSource.offsetParent; } return iReturnCoord; } function debug( sMessage ) { var oToday = new Date(); var sTimestamp = oToday.getHours() + ':' + oToday.getMinutes() + ':' + oToday.getSeconds(); // Get the textarea, or create if it doesn't exist var oDebugTextarea = document.getElementById( 'textarea_debug' ); if ( oDebugTextarea == null ) { // Make the textarea var oNewTextarea = document.createElement( 'TEXTAREA' ); oNewTextarea.id = 'textarea_debug'; // Add the textarea to the page and setup the pointer document.body.appendChild( oNewTextarea ); oDebugTextarea = document.getElementById( 'textarea_debug' ); } // Style the textarea with ( oDebugTextarea.style ) { display = 'block'; width = '175px'; height = '454px'; position = 'absolute'; left = '785px'; fontFamily = 'arial'; fontSize = '11px'; top = '71px'; } // Add the text and scroll to the bottom oDebugTextarea.value = sTimestamp + ' > ' + sMessage + '\n' + oDebugTextarea.value; } function debugProps( object ) { for ( prop in object ) debug( 'object.' + prop + ' = \'' + eval('object.'+prop) + '\'' ); }