<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Try Costa Rica" height="325" scrolling="true"
    title_url="http://www.trycostarica.com/"
    author="Jeff Brown for Ticode, S.R.L."
    author_location="Costa Rica"
    author_email="ticode.development+trycr.gadget@google.com"
  screenshot="http://www.trycostarica.com/gadget-images/try-costa-rica.png"
    thumbnail="http://www.trycostarica.com/gadget-images/120x60-TCR.jpg"
    description="Enjoy beautiful beaches high mountains, rainforest, wild rivers, and the people of Costa Rica.  These pictures might whet your appetite for a Costa Rican Vacation, and if not, take a mini-vacation from your desk! Pura Vida!" 
  author_photo="http://www.trycostarica.com/gadget-images/author-70x10.gif"
    author_aboutme="Our services include web development, graphic design and search engine optimization. We specialize in making search engine friendly web sites utilizing the latest in web dev technology. We prefer to work in (X)HTML, PHP, MySQL, CSS and JavaScript."
    author_link="http://www.ticode.com"
    render_inline="never" directory_title="Try Costa Rica">
    <Require feature="setprefs"	      />
    <Require feature="views"	      />
    <Require feature="opensocial-0.7" />
    <Require feature="analytics"      />
  </ModulePrefs>
  <UserPref name="lastId" display_name="Last Image Id" default_value="1" />
  <Content type="html" view="default,home">
<![CDATA[
<div id="content_div"></div>

<script type="text/javascript">
function getViewName()
{
  return gadgets.views.getCurrentView().getName();
}
function displayImage()
{
  // XML breakfast menu data
  var prefs   = new _IG_Prefs(__MODULE_ID__);
  var lastId  = prefs.getInt('lastId'); // last Id viewed
  var url     = 'http://www.trycostarica.com/s/image-get/' + lastId + '/';
  var html    = '<iframe src ="' + url + '" frameborder="0" height="325" '
	      + 'marginheight="0" scrolling="no" marginwidth="0" '
	      +	'width="100%"></iframe>';

   _gel('content_div').innerHTML = html;

   if (lastId > 999)
   {
     lastId = 0;
   }
   prefs.set("lastId", lastId + 1);
}
_IG_RegisterOnloadHandler(displayImage);

</script>
]]>
  </Content>
  <Content type="html" view="default,home">
<![CDATA[
<div id="content_canvas_div"></div>

<script type="text/javascript">
function getViewName()
{
  return gadgets.views.getCurrentView().getName();
}
function displayImage()
{
  // XML breakfast menu data
  var prefs   = new _IG_Prefs(__MODULE_ID__);
  var lastId  = prefs.getInt('lastId'); // last Id viewed
  var url     = 'http://www.trycostarica.com/s/panorama-get/' + lastId 
	      + '/';
  var html    = '<iframe src ="' + url + '" frameborder="0" height="625" '
	      + 'marginheight="0" scrolling="no" marginwidth="0" '
	      +	'width="100%"></iframe>';

   _gel('content_canvas_div').innerHTML = html;
   prefs.set("lastId", lastId + 1);
}
_IG_RegisterOnloadHandler(displayImage);

</script>
]]>
  </Content>
</Module>
