I have been advised against using global variables.
One of them is used to toggle client-side validation on and off.
The other two are used to control my drop-down menu.
If these shouldn't be global variables, where should I store them?
/* Global */
var enableValidation = 1, // used to toggle client-side validation
menuTimer = 0,
menuElement = 0;
window.onload = initialize;
/*menu*/
function topMouseOver(id)
{
resetMenu();
if (menuElement) menuElement.style.visibility = 'hidden';
menuElement = document.getElementById(id);
menuElement.style.visibility = 'visible';
}
function internalTime()
{
if (menuElement) menuElement.style.visibility = 'hidden';
}
function mouseOut()
{
menuTimer = window.setTimeout(internalTime, 500);
}
function resetMenu()
{
if (menuTimer)
{
window.clearTimeout(menuTimer);
menuTimer = 0;
}
}
Header 1 // This makes more sense
Content
Header 1 // Than this
Content