<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs author_email="MaterialsViews@googlemail.com" screenshot="http://materialsviews.com/matview/images/materialsviewslogo.gif" thumbnail="http://materialsviews.com/matview/images/materialsviewslogo.gif" title="MaterialsViews.Com" height="400" title_url="http://materialsviews.com" author="Lorna M. Stimson" description="Keep up to date with new developments in materials science with MaterialsViews.Com" scrolling="true"/>
<UserPref name="show_summ" display_name="Show Summaries?" datatype="bool" default_value="true"/>
<UserPref name="num_entries" display_name="Number of Entries:" default_value="5"/>
<Content type="html">
<![CDATA[
<style> #content_div { font-size: 80%; margin: 5px; background-color: #FF9933;} </style>

<div id=content_div></div>



<script type="text/javascript">

// Get userprefs
var prefs = new _IG_Prefs(__MODULE_ID__);
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 > 15)
{
alert("You cannot display more than 15 entries.");
entries = 15;
}

// 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://www.materialsviews.com/matview/rssnews.xml",
function(feed) {
if (feed == null){
alert("There is no data.");
return;
}

// Start building HTML string that will be displayed in gadget.
var html = "";
// Access the fields in the feed
html+="<img src=http://materialsviews.com/matview/images/materialsviewslogo.gif> </img>";
html+="<br><br><a target=_blank href=http://www.materialsviews.com/matview/search.view>Search the MaterialsViews website or Wiley Interscience</a> <br><br>";




// Access the data for a given entry
if (feed.Entry) {
for (var i = 0; i < feed.Entry.length; i++) {
html += "<div>"
+ "<a target='_blank' href='" + feed.Entry[i].Link + "'>"
+ feed.Entry[i].Title
+ "</a> ";

if (summary==true) {
html += "<br><i>" + feed.Entry[i].Summary + "</i>";
}
html += "</div>";
}
}

_gel("content_div").innerHTML = html;
// 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>
