title: toggle div visibility with a checkbox list
body: <p>I have a web application(ASP.NET2.0 C#).
  Within it, I have a div that contains a checkbox list and a button.</p>
  
  <p>I want to toggle the div viewing, so I got some javascript code online to help me.</p>
  
  <p>Heres the code:</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  var state = 'hidden';
  
  function showhide(layer_ref) {
  
      if (state == 'visible') 
      {
          state = 'hidden';
      }
      else 
      {
          state = 'visible';
      }
      if (document.all) 
      { //IS IE 4 or 5 (or 6 beta)
          eval( "document.all." + layer_ref + ".style.visibility = state");
      }
      if (document.layers) 
      { //IS NETSCAPE 4 or below
          document.layers[layer_ref].visibility = state;
      }
      if (document.getElementById &amp;&amp; !document.all) 
      {
          maxwell_smart = document.getElementById(layer_ref);
          maxwell_smart.style.visibility = state;
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I call the function this way:</p>
  
  <pre><code>&lt;a href="javascript://" onclick="showhide('AlertDiv');"&gt;Choose Columns&lt;/a&gt;
  </code></pre>
  
  <p>When I use this function, it shows me the div with the button, but it doesn't show me the checkboxlist....Any ideas on what's going on?</p>
  
  <p>Thank you.</p>