// This does the shuffle magic
function shuffle(a) {
   var i = a.length;
   if ( i == 0 ) return false;
   while ( --i ) {
      var j = Math.floor( Math.random() * ( i + 1 ) );
      var tempi = a[i];
      var tempj = a[j];
      a[i] = tempj;
      a[j] = tempi;
   }
}

/* Find title of each picture */
function TransitionHandler(entry, transitionTime)
{
if (document.getElementById)
{document.getElementById("image_title").innerHTML =
entry.title; }
else
if (document.all)
{document.all["image_title"].innerHTML = entry.title; }
}

google.load("feeds", "1");

function OnLoad() {
  var feed1  = "https://picasaweb.google.com/data/feed/base/user/bmwmoal/albumid/5596646766441670481?alt=rss&kind=photo&hl=en_US";

  var options = {
     displayTime:2000,
     transistionTime:600,
     numResults : 200,
     linkTarget : google.feeds.LINK_TARGET_BLANK,
     thumbnailSize : GFslideShow.THUMBNAILS_LARGE,
     fullControlPanel: true,
     fullControlPanelSmallIcons: true,
     transitionCallback: TransitionHandler,
     //When the feed gets processed, shuffle the entries
     feedProcessedCallback: function() {
       var e = ss.entries; shuffle(e); ss.entries = e;
     }
  };

  var ss = new GFslideShow(feed1, "slideshow", options);
}

google.setOnLoadCallback(OnLoad);
