/* Expands the top banner into the third column when a wide banner ad is detected */
var SPBannerLayout = {
  init: function()
  {
    if (SPBannerLayout.isWideBanner(document.getElementById('blogads')) ||
        SPBannerLayout.isWideBanner(document.getElementById('articlebanner')))
      SPBannerLayout.fixLayout();
  },
  isWideBanner: function(div)
  {
    if (div) {
      var img = div.getElementsByTagName('img');
      var iframe = div.getElementsByTagName('iframe');
      if (iframe.length > 0)
      {
        return iframe[0].width >= 728;
      }
      else if (img.length > 0)
      {
        return img[0].width >= 728;
      }
      return false;
    }
  },
  fixLayout: function()
  {
    var contentDiv = document.getElementById('content');
    contentDiv.className += ' widebanner';
  }
};
// from utilities.js
addLoadEvent(SPBannerLayout.init);
