function CCW() {
  this.render = function () {
    var output = '';

    // link color from article page
    var lcContainer = document.getElementById('news_content');
    if (lcContainer) {
      var lcDivs = lcContainer.getElementsByTagName('div');
      for (var i in lcDivs) {
        var lcClass = lcDivs[i].className;
        if (typeof lcClass == 'string') {
          if (lcDivs[i].className.indexOf('read_more with_verticals') != -1) {
            var lcElement = lcDivs[i].firstChild.nextSibling.nextSibling.nextSibling;
            if (lcElement.nextSibling.currentStyle) {
              var lcColor = lcElement.nextSibling.currentStyle['color'].replace('#', '%23');
            }
            else if (window.getComputedStyle) {
              var lcColor = document.defaultView.getComputedStyle(lcElement ,null).getPropertyValue('color');
            }
            break;
          }
        }
      }
    }

    // widget container and content
    var iframe_url = 'http://ec2-67-202-7-75.compute-1.amazonaws.com/widget_iframe/detroit?3';
    if (iframe_url && lcColor) {
      iframe_url += '?linkcolor=' + lcColor;
    }
    output += "<iframe src='" + iframe_url + "' width=585 height=286 style='display:block;' frameborder=0 scrolling='no'></iframe>";

    //Google Analytics
    output += '<script type="text/javascript"> _uff = 0; _uacct = "UA-5593567-2"; _uccn="HPVerticals"; _ucmd="HPFront"; _uctr="Home"; _ucct="1.0"; urchinTracker(); </script>';

    // close container and append widget to page
    document.write(output);
  }
}

var ccw = new CCW();
ccw.render();
