var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
/*
 * Flickrush 1.0 - jQuery flickr plugin
 *
 * Copyright (c) 2010 Philip Beel (http://www.theodin.co.uk/)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Revision: $Id: jquery.flickrush.js 2010-02-17 $ 
 *
 */
(function($){
	$.fn.flickrush=function(options){ 
		var defaults={
			limit:3,
			random:true,
			id:'44499772@N06'
		};
		var options=$.extend(defaults,options);
		return this.each(function(options){
			var act=$(this); 
			$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?format=json&size=s&id="+defaults.id+"&jsoncallback=?",
		  	function(data){
				var num = 0; //get a random integer
				var imageArray = new Array(); //store used images in here 
				while( num <= defaults.limit-1) {
					if(defaults.random == true) {
						var randomiser = Math.floor(Math.random()*20);
					} 
			   		$.each(data.items, function(i,item){
			   			if(defaults.random == true) {
							var imgheigth = $(this).parents().width();
							if( ( i == randomiser ) && (!imageArray.in_array(randomiser) ) ) {
								//var link = '<a href="'+item.media.m+'">';
								var newLink = $("<a/>").attr({
									href: item.link,
									target : '_bank'
								});
								var newImage = $("<img/>").attr({
									src: (item.media.m).replace('_m','_s'),
									alt: item.tags,
									width: defaults.width,
									height: imgheigth
								});
								
								$(act).append(newLink.append(newImage)); 
			   				}
			   			} else {
							if( ( i <= defaults.limit-1 ) && (!imageArray.in_array(defaults.limit-1) ) ) {
								var newLink = $("<a/>").attr({
									href: item.link,
									target : _bank
								});
								var newImage = $("<img/>").attr({
									src: item.media.m,
									alt: item.tags
								});
								$(act).append(newLink.append(newImage)); 
			   				}
			   			}
			       	});	
			       	if(defaults.random == true) {
						if ( imageArray.in_array(randomiser) ) {
							defaults.limit++;	
						} 
						//strore our image number
						imageArray.push(randomiser);					
					} else {
						imageArray.push(defaults.limit-1);					
					}
					num++; 	       					
				}
		  	});
		 	
			//function to check in an array
		  	Array.prototype.in_array = function(p_val) {
				for(var i = 0, l = this.length; i < l; i++) {
					if(this[i] == p_val) {
						return true;
					}
				}
				return false;
			}			
		});
	}
})(jQuery);
}