function iframeMessageHandler(e) {
  var iframes = document.getElementsByTagName('IFRAME');
  for (var i = 0, iframe; iframe = iframes[i]; i++) {
    if (iframe.contentWindow == e.source) {
      var msg = JSON.parse(e.data);
      if (msg) {
        if (msg.type == 'size') {
          iframe.style.height = msg.size + 'px';
        } else if (msg.type == 'show') {
          var url = msg.url;
          if (url.indexOf('http://news.google.com') == 0) {
            // If the URL is a redirect URL, strip of the destination and go to
            // that directly.  This is necessary because the Google news
            // redirector blocks use of the redirects in this case.
            var index = url.indexOf('&url=');
            if (index >= 0) {
              url = url.substring(index + 5);
              index = url.indexOf('&');
              if (index >= 0)
                url = url.substring(0, index);
            }
          }
          showUrl(url);
        }
      }
      return;
    }
  }
}
Handles messages between different iframes and sets the display of iframe.
@param {Object} e Onmessage event.