getElementById() breaking loop
<p>I Have a problem... Here's the deal. I have a lot of elements and a button to hide them all, looks like</p>

<p>Category1 (for example id="1")<br>
&nbsp;&nbsp;- line1 (for example thats div, id="1-1" class="<b>blue</b>")<br>
&nbsp;&nbsp;- line2 (for example thats div, id="1-2" class="<b>blue</b>")<br>
&nbsp;&nbsp;- line3 (for example thats div, id="1-3" class="red")<br>
&nbsp;&nbsp;- line4 (for example thats div, id="1-4" class="green")<br></p>

<p>Etc. Lines have different classes, and that's a long story. Thing is I need to hide "Category1" caption (div) if there is no visible elements. And that's ok.
But Also i need to show it when any line of that category appears again...</p>

<p>So i have this <br>
( idl = line class (associative massive, contains blue,red,green,etc), by custom function getElementsByClassName()... And this is "show line" function</p>

<pre><code>   for (i=0;i&lt;idl.length;i++) 
   {
   idl[i].style.display = "block";
   cla = idl[i].id; 
   if (cla[1]='-') {cla = cla[0];}
   else {cla = cla[0] + cla[1];}     //weird way to get Category id but works
                                     //just cut off "-1" "-2" part of line IDs
                                     // loop is doing it's job.

   /* if ( getElementById(cla) || getElementById(cla).style.display!="block" ) {
      getElementById(cla).style.display = "block";
      } 
   */

    // now here if I use 3 lines above it stops. 1st loop and that's it.
    // even after getElementById("12345"), after getElementById(everything here)
    // and nothing happening if i put alert anything after
</code></pre>

<p>Any suggestions? </p>
