<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs
title="Newest Printable Grocery Coupons by CouponSurfer"
category="lifestyle"
directory_title="Print Free Grocery Coupons"
description="Print CouponSurfer Grocery Coupons from your Computer. Get Big Coupon Savings."
author="CouponSurfer"
author_email="support@couponsurfer.com"
author_affiliation="CouponSurfer.com"
author_location="Bedford, MA, USA"
screenshot="http://www.couponsurfer.com/images/grocery_gadget_thumb2.png"
thumbnail="http://www.couponsurfer.com/images/cs_gadget_thumb2.png"
height="250"
width="300"
author_photo="http://www.couponsolutions.com/Images/logo120x60.gif"
author_aboutme="CouponSurfer.com - Save money on your favorite products and services with free coupons including baby, clothing, electronics, food, grocery, health, music, pets, shopping, toys, auto, travel and more."
author_link="http://www.couponsurfer.com"
author_quote="Print CouponSurfer Grocery Coupons from your Computer. Save on all your favorite brands."
title_url="http://www.couponsurfer.com/rss4.xml"

scrolling="true" singleton="false">
<Require feature="dynamic-height" />
<Require feature="setprefs" />
<Require feature="tabs" />
<Require feature="analytics" />
</ModulePrefs>

<UserPref name="feed1" display_name="Coupon Type" datatype="enum"
default_value="http://www.couponsurfer.com/rss4.xml">
<EnumValue value="http://www.couponsurfer.com/rss4.xml" display_value="Grocery" />
<EnumValue value="http://www.couponsurfer.com/rss2.xml" display_value="All Coupons" />
</UserPref>
<UserPref name="feedTitle1" display_name="Tab Titles"
datatype="string" default_value="Newest Coupons" />
<UserPref name="entries" display_name="# of Coupons" datatype="enum"
default_value="3">
<EnumValue value="3" />
<EnumValue value="10" />
<EnumValue value="25" />
<EnumValue value="50" />
<EnumValue value="100" />
</UserPref>
<UserPref name="summaries" display_name="Coupon Display Settings" datatype="enum"
default_value="300">
<EnumValue value="-1" display_value="Brand Name Only" />
<EnumValue value="100" display_value="Full Coupon" />
<EnumValue value="300" display_value="Full Coupon w/Image" />
</UserPref>
<UserPref name="renderHtml" display_name="Render HTML"
datatype="bool" default_value="true" />
<UserPref name="showTimestamp" display_name="Show Timestamp"
datatype="bool" default_value="false" />
<UserPref name="selectedTab" datatype="hidden" />


<Content type="html">
<![CDATA[
<style type="text/css">
.tablib_table { font-size: __UP_tabFontSize__; }
.tablib_selected, .tablib_unselected { width: 23%; }
.statusLabel { font-size: 0.75em; font-style: italic; padding-top: 10px; text-align: center; }
.feedHeader { padding-top: 5px; font-size: 0.7em; }
.feedHeader .feedTitle { font-weight: bold; font-size: 1.1em; }
.feedHeader .feedAuthor { font-weight: normal; font-size: 0.8em; color: #676767; }
.feedList { font-size: 0.7em; margin: 0px; padding: 0px 0px 5px 0px; border-bottom: 1px solid #aaaaaa; }
.feedList li { margin-top: 5px; padding: 3px 3px 0px 3px; border-top: 1px solid #aaaaaa; }
.feedList li div.entryTitle a { font-weight: bold; }
.feedList li div.entryTimestamp { font-size: 0.95em; font-style: italic; color: #676767; }
.fnt {font-size:12px;font-family:arial;} .fnt2 {font-size:8px;font-family:arial;}
.sbutton{font-size:10px;border: 1px solid #006;background: #ADD8E6;}
.sinput {font-size:10px;border: 1px solid #006;background: #FAFAD2;}
label { position:relative; text-align:right; }
hr {border: 0;color: #9E9E9E;background-color: #9E9E9E;}
</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.
*/
   
var f1 = _trim(prefs.getString("feed1"));
var ft1 = _trim(prefs.getString("feedTitle1"));

if (f1 != "") {
tabs.addDynamicTab(((ft1 == "") ? "Feed 1" : ft1), _IG_Callback(callbackTab, f1));
}

function init() {
tabs.addTab("Search", "one_id");

tabs.addTab("Deal of the Day", "two_id"); 


};


/**
* 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 showFeedDesc = prefs.getBool("showFeedDesc");
var summaries = prefs.getInt("summaries");
var entries = prefs.getInt("entries");
var renderHtml = prefs.getBool("renderHtml");
var showTimestamp = prefs.getBool("showTimestamp");
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.
// Create feed header containing title and description.
var html = new Array();
html.push('<div class="feedHeader">');
html.push('<div class="feedTitle">');
html.push((feed.Link != "") ? '<a target="_top" href="' + _hesc(feed.Link) + '">' + _hesc(feed.Title) + '</a>' : _hesc(feed.Title));
html.push((feed.Author != "") ? '<span class="feedAuthor"> by ' + _hesc(feed.Author) + '</span>' : "");
html.push('</div>');

if (showFeedDesc) {
html.push('<div class="feedDesc">' + _hesc(feed.Description) + '</div>'); }
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="_top" href="' + entry.Link + '"><b>' + _hesc(entry.Title) + '</b></a>');
if (typeof entry.Summary != "undefined" && entry.Summary != "") {
var summary = document.createElement("div");
summary.innerHTML = (summaries == 0) ? entry.Summary : entry.Summary.substr(0, summaries);
html.push('<div class="entrySummary">');
html.push((renderHtml ? summary.innerHTML : _hesc(summary.innerHTML)));
html.push('</div>');
}
if (!isNaN(entry.Date) && showTimestamp) {
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, (summaries > -1) );
}

// Set onload event handler to call init()
_IG_RegisterOnloadHandler(init);
_IG_Analytics("UA-454375-12", "/coupon-gadget");
</script>
  
  
<div id="one_id" style="display:none;align:middle">
  <center>
<br>
<a href="http://www.couponsurfer.com/pg_show.cfm?pg_id=41" target="_blank">
  <img src="http://www.couponsurfer.com/images/search_logo.gif" 
  width="140" height="18" border="0" alt="Visit CouponSurfer.com">
</a>
    <br> <br>
      <span class="fnt">Search coupons by product type/brand name or click the "All Coupons" tab to browse all available coupons.</span>
      <br>
      <br>
<!-- Google CSE Search Box Begins -->
<form target="_blank" action="http://www.couponsurfer.com/search.cfm" id="cse-search-box">
<input type="text" name="search_string" size="25" />
<input type="submit" name="gadget" value="search" />
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
<!-- Google CSE Search Box Ends -->

<a target="_blank" href="http://www.couponsurfer.com"><span class="fnt">CouponSurfer.com</span></a><br>

</center>
</div>

<div id="two_id">
  <center>
    <br>
    <iframe src="http://www.couponsurfer.com/gadgetdeal.html" width="200" height="220" frameborder="0" scrolling="no"></iframe>
  </center>
  </div>

]]>

</Content>
</Module>
