  <?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs 
	title_url="http://www.rightfromtheheart.org"
	title="1-Minute Daily Devotions" 
	author="Right From The Heart"
scrolling="true"
width="320" 
height="235" 
	author_email="info@rfth.org" 
	screenshot="http://www.rightfromtheheart.org/images/1M-googlegadget_screenshot.png"
	description="Start your day with daily devotions from Right From The Heart Ministries. They get right to the point and remind you each day about what matters most in life. Each devotion takes about a minute to read.  They're also at www.rightfromtheheart.org."
	thumbnail="http://www.rightfromtheheart.org/images/1M-googlegadget_thumb.png"
	author_location="Marietta, GA"
	author_affiliation="Right From The Heart" />

<UserPref name="show_date" display_name="Show Devotion Dates?" datatype="bool"/>
<UserPref name="show_summ" display_name="Show Entire Devotion (not just the title)?" datatype="bool"/>
<UserPref name="num_entries" display_name="Number of Devotions to show:" />
<Content type="html">
<![CDATA[
<style>

#content_div { font-size: 80%; margin: 5px; background-color: #fff;}
.titleBlock{background:#222;color:#fff;height:75px}
#content_div img{float:left;margin:0 10px 10px 0;}
.feedTitle{font-size:18px;padding-top:10px}
.itemTitle a{clear:left;display:block;font-size:14px;margin-bottom:5px;}
#content_div a {color:#00adef;font-weight:bold;}
.commentmsg{background:#eee;padding:5px;border:1px solid #ccc;margin:10px 0}
</style>


<div id=content_div></div>

<script type="text/javascript">

// Get userprefs
var prefs = new _IG_Prefs(__MODULE_ID__);
var showdate = prefs.getBool("show_date");
var summary = prefs.getBool("show_summ");
var entries = prefs.getInt("num_entries");

// If user wants to display more than 9 entries, display an error
// and set the value to 9, the max allowed.
if (entries > 9)
{
alert("You cannot display more than 9 entries.");
entries = 9;
}

// Use the _IG_FetchFeedAsJSON() function to retrieve core feed data from
// the specified URL. Then combine the data with HTML markup for display in
// the gadget.
_IG_FetchFeedAsJSON(
"http://feeds.feedburner.com/rfthdevotions",
function(feed) {
if (feed == null){
alert("There is no data.");
return;
}

// Start building HTML string that will be displayed in gadget.
  var commentmsg = "<div class='commentmsg'>Click the devotion titles to read comments about this devotion and to join in on thie discussion.</div>";
var endmsg = "<div class='endmsg'>These daily devotions are a ministry of <br /><a href='http://www.rightfromtheheart.org'>Right From The Heart</a>.</div>";

var html = "";
// Access the fields in the feed
html += "<div class='titleBlock'>"; 
html += "<img src='http://www.rightfromtheheart.org/images/1M-75.gif' height='75' width='75' alt='1-Minute Daily Devotions' />" ;
html += "<div class='feedTitle'><b>" + feed.Title + "</b></div>";
html += "<div class='feedDesciption'>" + feed.Description + "</div><br>";
html += "</div>";
  
// Access the data for a given entry
if (feed.Entry) {
for (var i = 0; i < feed.Entry.length; i++) {
html += "<div class='itemTitle'>"
+ "<a target='_blank' href='" + feed.Entry[i].Link + "'>"
+ feed.Entry[i].Title
+ "</a> ";
if (showdate==true)
{
// The feed entry Date field contains the timestamp in seconds
// since Jan. 1, 1970. To convert it to the milliseconds needed
// to initialize the JavaScript Date object with the correct date,
// multiply by 1000.

//var milliseconds = (feed.Entry[i].Date) * 1000;
//var date = new Date(milliseconds);
//html += date.toLocaleDateString();
//html += " ";
//html += "<br>"+date.toLocaleTimeString();
html += "<br>"+feed.Entry[i].Date;
}
if (summary==true) {
html += "<br><i>" + feed.Entry[i].Summary + "</i>";
}
html += "</div>";
}
}

_gel("content_div").innerHTML = html + commentmsg +endmsg;
// Tells gadget to resize itself

// The rest of the function parameters, which are optional: the number
// of entries to return, and whether to return summaries.
}, entries, summary);


</script>

]]>
</Content>
</Module>
