function jsonFlickrApi(rsp) {
 if (rsp.stat != "ok"){
  // If this executes, something broke!
  return;
 }
 
 //variable "s" is going to contain 
 //all the markup that is generated by the loop below
 var s = "";
var random_num = Math.floor(400*Math.random())

 
 //this loop runs through every item and creates HTML 
 for (var i=0; i < 96; i++) {
	
  photo = rsp.photos.photo[ i + random_num ];
  
  //notice that "t.jpg" is where you change the
  //size of the image
  
  t_url = "http://farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id + "_" + photo.secret + "_" + "s.jpg";
    
  p_url = "http://farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id + "_" + photo.secret + ".jpg";
  
  d = '<br />' + photo.title;
  
  s +=  '<div class="image">' + '<a href="' + p_url + '" rel="lightbox[g]" title="'+ photo.title +'">' + '<img alt="'+ photo.title + '"src="' + t_url + '"/>' + '</a>' + d + '</div>';
 }

 document.writeln(s); 
 //this tells the JavaScript to write 
 //everything in variable "s" onto the page
}
