title: JavaScript error "Function is expected"
body: <p>I have several listeners like this, which listen to click and then displays content within <code>&lt;div id="c50"&gt;&lt;a hre...&gt;CONTENT&lt;/a&gt;&lt;/div&gt;</code> (in this case). Everything works in Opera, Chrome and FF, but not in IE.</p>
  
  <pre><code>google.maps.event.addListener(pano50, 'click', function() {    
  fireEvent(document.getElementById("c50").getElementsByTagName("a")[0], 'click');
  })
  </code></pre>
  
  <p>Chrome javascript console tool displays this error after click (but works fine):</p>
  
  <pre><code>Uncaught TypeError: object is not a function
  </code></pre>
  
  <p>but traditionally, IE8 displays:</p>
  
  <pre><code>Function expected on line 817
  </code></pre>
  
  <p>which is the first line of code above and do nothing after click. Thank you for any advice!</p>
  
  <p>EDIT: here is the fireEvent function:</p>
  
  <pre><code>function fireEvent(element, event) {
      if (document.createEventObject){
          /* for IE */
          return element.fireEvent('on' + event, document.createEventObject());
      }else{
          /* for other browsers */
          var evt = document.createEvent('HTMLEvents');
          evt.initEvent(event, true, true);
      }
      return !element.dispatchEvent(evt);
  }
  </code></pre>