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 = "";

	// generate a random photo index from total count
	var randomIndex = Math.floor(Math.random()* rsp.photos.total);
    photo = rsp.photos.photo[ randomIndex ];

	var imgSize = '_m'; // flickr sizes:  _t, _s, _m, _b, _o
	
    	//notice that "s.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 + imgSize + '.jpg';

  	p_url = 'http://www.flickr.com/photos/'+ photo.owner +'/'+ photo.id;

  	s += '<a href="'+ p_url +'" title="' + photo.title 
		+ '"><img alt="' + photo.title + '" src="' + t_url + '" width="150"/></a><p class="giDescription">'
		+ photo.title + '</p>';

 	document.writeln("<div>" + s + "</div>"); 
}