var pi=new Object();pi.loadAlbumList=function(A,D){if(!/[\w\.]/.test(A)){alert("Invalid Picasa User Id. Please use only alphanumeric chars or dots. Do not use the '@' character!");return }var B="http://picasaweb.google.com/data/feed/api/user/"+A+"?kind=album&alt=json-in-script&callback=pi.albumListCB";pi._removeOldJSONScriptNodes();pi._loadAlbumListCallback=D;var C=document.createElement("script");C.setAttribute("id","picasaJSON");C.setAttribute("src",B);C.setAttribute("type","text/javascript");C.setAttribute("onerror","et.albumListError('Error loadig albums. Invalid user name?')");document.documentElement.firstChild.appendChild(C);wo.addNotification("Loading albums of "+A)};pi._removeOldJSONScriptNodes=function(){var A=document.getElementById("picasaJSON");if(A){A.parentNode.removeChild(A)}};pi.albumListCB=function(C){var B=new Array();for(var D=0;D<C.feed.entry.length;++D){var E=C.feed.entry[D];var A=new Object();A.name=E.gphoto$name.$t;A.id=E.gphoto$id.$t;A.location=E.gphoto$location.$t;A.timestamp=E.gphoto$timestamp.$t;A.photocount=E.gphoto$numphotos.$t;A.nickname=E.gphoto$nickname.$t;A.username=E.gphoto$user.$t;A.type="picasa";B.push(A)}pi._loadAlbumListCallback(B);wo.addNotification("Albums loaded")};pi.loadAlbum=function(B,A,E){if(!/[\w\.]/.test(B)){alert("Invalid Picasa User Id. Please use only alphanumeric chars or dots. Do not use the '@' character!")}var C="http://picasaweb.google.com/data/feed/api/user/"+B+"/albumid/"+A+"?kind=photo&alt=json-in-script&callback=pi.albumCB";pi._removeOldJSONScriptNodes();pi._loadAlbumCallback=E;var D=document.createElement("script");D.setAttribute("id","picasaJSON");D.setAttribute("src",C);D.setAttribute("type","text/javascript");document.documentElement.firstChild.appendChild(D);wo.addNotification("Displaying album...")};pi.albumCB=function(C){var A=new Array();for(var D=0;D<C.feed.entry.length;++D){var E=C.feed.entry[D];var B=new Object();B.title=E.title.$t;B.summary=E.summary.$t;B.url=E.content.src;B.thumbnailurl=E.media$group.media$thumbnail[2].url;B.width=E.gphoto$width.$t;B.height=E.gphoto$height.$t;B.size=E.gphoto$height.$t;B.timestamp=E.gphoto$timestamp.$t;A.push(B)}pi._loadAlbumCallback(A)};