<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title=" FOX News" 
title_url="http://moroccosearch.eu" 
description="Breaking News, Latest News and Current News from FOXNews.com. Breaking news and video. Latest Current News: U.S., World, Entertainment, Health, Business, Technology, Politics, Sports. " 
author=" FOXNews" 
author_email="signdrive@gmail.com" 
height="250" 
width="470" 
thumbnail="http://moroccosearch.eu/gadget/game-api/Fox-news.png" 
screenshot="http://moroccosearch.eu/gadget/game-api/Fox-news.png" 
category="news" 
category2="lifestyle" 
scaling="false" >

  <Require feature="dynamic-height"/>
  <Require feature="setprefs"/>
  <Require feature="tabs"/>
  <Require feature="analytics"/>
</ModulePrefs>
<UserPref name="entries" display_name="# of Entries:" datatype="enum" default_value="4">
  <EnumValue value="3"/>
  <EnumValue value="4"/>
  <EnumValue value="5"/>
  <EnumValue value="6"/>
  <EnumValue value="7"/>
  <EnumValue value="8"/>
  <EnumValue value="9"/>
  <EnumValue value="10"/>
  <EnumValue value="11"/>
  <EnumValue value="12"/>
  <EnumValue value="13"/>
  <EnumValue value="14"/>
  <EnumValue value="15"/>
</UserPref>
<UserPref name="summaries" display_name="Summary Length" datatype="enum" default_value="100">
  <EnumValue value="0" display_value="None"/>
  <EnumValue value="100" display_value="Short"/>
  <EnumValue value="300" display_value="Long"/>
</UserPref>
<UserPref name="extrafeed" display_name="Option Category:" datatype="enum" default_value="http://feeds.foxnews.com/foxnews/opinion">
  <EnumValue value="http://feeds.foxnews.com/foxnews/opinion" display_value="Opinion"/>
  <EnumValue value="http://feeds.foxnews.com/foxnews/internal/travel/mixed" display_value="Travel"/>
  <EnumValue value="http://feeds.foxnews.com/foxnews/section/lifestyle" display_value="Lifestyle"/>
  <EnumValue value="http://feeds.foxnews.com/foxnews/health" display_value="health"/>
   <EnumValue value="http://feeds.foxnews.com/foxnews/entertainment" display_value="Entertainment"/>

</UserPref>
<UserPref name="extratitle" display_name="Option Title:" default_value="Opinion"/>
<UserPref name="subject" display_name="Gadget Title:" default_value="Fox News"/>
<UserPref name="selectedTab" datatype="hidden"/>
<Content type="html"><![CDATA[

  <style type="text/css">
  @import url(http://www.google.com/ig/tablib.css);
  .tablib_table__MODULE_ID__ { font-size: 11px; }

  .statusLabel {
    font-size:11px;
    font-style:italic;
    padding-top:10px;
    text-align:center;
  }
  .feedHeader {
    padding-top:5px;
    font-size:13px;
  }
  .feedList {
    font-size:13px;
    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:12px;
  }
  .feedlist div.entryTimestamp {
    font-size:10px;
    font-style:italic;
    color:#676767;
  }
  </style>

  <script>
  // Global variables
  var prefs = new _IG_Prefs(__MODULE_ID__);
  var tabs = new _IG_Tabs(__MODULE_ID__);

  /**
   * Initialize tabs when page loads.
   * Create tab for each userpref only if userpref is not empty.
   */
  function init() {
    var f1 = "http://feeds.foxnews.com/foxnews/latest";
    var f2 = "http://feeds.foxnews.com/foxnews/nationa";
    var f3 = "http://feeds.foxnews.com/foxnews/politics";
    var f4 = "http://feeds.foxnews.com/foxnews/world";
    var f5 = "http://feeds.foxnews.com/foxnews/scitech";
    var f6 = "http://feeds.foxnews.com/foxnews/sports";
    var f7 = _trim(prefs.getString("extrafeed"));

    if (f1 != "") {
      tabs.addDynamicTab(_trim("Headlines"), callbackGenerator(f1));
    }
    if (f2 != "") {
      tabs.addDynamicTab(_trim("U.S"), callbackGenerator(f2));
    }
    if (f3 != "") {
      tabs.addDynamicTab(_trim("Politics"), callbackGenerator(f3));
    }
    if (f4 != "") {
      tabs.addDynamicTab(_trim("World"), callbackGenerator(f4));
    }
    if (f5 != "") {
      tabs.addDynamicTab(_trim("Scitech"), callbackGenerator(f5));
    }
    if (f6 != "") {
      tabs.addDynamicTab(_trim("Sports"), callbackGenerator(f6));
    }
    if (f7 != "") {
      tabs.addDynamicTab(_trim(prefs.getString("extratitle")), callbackGenerator(f7));
    }
  };

  /**
   * Creates a function that calls the tab's callback function
   * and passes along an additional variable from the calling environment.
   */
  function callbackGenerator(feedUrl) {
    return function(tabId) {
      callbackTab(tabId, feedUrl);
    }
  }

  /**
   * Fetches an Atom or RSS feed and generates content inside the
   * selected tab's content container.  This function is called whenever
   * a tab is selected.
   */
  function callbackTab(tabId, feedUrl) {
    var summaries = prefs.getInt("summaries");
    var entries = prefs.getInt("entries");
    var container = _gel(tabId);

    // Display loading message before fetching feed.
    container.innerHTML = '<div class="statusLabel">Loading...</div>';

    // Fetch feed and return it as a JSON object.
    // Callback function is defined within local scope.
    _IG_FetchFeedAsJSON(
      feedUrl,
      function(feed) {
        if (typeof feed == "undefined" || typeof feed.Entry == "undefined") {
          container.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(_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];

            var summ=entry.Summary;
            var summary=summ.replace(/<V?[^>]+>/gi,"");

            html.push('<li>');
            html.push('<a target="_top" title="' + _hesc(summary) + '" href="' + entry.Link + '">' + _hesc(entry.Title) + '</a>');
            if (typeof entry.Summary != "undefined" && entry.Summary != "" && summaries > 0) {
              if (entry.Summary.length > summaries) {
                html.push('<div class="entrySummary">' + _hesc(summary.substr(0, summaries)) + ' ...</div>');
              } else {
                html.push('<div class="entrySummary">' + _hesc(summary) + '</div>');
              }
            }
            if (!isNaN(entry.Date)) {
              html.push('<div class="entryTimestamp">' + new Date(entry.Date * 1000).toLocaleString() + '</div>');
            }
            html.push('</li>');
          }
          html.push('</ul>');
          container.innerHTML = html.join("");
        }

        // Resize iframe height to fit content.
        _IG_AdjustIFrameHeight();
      },
      entries,
      1
    );
  }

  // Set onload event handler to call init()
  _IG_RegisterOnloadHandler(init);
  _IG_Analytics("UA-916962-3", "/widgets-rss");
  </script>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-3105448404649756";
/* WJS */
google_ad_slot = "5125433776";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

]]>
</Content>
</Module>














