How to avoid global variables?
<p>I've been told not to use global variables.</p>

<p>I use one to turn off/on client side validation.</p>

<p>I use two more to conrol me drop-down menu.</p>

<p>If these should not be gloval variables where should I put them?</p>

<p>/*
Global
*/</p>

<pre><code>var client_validation=1,  // used to turn off/on client-side validation
    menu_timer=0,
    menu_elment=0;
window.onload=i0;

/*menu*/

function top_mouse_over(id)
  {
  bottom_mouse_over();
  if(menu_element)menu_element.style.visibility='hidden';
  menu_element=document.getElementById(id);
  menu_element.style.visibility='visible';
  }
function internal_time()
  {
  if(menu_element)menu_element.style.visibility='hidden';
  }
function mouse_out()
  {
  menu_timer=window.setTimeout(internal_time, 500);
  }
function bottom_mouse_over()
  {
  if(menu_timer)
    {
    window.clearTimeout(menu_timer);
    menu_timer=0;
    }
  }



Header 1  // This makes more sense
  Content

Header 1  // Than this
Content
</code></pre>
