
/* 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://farm3.static.flickr.com/2496/4217914587_659dfbea02_s.jpg', 'http://www.flickr.com/photos/pftqg/4217914587/', 'Ruby');

			if(1 < maxShow) callbackFunction('http://farm3.static.flickr.com/2612/4218691406_6eca82c0dd_s.jpg', 'http://www.flickr.com/photos/pftqg/4218691406/', 'Ruby');

			if(2 < maxShow) callbackFunction('http://farm3.static.flickr.com/2573/4217924877_5b370cc3e0_s.jpg', 'http://www.flickr.com/photos/pftqg/4217924877/', 'Elijah');

			if(3 < maxShow) callbackFunction('http://farm3.static.flickr.com/2751/4218692652_3f6d884919_s.jpg', 'http://www.flickr.com/photos/pftqg/4218692652/', 'Ruby');

			if(4 < maxShow) callbackFunction('http://farm3.static.flickr.com/2486/4218693326_5e1608457e_s.jpg', 'http://www.flickr.com/photos/pftqg/4218693326/', 'Zoë');

			if(5 < maxShow) callbackFunction('http://farm3.static.flickr.com/2547/4217929023_5413426b89_s.jpg', 'http://www.flickr.com/photos/pftqg/4217929023/', 'Zoë');

			if(6 < maxShow) callbackFunction('http://farm3.static.flickr.com/2794/4220888899_cdb21c1a75_s.jpg', 'http://www.flickr.com/photos/pftqg/4220888899/', 'Zoë (not by me)');

			if(7 < maxShow) callbackFunction('http://farm3.static.flickr.com/2802/4220889557_52e7f60d1d_s.jpg', 'http://www.flickr.com/photos/pftqg/4220889557/', 'Zoë, Me (not by me)');

			if(8 < maxShow) callbackFunction('http://farm5.static.flickr.com/4058/4220891215_657fc1ba6e_s.jpg', 'http://www.flickr.com/photos/pftqg/4220891215/', 'Me (not by me)');

			if(9 < maxShow) callbackFunction('http://farm3.static.flickr.com/2494/4220891925_38cff290d6_s.jpg', 'http://www.flickr.com/photos/pftqg/4220891925/', 'Zoë (not by me)');

	},
	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);
	}
}
