title: cannot read property style, error on different page
body: <p>once again im not sure where to go with this...i know its very basic but im having a hard time spotting it. im trying to hide several ids, and it works, except it gives me an error... :
  Uncaught TypeError: Cannot read property 'style' of null , this only appears on pages where the function isnt on.. </p>
  
  <pre><code>function new1()
  { var news = ["1","2","3","4"];
      for (var i = 0; i&lt;news.length; i++) 
      {
  var s =document.getElementById("news"+news[i]).style.display = "none";
       }
  }
  </code></pre>
  
  <p>thanks in advance, i can supply the xhtml if needed, its just several divs named news1,new2, my main concern is that the error is preventing some other scripts from working.
  thanks in advance =]</p>
  
  <pre><code>&lt;a  onclick="show1()" href="#"&gt;&lt;h3&gt;Spice Girls premiere new song&lt;/h3&gt;&lt;/a&gt;&lt;div id="news1"&gt;
              &lt;p class="news" &gt; &lt;em&gt;Headlines (Friendship Never Ends)&lt;/em&gt; is the first new single from the reformed girl band since 2000 and is the official Children In Need track for 2007.&lt;/p&gt;
  
              &lt;p class="news"&gt;Geri Halliwell, Victoria Beckham, Melanie Brown, Melanie Chisholm and Emma Bunton have regrouped to promote a new Spice Girls' greatest hits album and an upcoming world tour.  &lt;a href="#"&gt;more ...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;div id="story2"&gt;
              &lt;a  onclick="show2()"  href="#"&gt;&lt;h3&gt;Jay-Z defends Nas album title&lt;/h3&gt;&lt;/a&gt;&lt;div id="news2"&gt;
              &lt;p class="news"&gt;Hip-hop mogul Jay-Z has defended Nas' decision to name his new album &lt;span&gt;N**ger&lt;/span&gt;, but insists the naming of the record is "misguided".&lt;/p&gt;
  
              &lt;p class="news"&gt;Jay-Z - real name Shawn Carter - is releasing the LP under his label Island Def Jam Music Group, but admits he is not fond of its title.  &lt;a href="#"&gt;more ...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="story3"&gt;
              &lt;a  onclick="show3()" href="#"&gt;&lt;h3&gt;Winehouse defends MTV EMAs performance&lt;/h3&gt;&lt;/a&gt;&lt;div id="new3"&gt;
              &lt;p class="news" id="news3"&gt;Amy Winehouse has defended her performance at Thursday's MTV European Music Awards - citing exhaustion for her bizarre behaviour. &lt;a href="#"&gt;more ...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
  </code></pre>