sample=false;function jsonFlickrApi(rsp){var element=$('#'+rsp.photoset.id)
element.html('');for(var index in rsp.photoset.photo){var photo=rsp.photoset.photo[index];var big_url='http://farm'+
photo.farm+'.static.flickr.com/'+
photo.server+'/'+
photo.id+'_'+
photo.secret;var thumb_url=big_url+'_s.jpg';var img_thumb_tag='<img width="75" height="75" src="'+thumb_url+'" alt="'+photo.title+'" />';var img_tag='<a rel="lightbox-'+rsp.photoset.id+'" href="'+big_url+'.jpg"'+(index>0&&sample?'style="display:none;"':'')+'>'+img_thumb_tag+'</a>';if(index==0&&sample){var table='<table><tr><td>'+img_tag+'</td></tr><tr><td>'+rsp.photoset.photo.length+' photos</td></tr></table>';img_tag=table;}
if(photo.id&&photo.secret){element.append(img_tag);}}
$('#'+rsp.photoset.id+' a').slimbox();};FlickrPhotoSetLightBox={initialize:function(photoseturl,element,picasa){if(!picasa){this.displayFlickrPhotoSet(photoseturl,element);}else{this.displayPicasaPhotoSet(photoseturl,element);}},injectScript:function(url){var head=document.getElementsByTagName('head')[0];var script=document.createElement('script');script.type='text/javascript';script.src=url;head.appendChild(script);},displayFlickrPhotoSet:function(photoseturl,element){var api_key='14dab255e1e91d5644b52ea44dbf8af2';var parts=photoseturl.split('/');var set_id='';for(var i=0;i<parts.length;i++){if(parts[i]=='sets'){set_id=parts[i+1];break;}}
if(set_id==''){$(element).html('Failed to load. Could not retrieve set id from set url');}else{var set_api_url='http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&format=json&photoset_id='+set_id+'&api_key='+api_key;$(element).html('Loading set photos...');$(element).attr('id',set_id);this.injectScript(set_api_url);}},displayPicasaPhotoSet:function(photoseturl,element){var parts=photoseturl.split('/');var username=parts[3];var album=parts[4];$(element).pwi({username:username,maxresults:50,mode:'album',album:album});},}