<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Picasa Web"
  title_url="http://picasaweb.google.com/__UP_myuser__"
  author="Bas Hennekam."
  author_email="bashennekam@gmail.com"
  author_location="Utrecht, the Netherlands"
  category="tools"
  description="You can see your Picasa Web public favorites and their activity, but you can also browse through all the albums and photos (including comments) in the iGoogle gadget itself!"
  screenshot="http://gadgets.bashennekam.nl/picasa/google_gadget_picasa_screen.jpg"
  thumbnail="http://gadgets.bashennekam.nl/picasa/google_gadget_picasa_thumb.png"
  height="20">
<Require feature="dynamic-height"/> 
<Require feature="setprefs"/>
<Require feature="analytics"/>
</ModulePrefs>

<UserPref name="myuser" display_name="Google Username: " required="true" />
<UserPref name="size_fav" display_name="Favorites thumb: " datatype="enum" default_value="32">
  <EnumValue value="32" display_value="32x32"/>
  <EnumValue value="48" display_value="48x48"/>
  <EnumValue value="64" display_value="64x64"/>
</UserPref>
<UserPref name="size_alb" display_name="Albums thumb: " datatype="enum" default_value="64">
  <EnumValue value="32" display_value="32x32"/>
  <EnumValue value="48" display_value="48x48"/>
  <EnumValue value="64" display_value="64x64"/>
</UserPref>
<UserPref name="size_pho" display_name="Photos thumb: " datatype="enum" default_value="48">
  <EnumValue value="32" display_value="32x32"/>
  <EnumValue value="48" display_value="48x48"/>
  <EnumValue value="64" display_value="64x64"/>
</UserPref>
<UserPref name="fav_acti" display_name="Favorites Activity: " datatype="enum" default_value="5">
  <EnumValue value="0" display_value="0"/>
  <EnumValue value="1" display_value="1"/>
  <EnumValue value="2" display_value="2"/>
  <EnumValue value="3" display_value="3"/>
  <EnumValue value="4" display_value="4"/>
  <EnumValue value="5" display_value="5"/>
  <EnumValue value="6" display_value="6"/>
  <EnumValue value="7" display_value="7"/>
  <EnumValue value="8" display_value="8"/>
  <EnumValue value="9" display_value="9"/>
  <EnumValue value="10" display_value="10"/>
</UserPref>
<UserPref name="maxheight" display_name="Max-height: " default_value="280" />

<Content type="html">
<![CDATA[
<!-- ALm6fM0p-y1odwke91WzQ2Is6BDa8SPsTFD4BNYQbzd9Nmv0PiTSISr92Bqd--mEB-R0v61nTtXbEo7LuYE7mKUeJYVGahwz9UYkIAZu6fKgh4VkS6OPdM7xFS6HEHWZ4giOWuYBcgc3NBjs470Zz9079U0ehO9IZ5uAM6J1Me86wz8mWLE-iJMgaeroiMuMw6ZScPCc_nuH -->

<style type="text/css"> 
body, td, div, span, p {
  font-family: arial,sans-serif;
  font-size: 10pt;
}
  
a.picasa_link:link, a.picasa_link:visited, a.picasa_link:hover, a.picasa_link:active {
  font-weight: bold;
  color: #555555;
  text-decoration: none;
  font-size: 10pt;
}

.picasa_light {
  font-weight: none;
  color: #aaaaaa;
  text-decoration: none;
  font-size: 8pt;
}

img.picasa_thumb {
  border: 1px solid #5C7FB9;
  margin: 1px 0px 2px 1px;
}

img.picasa_small {  
  max-width: 100%;
  width: expression(this.width > 100% ? 100%: true);
  height: 216px;
  margin-top: 5px;
  margin-bottom: 5px;
}
  
div.picasa_div_top {
  background-color: #C3D9FF;
  vertical-align: baseline;
  cursor: pointer;
  cursor: hand;
  height: 20px;
}
 
div.picasa_div_list {
  margin-top: 2px;
  background-color: #ffffff;
  width: 100%;
  max-height: __UP_maxheight__px;
  overflow: auto;
  height: expression(this.scrollHeight > __UP_maxheight__ ? "__UP_maxheight__px" : "auto");
}
  
div.picasa_div {
  background-color: #ffffff;
}
  
</style>

<script language="Javascript" type="text/javascript">
_IG_Analytics("UA-3622119-2", "/GadgetPicasaWeb/load");
  
var picasa_googleprefs = new _IG_Prefs(__MODULE_ID__);
var google_size_fav = picasa_googleprefs.getString("size_fav");
var google_size_alb = picasa_googleprefs.getString("size_alb");
var google_size_pho = picasa_googleprefs.getString("size_pho");
var google_fav_acti = picasa_googleprefs.getString("fav_acti");

var modules_div = '';
  
var photoList = new Array();
var monthArray = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var favoUsers = new Array();
var favoActiv = new Array();
  
function getFavorites(username)
{
  var url = "http://picasaweb.google.com/"+username;
  
  _gel("loading").style.display = '';

  _IG_FetchContent(url, function (response) {
    _gel("loading").style.display = 'none';
      
    if(response.indexOf("NOT_FOUND") != -1)
    {
      _gel("favoriteslist").innerHTML = 'Unknown user: <b>__UP_myuser__</b>';
    }
    else
    {
      _gel("favoriteslist").innerHTML = response;
            
      var favo_user_name = _gel("lhid_user_nickname").innerHTML;
      var favo_user_image = _gel("lhcl_portrait_id").src;
      favo_user_image = favo_user_image.replace("s48-c", "s32-c");
      var favo_list = "";
      var favo_list_length = 0;
    
      if(_gel("lhid_links"))
      {        
        favo_list = _gel("lhid_links").innerHTML;        
        favo_list_length = favo_list.match(new RegExp("lhcl_name", "g")).length;  
        favo_list = favo_list.replace(/a href=\"http:\/\/picasaweb.google.com\//g,"a class=\"picasa_link\" onclick='getAlbumList(this.href, true);return false' href=\"http:\/\/");        
        favo_list = favo_list.replace(/A href=\"http:\/\/picasaweb.google.com\//g,"a class=\"picasa_link\" onclick='getAlbumList(this.href, true);return false' href=\"http:\/\/");   
        favo_list = favo_list.replace(/height=\"48\" width=\"48\"/g, "");
        favo_list = favo_list.replace(/height=48/g, "");
        favo_list = favo_list.replace(/width=48/g, "");        
        favo_list = favo_list.replace(/border=\"0\"/g, 'width="'+google_size_fav+'" height="'+google_size_fav+'"');
        favo_list = favo_list.replace(/border=0/g, 'width="'+google_size_fav+'" height="'+google_size_fav+'"');        
        favo_list = favo_list.replace(/class=\"lhcl_portrait\"/g, 'class="picasa_thumb"');
        favo_list = favo_list.replace(/class=lhcl_portrait/g, 'class="picasa_thumb"');
        favo_list = favo_list.replace(/s48-c/g, "s"+google_size_fav+"-c");
      }
  
      var users_temp = favo_list;      
      users_temp = users_temp.replace(/false' href="http:\/\//ig,'|');
      users_temp = users_temp.replace(/\"><img class=\"picasa_thumb\"/g, '|');
            
      var temp = '';
      for(i=0;i<((users_temp.split("|").length-1)/3);i++)
      {
          count = (i*3)+1;
          favoUsers[favoUsers.length] = users_temp.split("|")[count].replace('.jpg','');
      }
  
      var favo_list_user = '<div style="margin-bottom:5px;">';
      favo_list_user += '<a class="picasa_link" onclick="getAlbumList(this.href, true);return false" href="http://__UP_myuser__">';
      favo_list_user += '<img src="'+favo_user_image+'" width="20" height="20" border="0" />';
      favo_list_user += '</a>';
      favo_list_user += '<a class="picasa_link" onclick="getAlbumList(this.href, true);return false" href="http://__UP_myuser__">'+favo_user_name+'</a>';
      favo_list_user += '</div>';
      
      favo_list_user += '<table cellspacing="0" width="95%" align="left"><tr>'
      favo_list_user += '<td class="picasa_light">Public Favorites</td>';
      favo_list_user += '<td align="right" class="picasa_light">';
      favo_list_user += '<a href="#" onclick="slideup(\'favoritesactivity\');slidedown(\'favoritesusers\'); return false" style="text-decoration:none">List</a> | ';
      favo_list_user += '<a href="#" onclick="slideup(\'favoritesusers\');slidedown(\'favoritesactivity\'); return false" style="text-decoration:none">Activity</a>';
      favo_list_user += '</td></tr><tr><td colspan="2" style="border-top: solid 1px #eeeeee">';
      favo_list_user += '<div id="favoritesactivity" style="display:"></div>';      
      favo_list_user += '<div id="favoritesusers" style="display:none">'+favo_list+'</div>';
      favo_list_user += '</td></tr></table>';
        
      _gel("favoriteslist").innerHTML = favo_list_user;
    }
    slidedown('favorites');
    getActivityList();
  });
}
  
function getActivityList()
{
  for(j=0;j<favoUsers.length;j++)
  {
    var url = "http://picasaweb.google.com/data/feed/base/user/"+favoUsers[j]+"?kind=album&alt=rss&hl=en_US";  
  
    _IG_FetchXmlContent(url, function (response) {
      if (response != null && typeof(response) == "object" && response.firstChild != null)
      {
        var user_editor = response.getElementsByTagName("managingEditor")[0].firstChild.nodeValue;
        var user_image = response.getElementsByTagName("image")[0].getElementsByTagName("url")[0].firstChild.nodeValue;
        var user_link = response.getElementsByTagName("link")[0].firstChild.nodeValue.split("/")[3];
        
        var itemList = response.getElementsByTagName("item");

        for(i=0;i<itemList.length;i++)
        {
          var album_title = itemList[i].getElementsByTagName("title")[0].firstChild.nodeValue;
          var album_id = itemList[i].getElementsByTagName("guid")[0].firstChild.nodeValue.split("\/")[9].split("?")[0];

          var album_thumbnail = '';
          var album_pubdate = '';
          try {
            album_thumbnail = itemList[i].getElementsByTagNameNS('http://search.yahoo.com/mrss/','thumbnail')[0].getAttribute("url");
            album_pubdate = itemList[i].getElementsByTagNameNS('http://www.w3.org/2005/Atom','updated')[0].firstChild.nodeValue;
          }catch(e) {
            album_thumbnail = itemList[i].getElementsByTagName('media:thumbnail')[0].getAttribute("url");
            album_pubdate = itemList[i].getElementsByTagName('atom:updated')[0].firstChild.nodeValue;
          }
          album_thumbnail = album_thumbnail.replace("s160-c","s"+google_size_fav+"-c");
                   
          var album_array = new Array(album_pubdate, album_title, album_id, album_thumbnail, user_link, user_editor);
          favoActiv[favoActiv.length] = album_array;        
        }
        
        favoActiv.sort(compareAlbums);
        
        showActivityList();
      }
    });   
  }  
}
  
function showActivityList()
{
  var activity_html = '<table cellspacing="0" style="padding:2px">';

  for(l=0;l<google_fav_acti && l<favoActiv.length;l++)
  {
    activity_html += '<tr><td align="left" valign="middle">';
    activity_html += '<a href="'+favoActiv[l][4]+'" onclick="getAlbumList(\''+favoActiv[l][4]+'\', false);getPhotoList(\''+favoActiv[l][4]+'\',\''+favoActiv[l][2]+'\');return false" class="picasa_link">';
    activity_html += '<img class="picasa_thumb" src="'+ favoActiv[l][3]+'" width="'+google_size_fav+'" height="'+google_size_fav+'"></a>';
    activity_html += '</td><td>';
    activity_html += '&nbsp;<a href="'+favoActiv[l][4]+'" onclick="getAlbumList(\''+favoActiv[l][4]+'\', false);getPhotoList(\''+favoActiv[l][4]+'\',\''+favoActiv[l][2]+'\');return false" class="picasa_link">' + favoActiv[l][1] + '</a>';
    activity_html += '<br />&nbsp;<font color="#999999">' + favoActiv[l][5] + '</font>';
    activity_html += '</td></tr>';    
  }
  activity_html += '</table>';
 
  _gel("favoritesactivity").innerHTML = activity_html;
  _IG_AdjustIFrameHeight(); 
}
  
function compareAlbums(a,b)
{
  return a[0].toLowerCase()!=b[0].toLowerCase() ? a[0].toLowerCase()>b[0].toLowerCase() ? -1 : 1 : 0;
}

function getAlbumList(username, album_show)
{
  username = username.replace("http:", "");
  username = username.replace(/\//g,"")

  var url = "http://picasaweb.google.com/data/feed/base/user/"+username+"?kind=album&alt=rss&hl=en_US";
  if(album_show) _gel("loading").style.display= '';

  _IG_FetchXmlContent(url, function (response) {
    if (response == null || typeof(response) != "object" || response.firstChild == null)
    {
      _gel("albumslist").innerHTML = "No albums found.";
    }
    else
    {
      var user_editor = response.getElementsByTagName("managingEditor")[0].firstChild.nodeValue;
      var user_image = response.getElementsByTagName("image")[0].getElementsByTagName("url")[0].firstChild.nodeValue;
      var user_link = response.getElementsByTagName("link")[0].firstChild.nodeValue;
      
      var itemList = response.getElementsByTagName("item");

      var html_user = '<a href="'+user_link+'" target="_BLANK">';
      html_user += '<img src="http://gadgets.bashennekam.nl/picasa/google_gadget_picasa_popup.gif" border="0" style="margin:3px;float:right"></a>';
      html_user += '<img src="'+user_image+'" border="0" width="20" align="left"> ';
      html_user += '&nbsp;<b>'+user_editor+'</b> ('+itemList.length+')';
      
      if(album_show) _gel("loading").style.display= 'none';
      _gel("albumstop").innerHTML = html_user;

      var html_albums = '<table>';

      for(i=0;i<itemList.length;i++)
      {
        var album_title = itemList[i].getElementsByTagName("title")[0].firstChild.nodeValue;
        var album_id = itemList[i].getElementsByTagName("guid")[0].firstChild.nodeValue.split("\/")[9].split("?")[0];
        var album_date = itemList[i].getElementsByTagName("pubDate")[0].firstChild.nodeValue;
        var album_date_day = album_date.substr(5, 2);
        var album_date_mon = album_date.substr(8, 3);
        var album_date_yea = album_date.substr(12, 4);

        var album_thumbnail = '';
        var album_pubdate = '';
        try {
          album_thumbnail = itemList[i].getElementsByTagNameNS('http://search.yahoo.com/mrss/','thumbnail')[0].getAttribute("url");
          album_pubdate = itemList[i].getElementsByTagNameNS('http://www.w3.org/2005/Atom', 'updated')[0].firstChild.nodeValue;
        }catch(e) {
          album_thumbnail = itemList[i].getElementsByTagName('media:thumbnail')[0].getAttribute("url");
          album_pubdate = itemList[i].getElementsByTagName('atom:updated')[0].firstChild.nodeValue;
        }
        album_thumbnail = album_thumbnail.replace("s160-c","s"+google_size_alb+"-c");

        var album_pubdate_day = album_pubdate.substr(8,2);
        var album_pubdate_mon = monthArray[album_pubdate.substr(5,2)-1];
        var album_pubdate_yea = album_pubdate.substr(0,4);

        html_albums += '<tr><td>';
        html_albums += '<a href="#" class="picasa_link" onclick="getPhotoList(\''+username+'\',\''+album_id+'\');return false">';
        html_albums += '<img src="'+album_thumbnail+'" width="'+google_size_alb+'" height="'+google_size_alb+'" class="picasa_thumb" id="alb'+album_id+'"></a><br />';
        html_albums += '</td><td>';
        html_albums += '<a href="#" class="picasa_link" onclick="getPhotoList(\''+username+'\',\''+album_id+'\');return false">';
        html_albums += album_title+'</a>';
        html_albums += '<br />';
        html_albums += '<span class="picasa_light"> ';
        html_albums += album_date_day+' '+album_date_mon+' '+album_date_yea;
        html_albums += ' (Last update: '+album_pubdate_day+' '+album_pubdate_mon+' '+album_pubdate_yea+')';
        html_albums += '</span>';
        html_albums += '</td></tr>';
      }
      html_albums += '</table>';

      _gel("albumslist").innerHTML = html_albums;
      if(album_show) slideup('favorites');
      if(album_show) slidedown('albums');
    }
  });
}

function getPhotoList(username, albumid)
{
  var url = 'http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+albumid+'?kind=photo&alt=rss&hl=en_US';
  _gel("loading").style.display = '';

  _IG_FetchXmlContent(url, function (response) {
    if (response == null || typeof(response) != "object" || response.firstChild == null)
    {
      _gel("photoslist").innerHTML = "No photos found.";
    }
    else
    {
      var album_title = response.getElementsByTagName("title")[0].firstChild.nodeValue;
      var album_image = response.getElementsByTagName("image")[0].getElementsByTagName("url")[0].firstChild.nodeValue;
      var album_link = response.getElementsByTagName("link")[0].firstChild.nodeValue;
      
      var itemList = response.getElementsByTagName("item");
      
      var html_album  = '<a href="'+album_link+'" target="_BLANK">';
      html_album  += '<img src="http://gadgets.bashennekam.nl/picasa/google_gadget_picasa_popup.gif" border="0" style="margin:3px;float:right"></a>';
      html_album += '<img src="'+album_image+'" border="0" width="20" align="left">';
      html_album += '&nbsp;<b>'+album_title+'</b> ('+itemList.length+')';

      _gel("loading").style.display = 'none';
      _gel("photostop").innerHTML = html_album;

      var html_photos = '';
      photoList = new Array(0);

      for(i=0;i<itemList.length;i++)
      {
        var photo_title = '';
        var photo_descr = '';
        var photo_thumb = '';
        var photo_small = '';
        var photo_large = '';
        var photo_id = itemList[i].getElementsByTagName("guid")[0].firstChild.nodeValue.split("\/")[11].split("?")[0];
        var photo_link = itemList[i].getElementsByTagName("link")[0].firstChild.nodeValue;
        
        try {
          photo_title = itemList[i].getElementsByTagNameNS('http://search.yahoo.com/mrss/','title')[0].firstChild.nodeValue;
          try{photo_descr = itemList[i].getElementsByTagNameNS('http://search.yahoo.com/mrss/','description')[0].firstChild.nodeValue;}catch(e){}
          photo_thumb = itemList[i].getElementsByTagNameNS('http://search.yahoo.com/mrss/','thumbnail')[0].getAttribute("url");
          photo_small = itemList[i].getElementsByTagNameNS('http://search.yahoo.com/mrss/','thumbnail')[2].getAttribute("url");
          photo_large = itemList[i].getElementsByTagNameNS('http://search.yahoo.com/mrss/','content')[0].getAttribute("url");
        }catch(e) {
          photo_title = itemList[i].getElementsByTagName('media:title')[0].firstChild.nodeValue;
          try{photo_descr = itemList[i].getElementsByTagName('media:description')[0].firstChild.nodeValue;}catch(e){}
          photo_thumb = itemList[i].getElementsByTagName('media:thumbnail')[0].getAttribute("url");
          photo_small = itemList[i].getElementsByTagName('media:thumbnail')[2].getAttribute("url");
          photo_large = itemList[i].getElementsByTagName('media:content')[0].getAttribute("url");
        }

        photo_thumb = photo_thumb.replace("s72","s"+google_size_pho+"-c");

        photoList[i] = new Array(photo_title, photo_descr, photo_thumb, photo_small, photo_large, photo_id, username, albumid, photo_link);

        html_photos += '<a href="#" onclick="getPhoto(\''+photo_id+'\');_gel(\'photodescbg\').style.display=\'\';return false">';
        html_photos += '<img src="'+photo_thumb+'" width="'+google_size_pho+'" height="'+google_size_pho+'" class="picasa_thumb" title="'+photo_descr+'" id="pho'+photo_id+'"></a>';
      }

      try{_gel("alb" + albumid).style.opacity = ".30";}catch(e){}
      _gel("photoslist").innerHTML = html_photos;
      slideup('favorites');
      slideup('albums');
      slidedown('photos');
    }
  });
}

function getPhoto(photoId)
{
  var photo_title = '';
  var photo_descr = '';
  var photo_thumb = '';
  var photo_small = '';
  var photo_large = '';
  var photo_id = '';
  var username = '';
  var albumid = '';

  var prev_bool = true;
  var prev_photo = '';
  var next_bool = true;
  var next_photo = '';
  var curr_photo = 0;

  for(i=0;i<photoList.length;i++)
  {
    if(photoList[i][5] == photoId)
    {
      photo_title = photoList[i][0];
      photo_descr = photoList[i][1];
      photo_thumb = photoList[i][2];
      photo_small = photoList[i][3];
      photo_large = photoList[i][4];
      photo_id = photoList[i][5];
      username = photoList[i][6];
      albumid = photoList[i][7];
      photo_link = photoList[i][8];

      if(i == 0)
      {
        prev_bool = false;
      }
      else
      {
        prev_photo = photoList[i-1][5];
        var prev_preload = new Image();
        prev_preload.src = photoList[i-1][3];
      }

      if(i == photoList.length-1)
      {
        next_bool = false;
      }
      else
      {
        next_photo = photoList[i+1][5];
        var next_preload = new Image();
        next_preload.src = photoList[i+1][3];
      }

      curr_photo = i+1;
    }
  }

  var html_photo = '<table cellspacing="0" style="margin:0px;padding:0px;width:100%">';
  html_photo += '<tr><td align="center" height="236px">';
  html_photo += '<img src="'+photo_small+'" border="0" height="216" class="picasa_small">';
  html_photo += '</td></tr><tr><td align="center">';
  html_photo += '<span style="float:left">';
  if(prev_bool) {
    html_photo += '<a href="#" onclick="getPhoto(\''+prev_photo+'\');return false" style="text-decoration:none;font-size:14pt;font-weight:bold;font-family:Verdana;color:#666666;">';
    html_photo += '&laquo;</a>';
  } else {
    html_photo += '&nbsp;&nbsp;&nbsp;&nbsp;';  
  }
  html_photo += '</span>';
  html_photo += '<span style="float:right">';
  if(next_bool) {
    html_photo += '<a href="#" onclick="getPhoto(\''+next_photo+'\');return false" style="text-decoration:none;font-size:14pt;font-weight:bold;font-family:Verdana;color:#666666;">';
    html_photo += '&raquo;</a>';
  } else {
    html_photo += '&nbsp;&nbsp;&nbsp;&nbsp;';
  }
  html_photo += '</span>';
  html_photo += '<font style="color:#999999;font-size:9pt;">';
  html_photo += curr_photo + ' of ' + photoList.length;
  html_photo += '</font>';
  html_photo += '</td></tr></table>';

  var html_photo_top = '<a href="'+photo_link+'" target="_BLANK">';
  html_photo_top += '<img src="http://gadgets.bashennekam.nl/picasa/google_gadget_picasa_popup.gif" border="0" style="margin:3px;float:right"></a>';
  html_photo_top += '<center><b>' + photo_title + '</b></center>';   

  _gel("pho" + photoId).style.opacity = ".30";  
  _gel("phototop").innerHTML = html_photo_top;
  _gel("photolist").innerHTML = html_photo;
  _gel("photodesctext").innerHTML = photo_descr;
  
  if(photo_descr.length != 0) {    
    _gel('photodescbg').style.display = '';
  }
  else {
    _gel('photodescbg').style.display = 'none';
  }
      
  slideup('photos');
  slidedown('photo');
  
  getPhotoComment(username, albumid, photo_id, photo_title);
}

function getPhotoComment(username, albumid, photoid, phototitle)
{
  _gel('photodesccomm').innerHTML = '';
  _gel('photodesccomm').style.display = 'none';
  
  var url = 'http://picasaweb.google.com/data/feed/base/user/'+username+'/albumid/'+albumid+'/photoid/'+photoid+'?alt=rss&hl=en_US';
  
  _IG_FetchXmlContent(url, function (response) {
    var comment_html = '';    
    var itemList = response.getElementsByTagName("item");  
    
    for(i=0;i<itemList.length;i++)
    {
      var commentfull = itemList[i].getElementsByTagName('description')[0].firstChild.nodeValue;
      commentfull = commentfull.replace('<p>', '$');
      commentfull = commentfull.replace('</p>', '$');
      var comment = commentfull.split('$')[1]; //todo
      var author = itemList[i].getElementsByTagName('author')[0].firstChild.nodeValue;
      var pubDate = itemList[i].getElementsByTagName('pubDate')[0].firstChild.nodeValue.substr(0,26);              
      var photo = commentfull.split('"')[7];
      
      comment_html += '<table width="100%" cellspacing="0" style="margin-top:3px;">';
      comment_html += '<tr bgcolor="#E5DFD1" style="color:#666666">';
      comment_html += '<td rowspan="2" bgcolor="#ffffff" valign="top" width="32"><img src="'+photo+'" width="32" height="32" border="0"></td>';
      comment_html += '<td style="padding:1px"><b>'+author+'</b></td><td align="right" style="padding:1px">'+pubDate+'</td></tr>';
      comment_html += '<tr><td colspan="2" style="padding:1px">'+comment+'</td></tr>';
      comment_html += '</table>';
    }
    
    if(_gel("phototop").innerHTML.indexOf(phototitle) != -1)
    {
      _gel('photodesccomm').innerHTML = comment_html;
      if(comment_html.length > 0) _gel('photodesccomm').style.display = '';
    }
    _IG_AdjustIFrameHeight();
  });
}

function slidedown(objname){
  _gel(objname).style.display = '';
  _IG_AdjustIFrameHeight();
}

function slideup(objname){
  _gel(objname).style.display = 'none';
  _IG_AdjustIFrameHeight();
}
  
</script>
  
<div id="loading" style="background-color:#FAD163;font-weight:bold;padding:1px" align="center">
  <img src="http://gadgets.bashennekam.nl/picasa/google_gadget_picasa_loading.gif" border=0>
  &nbsp;Loading...&nbsp;
</div>

<div id="favorites" class="picasa_div" style="display:none;">
  <div id="favoriteslist" class="picasa_div_list"></div>
</div>
 
<div id="albums" class="picasa_div" style="display:none;">
  <div id="albumstop" class="picasa_div_top" onclick="slideup('albums');slidedown('favorites')"></div>
  <div id="albumslist" class="picasa_div_list"></div>
</div>

<div id="photos" class="picasa_div" style="display:none;">
  <div id="photostop" class="picasa_div_top" onclick="slideup('photos');slidedown('albums')"></div>
  <div id="photoslist" class="picasa_div_list"></div>
</div>

<div id="photo" class="picasa_div" style="display:none;">
  <div id="phototop" class="picasa_div_top" onclick="_gel('photodesccomm').style.display='none';_gel('photodescbg').style.display='none';slideup('photo');slidedown('photos')"></div>
  <div id="photolist" class="picasa_div_list" style="overflow:hidden;max-height:280px"></div>  
</div>

<div id="photodescbg" style="width:100%;margin-top:10px;background-color:#eeeeee;display:none;">
    <div id="photodesctext" style="font-size:10pt;color:#333333;text-align:center"></div>    
</div>

<div id="photodesccomm" style="width:100%;margin:0px;display:none;font-size:10pt;color:#333333"></div>

<span id="temp" style="display:none"></span>

<script language="Javascript" type="text/javascript"> 
getFavorites("__UP_myuser__");
</script>

]]>
</Content>

</Module>




