<?xml version="1.0" encoding="UTF-8"?>
<Module>
  <ModulePrefs title="Special Deals from Other World Computing" description="Mac Upgrades and Accesories Since 1988" render_inline="optional" category="technology" screenshot="http://eshop.macsales.com/gadgets/owc_specials.jpg" thumbnail="http://eshop.macsales.com/gadgets/owc_thumbnail.gif" title_url="http://www.macsales.com" author="Dan Phillips" author_email="danp@macsales.com" author_location="Woodstock, Illinois" scrolling="true" height="300" width="300">
    <Locale lang="en" country="us"/>
    <Locale lang="en" country="gb"/>
  </ModulePrefs>
  <UserPref name="summaries" display_name="Summaries" datatype="enum" default_value="100">
    <EnumValue value="0" display_value="None"/> 
    <EnumValue value="100" display_value="Short"/> 
    <EnumValue value="300" display_value="Long"/> 
  </UserPref>
  <Content type="html">
<![CDATA[

  <style type="text/css">
  /* Import tabs library style sheet */
  .statusLabel {
    font-size:12px;
    font-style:italic;
    padding-top:10px;
    text-align:center;
  }
  .feedHeader {
    padding-top:5px;
    font-size:12px;
  }
  .feedList {
    font-size:12px;
    margin:5px 0px 0px 0px;
    padding:0px 3px 5px 3px;
    border-top: 1px solid #aaaaaa;
    border-bottom: 1px solid #aaaaaa;
  }
  .feedList li {
    margin-top:5px;
    padding:0px;
  }
  .feedList div.entrySummary {
    font-size:11px;
  }
  .feedlist div.entryTimestamp {
    font-size:10px;
    font-style:italic;
    color:#676767;
  }
    
  .feedlist a, .feedlist a:hover, .feedlist a:visited {
    color: 7242B2;
  }
    
  p#footer {
    font-size:12px;
  }
  </style>
    
  <div id="content___MODULE_ID__"></div>
  <script>
var url = 'http://feeds.feedburner.com/OWC-Specials';
var prefs = new _IG_Prefs(__MODULE_ID__);
var summaries = prefs.getInt("summaries");
// var entries = prefs.getInt("entries");
var entries = 10;

_IG_FetchFeedAsJSON(url, function(feed) {
  if (typeof feed == "undefined" || typeof feed.Entry == "undefined") {
    _gel('content___MODULE_ID__').innerHTML = '<div class="statusLabel">Invalid feed URL:<br>' + feedUrl + '</div>';
  } else { // Fetch feed successful.  Generate HTML content from returned JSON object.
    var html = new Array();

    // Create feed header containing title and description.
    html.push('<div class="feedHeader">');
//    html.push('<b>' + _hesc(feed.Title) + '</b><br>');
    html.push('<a href="http://eshop.macsales.com/" target="_blank"><img src="http://eshop.macsales.com/gadgets/gadget_title.gif" width="200" height="19" alt="thelondonpaper.com blog" border="0" /></a><br />');

        html.push(_hesc(feed.Description));
    html.push('</div>');

    // Iterate through each feed entry and generate list of content.
    html.push('<ul class="feedList">');
    for (var n = 0; n < feed.Entry.length; n++) {
      var entry = feed.Entry[n];
      html.push('<li>');
      html.push('<a target="_blank" href="' + entry.Link + '">' + _hesc(entry.Title) + '</a>');
      if (typeof entry.Summary != "undefined" && entry.Summary != "") {
        html.push('<div class="entrySummary">' + _hesc(entry.Summary.substr(0, summaries)) + ' ...</div>');
      }
      html.push('</li>');
    }
    html.push('</ul>');
    html.push('<p id="footer"><a href="http://eshop.macsales.com/shop/specials/" target="_blank">Find More OWC Special Deals Here!</a></p>');
    _gel('content___MODULE_ID__').innerHTML = html.join("");
  }

  // Resize iframe height to fit content.
  _IG_AdjustIFrameHeight();
}, entries, (summaries > 0));     
  </script>
]]>
</Content>
</Module>