
/* This JavaScript file was automatically generated by the Flickr DOM-Badge maker.
 * More information and the script that generated it can be obtained from
 * http://m.ac.nz/d/
 * toArray() and bind() come from prototype:
 *   Prototype JavaScript framework, version 1.4.0
 *   (c) 2005 Sam Stephenson <sam@conio.net>
 */

10

if(!FlickrTools) {
    var FlickrTools = {
		toArray: function(iterable) {
		  if (!iterable) return [];
		  if (iterable.toArray) {
		    return iterable.toArray();
		  } else {
		    var results = [];
		    for (var i = 0; i < iterable.length; i++)
		      results.push(iterable[i]);
		    return results;
		  }
		},
		bind: function() {
			args = FlickrTools.toArray(arguments);
		    var __method = args.shift(), object = args.shift();

	  		return function() {
		    	return __method.apply(object, args.concat(FlickrTools.toArray(arguments)));
		  	}
		}
	};
}

FlickrTools.set1 = {
	
	drawPhotos: function(callbackFunction, maxShow) {
		if(maxShow == null) maxShow = 10;

			if(0 < maxShow) callbackFunction('http://farm5.static.flickr.com/4017/4545095885_b1fee36e2e_s.jpg', 'http://www.flickr.com/photos/pftqg/4545095885/', 'Breakfast, before being eaten. Obviously.');

			if(1 < maxShow) callbackFunction('http://farm5.static.flickr.com/4014/4545729488_5ce6a9a5f9_s.jpg', 'http://www.flickr.com/photos/pftqg/4545729488/', 'Boyfriend and B stare at... something. Not entirely sure what.');

			if(2 < maxShow) callbackFunction('http://farm5.static.flickr.com/4038/4545096701_595568e323_s.jpg', 'http://www.flickr.com/photos/pftqg/4545096701/', 'Path to nowhere. Currently closed.');

			if(3 < maxShow) callbackFunction('http://farm5.static.flickr.com/4044/4545730280_6d40f8b14e_s.jpg', 'http://www.flickr.com/photos/pftqg/4545730280/', 'Stu & B');

			if(4 < maxShow) callbackFunction('http://farm5.static.flickr.com/4015/4545730904_75b2c33939_s.jpg', 'http://www.flickr.com/photos/pftqg/4545730904/', 'Plant-y thing-ys.');

			if(5 < maxShow) callbackFunction('http://farm5.static.flickr.com/4072/4545731318_d20b61f241_s.jpg', 'http://www.flickr.com/photos/pftqg/4545731318/', 'B');

			if(6 < maxShow) callbackFunction('http://farm5.static.flickr.com/4061/4545098253_2697904040_s.jpg', 'http://www.flickr.com/photos/pftqg/4545098253/', 'Puppy!');

			if(7 < maxShow) callbackFunction('http://farm5.static.flickr.com/4025/4545098819_20558fd5e0_s.jpg', 'http://www.flickr.com/photos/pftqg/4545098819/', 'No rides left');

			if(8 < maxShow) callbackFunction('http://farm3.static.flickr.com/2433/4545732504_e801ba6a1a_s.jpg', 'http://www.flickr.com/photos/pftqg/4545732504/', 'Stu');

			if(9 < maxShow) callbackFunction('http://farm5.static.flickr.com/4033/4570756138_d615c798bb_s.jpg', 'http://www.flickr.com/photos/pftqg/4570756138/', 'Lava lamp!');

	},
	destId : "",
	drawInto: function(destId, maxShow) {
	    this.destId = destId;
	    this.drawPhotos(FlickrTools.bind(this.drawInto_Callback, this), maxShow);
	},
	drawInto_Callback: function(aSrc, aUrl, aTitle) {
	    var theLinkEl = document.createElement('a');
	    theLinkEl.href = aUrl;        
	    var theImageEl = document.createElement('img');
	    theImageEl.src = aSrc;
	    theImageEl.title = aTitle;
	    theLinkEl.appendChild(theImageEl);
	    document.getElementById(this.destId).appendChild(theLinkEl);
	}
}
