title: Why does this piece of javascript work on both Google Chrome and IE but not in Firefox?
body: <p>I'm quite new to javascript programming and got stuck in this problem: I have a div displaying a map made with flash. This flash features a magnifying glass icon, that when clicked, calls this javascript:</p>
  
  <pre><code>function turnMap() 
  {
      DivSwitcher(map.id);
      DivSwitcher(rightcolumn.id);
      DivSwitcher(leftcolumn.id);
  }
  
  function DivSwitcher(layer) 
  {
      if (document.getElementById(layer).style.display != "none")
          document.getElementById(layer).style.display = "none";
      else
          document.getElementById(layer).style.display = "block";
  }
  </code></pre>
  
  <p>All the called divs do exist, but the div with the map id is set with <code>display: none</code>. On both IE and Chrome, this code works just fine: the divs get hidden or displayed as I want, but on Firefox, it doesn't happen. I tried running with FireBug to see what happens:</p>
  
  <blockquote>
    <p>map is not defined</p>
  </blockquote>
  
  <p>If you guys could give me any leads I would appreciate it.</p>