<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Slideshow from Picasa Media RSS Feed"
title_url="http://sites.google.com/site/annuairevin/"
height="382"
width="398"
scrolling="false"
directory_title="Media RSS Feed Slideshow. Slideshow from Picasa."
description="Media RSS Feed Slideshow. Display legend of pictures. Slideshow from Picasa, width for Blog."
screenshot="http://www.liens-du-vin.ch/_pic06/gadget-flash_slideshow-screenshot.png"
thumbnail="http://www.liens-du-vin.ch/_pic06/gadget-flash_slideshow-thumb.png"
author="Philippe Chappuis"
author_email="info+gadgetCSE@liens-du-vin.ch"
author_affiliation="Google"
author_location="Rolle Switzerland"
author_link="http://www.liens-du-vin.ch"
author_photo="http://www.liens-du-vin.ch/_pic02/gadget-author-photo.png"
author_aboutme="An Engineer who likes to develop for the Net and tastes wines"
author_quote="A chief is a man who assumes responsibility. He says &quot;I was beaten&quot; he does not say &quot;My men were beaten&quot; - Antoine de Saint-Exupery">

<Require feature="analytics" />

</ModulePrefs>

<UserPref name="File" display_name="File (RSS feed)"
required="true" default_value="https://picasaweb.google.fr/data/feed/base/user/philippe.chappuis/albumid/5297196325809923457?alt=rss&amp;kind=photo&amp;hl=fr" />
<UserPref name="Link" display_name="Link on Title" required="true" default_value="http://www.liens-du-vin.ch/_winemap/maps-clos-domaines-chateaux.htm" />
<UserPref name="Titre" display_name="Title of Link" required="true" default_value="Clos Domaines et Châteaux - La Noblesse des Vins Suisses" />
<UserPref name="RND" display_name="Random display (1 = yes)" required="true" default_value="0" />

<UserPref name="Textcol" display_name="Color for Text" required="true" default_value="#000" />
<UserPref name="TextBcol" display_name="Background for Text" required="true" default_value="#d1dae3" />
<UserPref name="Bordercol" display_name="Color of border" required="true" default_value="#f00" />
<UserPref name="SlideBcol" display_name="Background for Slide" required="true" default_value="#c3d9ff" />
<UserPref name="BoxBcol" display_name="Background for Main Box" required="true" default_value="#d1dae3" />

<UserPref name="PWidth" display_name="Width for pictures" required="true" default_value="380" />
<UserPref name="PHeight" display_name="Height for pictures" required="true" default_value="290" />

<Content type="html"><![CDATA[
<script src="https://www.google.com/jsapi" type="text/javascript"></script>
<script src="https://www.google.com/uds/solutions/slideshow/gfslideshow.js" type="text/javascript"></script>

<style text="text/css">

.gss
{
width: __UP_PWidth__px;
height: __UP_PHeight__px;
margin: 15px auto 5px auto;
color: #000;
background-color: __UP_SlideBcol__;
border: 2px solid __UP_Bordercol__;
padding: 4px;
}

#image_title
{
font-size: 0.9em;
font-family: Arial, Helvetica, sans-serif;
font-style: italic;
text-align: center;
color: __UP_Textcol__;
background-color: __UP_TextBcol__;
}

#feed_title
{
font-size: 0.9em;
font-weight: bold;
font-family: Arial, sans-serif;
text-align: center;
padding: 5px; 
color: __UP_Textcol__;
background-color: __UP_TextBcol__;
}

#feed_title a:link, #feed_title a:visited
{
text-decoration: none;
color: __UP_Textcol__;
}

#feed_title a:hover
{
font-weight: normal;
color: __UP_Textcol__;
}

#main_box
{
background-color: __UP_BoxBcol__;
}

</style>

<script type="text/javascript">

// Global variables

var prefs = new _IG_Prefs(__MODULE_ID__);

var s_fil=_trim(prefs.getString("File"));

var s_lnk=_trim(prefs.getString("Link"));
var s_tit=_trim(prefs.getString("Titre"));

var rnd = "0";
var s_rnd =_trim(prefs.getString("RND"));   
if (s_rnd=="1") {rnd="1";}

function load_feed()
{
var feed_input = s_fil;

var options = {
fullControlPanel: true,
fullControlPanelSmallIcons: true,
thumbnailSize : GFslideShow.THUMBNAILS_LARGE,
pauseOnHover: false,
scaleImages : true,
numResults: 1000,
displayTime: 3500,
transitionTime: 1500,
//no action when click linkTarget : google.feeds.LINK_TARGET_BLANK,
feedLoadCallback: FeedTitle,

// to get the full size
thumbnailUrlResolver: UrlResolver, 
transitionCallback: TransitionHandler
};

if (rnd=="1") /* Random call */
{
   var processEntries = GFslideShow.prototype.processEntries;
     GFslideShow.prototype.processEntries =
       function(entries) {
         for (var i=0, entry;  entry = entries[i];  i++) {
           var j = Math.floor(Math.random() * entries.length);
           var t = entries[j];
           entries[j] = entries[i];
           entries[i] = t;
         }
         processEntries.call(this, entries);
       };
} 

new GFslideShow(feed_input, "slide_box", options);
}

// Find the title of the Feed

function FeedTitle(result)
{ if ( result.error ) { alert("Error : Feed load failed"); }
else
{

var html=result.feed.title;

html="<a href='" + s_lnk + "' target='_blank' title='" + s_tit + "'>" + html + "</a>";

_gel("feed_title").innerHTML=html;
}
}

// Find title of pic

function TransitionHandler(entry, transitionTime)
{
_gel("image_title").innerHTML=entry.title + "<br/>&nbsp;<br/>";
}

// Get the full size (picasa send thumb from s288 (288 x 216 

function UrlResolver (entry)
{

var c=entry.content;
var s1 = c.indexOf("src=")+5;

var i = c.indexOf(".jpg",s1); 
if (i==-1) {i=c.indexOf(".JPG",s1);}  

var s2 = i + 4;  
var thumburl= c.substring(s1,s2); 


// take the picture from s800
  
thumburl=thumburl.replace("/s288/","/s800/");

return(thumburl);    
}        
  
  
google.load("feeds", "1");
google.setOnLoadCallback(load_feed);
  
_IG_Analytics("UA-442758-35", "/g_slide");

</script>


</head>

<div id="main_box">
<div id="feed_title"></div>
<center><div id="slide_box" class="gss">Loading pictures...</div></center>
<div id="image_title"></div>
</div>
]]></Content>
</Module>