/*
jQuery Waypoints - v1.1
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/jquery-waypoints/blob/master/MIT-license.txt
https://github.com/imakewebthings/jquery-waypoints/blob/master/GPL-license.txt
*/
(function($,k,m,i,d){var e=$(i),g="waypoint.reached",b=function(o,n){o.element.trigger(g,n);if(o.options.triggerOnce){o.element[k]("destroy")}},h=function(p,o){var n=o.waypoints.length-1;while(n>=0&&o.waypoints[n].element[0]!==p[0]){n-=1}return n},f=[],l=function(n){$.extend(this,{element:$(n),oldScroll:-99999,waypoints:[],didScroll:false,didResize:false,doScroll:$.proxy(function(){var q=this.element.scrollTop(),p=q>this.oldScroll,s=this,r=$.grep(this.waypoints,function(u,t){return p?(u.offset>s.oldScroll&&u.offset<=q):(u.offset<=s.oldScroll&&u.offset>q)}),o=r.length;if(!this.oldScroll||!q){$[m]("refresh")}this.oldScroll=q;if(!o){return}if(!p){r.reverse()}$.each(r,function(u,t){if(t.options.continuous||u===o-1){b(t,[p?"down":"up"])}})},this)});$(n).scroll($.proxy(function(){if(!this.didScroll){this.didScroll=true;i.setTimeout($.proxy(function(){this.doScroll();this.didScroll=false},this),$[m].settings.scrollThrottle)}},this)).resize($.proxy(function(){if(!this.didResize){this.didResize=true;i.setTimeout($.proxy(function(){$[m]("refresh");this.didResize=false},this),$[m].settings.resizeThrottle)}},this));e.load($.proxy(function(){this.doScroll()},this))},j=function(n){var o=null;$.each(f,function(p,q){if(q.element[0]===n){o=q;return false}});return o},c={init:function(o,n){this.each(function(){var u=$.fn[k].defaults.context,q,t=$(this);if(n&&n.context){u=n.context}if(!$.isWindow(u)){u=t.closest(u)[0]}q=j(u);if(!q){q=new l(u);f.push(q)}var p=h(t,q),s=p<0?$.fn[k].defaults:q.waypoints[p].options,r=$.extend({},s,n);r.offset=r.offset==="bottom-in-view"?function(){var v=$.isWindow(u)?$[m]("viewportHeight"):$(u).height();return v-$(this).outerHeight()}:r.offset;if(p<0){q.waypoints.push({element:t,offset:t.offset().top,options:r})}else{q.waypoints[p].options=r}if(o){t.bind(g,o)}});$[m]("refresh");return this},remove:function(){return this.each(function(o,p){var n=$(p);$.each(f,function(r,s){var q=h(n,s);if(q>=0){s.waypoints.splice(q,1)}})})},destroy:function(){return this.unbind(g)[k]("remove")}},a={refresh:function(){$.each(f,function(r,s){var q=$.isWindow(s.element[0]),n=q?0:s.element.offset().top,p=q?$[m]("viewportHeight"):s.element.height(),o=q?0:s.element.scrollTop();$.each(s.waypoints,function(u,x){var t=x.options.offset,w=x.offset;if(typeof x.options.offset==="function"){t=x.options.offset.apply(x.element)}else{if(typeof x.options.offset==="string"){var v=parseFloat(x.options.offset);t=x.options.offset.indexOf("%")?Math.ceil(p*(v/100)):v}}x.offset=x.element.offset().top-n+o-t;if(s.oldScroll>w&&s.oldScroll<=x.offset){b(x,["up"])}else{if(s.oldScroll<w&&s.oldScroll>=x.offset){b(x,["down"])}}});s.waypoints.sort(function(u,t){return u.offset-t.offset})})},viewportHeight:function(){return(i.innerHeight?i.innerHeight:e.height())},aggregate:function(){var n=$();$.each(f,function(o,p){$.each(p.waypoints,function(q,r){n=n.add(r.element)})});return n}};$.fn[k]=function(n){if(c[n]){return c[n].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof n==="function"||!n){return c.init.apply(this,arguments)}else{if(typeof n==="object"){return c.init.apply(this,[null,n])}else{$.error("Method "+n+" does not exist on jQuery "+k)}}}};$.fn[k].defaults={continuous:true,offset:0,triggerOnce:false,context:i};$[m]=function(n){if(a[n]){return a[n].apply(this)}else{return a.aggregate()}};$[m].settings={resizeThrottle:200,scrollThrottle:100};e.load(function(){$[m]("refresh")})})(jQuery,"waypoint","waypoints",this);



/*
	AnythingSlider v1.6.2
	Original by Chris Coyier: http://css-tricks.com
	Get the latest version: https://github.com/ProLoser/AnythingSlider

	To use the navigationFormatter function, you must have a function that
	accepts two paramaters, and returns a string of HTML text.

	index = integer index (1 based);
	panel = jQuery wrapped LI item this tab references
	@return = Must return a string of HTML/Text

	navigationFormatter: function(index, panel){
		return "Panel #" + index; // This would have each tab with the text 'Panel #X' where X = index
	}
*/

(function($) {

	$.anythingSlider = function(el, options) {

		var base = this, o;

		// Wraps the ul in the necessary divs and then gives Access to jQuery element
		base.$el = $(el).addClass('anythingBase').wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>');

		// Add a reverse reference to the DOM object
		base.$el.data("AnythingSlider", base);

		base.init = function(){

			// Added "o" to be used in the code instead of "base.options" which doesn't get modifed by the compiler - reduces size by ~1k
			base.options = o = $.extend({}, $.anythingSlider.defaults, options);

			base.initialized = false;
			if ($.isFunction(o.onBeforeInitialize)) { base.$el.bind('before_initialize', o.onBeforeInitialize); }
			base.$el.trigger('before_initialize', base);

			// Cache existing DOM elements for later
			// base.$el = original ul
			// for wrap - get parent() then closest in case the ul has "anythingSlider" class
			base.$wrapper = base.$el.parent().closest('div.anythingSlider').addClass('anythingSlider-' + o.theme);
			base.$window = base.$el.closest('div.anythingWindow');
			base.$controls = $('<div class="anythingControls"></div>').appendTo( (o.appendControlsTo !== null && $(o.appendControlsTo).length) ? $(o.appendControlsTo) : base.$wrapper); // change so this works in jQuery 1.3.2
			base.win = window;
			base.$win = $(base.win);

			base.$nav = $('<ul class="thumbNav" />').appendTo(base.$controls);

			// Set up a few defaults & get details
			base.flag    = false; // event flag to prevent multiple calls (used in control click/focusin)
			base.playing = false; // slideshow state
			base.slideshow = false; // slideshow flag
			base.hovered = false; // actively hovering over the slider
			base.panelSize = [];  // will contain dimensions and left position of each panel
			base.currentPage = o.startPanel = parseInt(o.startPanel,10) || 1; // make sure this isn't a string
			base.adj = (o.infiniteSlides) ? 0 : 1; // adjust page limits for infinite or limited modes
			base.outerPad = [ base.$wrapper.innerWidth() - base.$wrapper.width(), base.$wrapper.innerHeight() - base.$wrapper.height() ];
			if (o.playRtl) { base.$wrapper.addClass('rtl'); }

			// save some options
			base.original = [ o.autoPlay, o.buildNavigation, o.buildArrows];

			// Expand slider to fit parent
			if (o.expand) {
				base.$outer = base.$wrapper.parent();
				base.$window.css({ width: '100%', height: '100%' }); // needed for Opera
				base.outerDim = [ base.$outer.width(), base.$outer.height() ];
				base.checkResize();
			}

			base.updateSlider();

			base.$lastPage = base.$currentPage;

			// Get index (run time) of this slider on the page
			base.runTimes = $('div.anythingSlider').index(base.$wrapper) + 1;
			base.regex = new RegExp('panel' + base.runTimes + '-(\\d+)', 'i'); // hash tag regex

			// Make sure easing function exists.
			if (!$.isFunction($.easing[o.easing])) { o.easing = "swing"; }

			// If pauseOnHover then add hover effects
			if (o.pauseOnHover) {
				base.$wrapper.hover(function() {
					if (base.playing) {
						base.$el.trigger('slideshow_paused', base);
						base.clearTimer(true);
					}
				}, function() {
					if (base.playing) {
						base.$el.trigger('slideshow_unpaused', base);
						base.startStop(base.playing, true);
					}
				});
			}

			// If a hash can not be used to trigger the plugin, then go to start panel
			var triggers, startPanel = (o.hashTags) ? base.gotoHash() || o.startPanel : o.startPanel;
			base.setCurrentPage(startPanel, false); // added to trigger events for FX code

			// Hide/Show navigation & play/stop controls
			base.slideControls(false);
			base.$wrapper.bind('mouseenter mouseleave', function(e){
				base.hovered = (e.type === "mouseenter") ? true : false;
				base.slideControls( base.hovered, false );
			});

			// Add keyboard navigation
			$(document).keyup(function(e){
				// Stop arrow keys from working when focused on form items
				var lnk, slider,
					active = base.$wrapper.is('.activeSlider') && !e.target.tagName.match('TEXTAREA|INPUT|SELECT') && o.showMultiple === false;
				switch (e.which) {
					case 9: // tab
						lnk = $(':focus');
						slider = lnk.closest('.anythingSlider');
						if (slider[0] === base.$wrapper[0]) {
							base.makeActive();
							base.$window.scrollLeft(0);
							base.gotoPage(lnk.closest('.panel').index() + base.adj);
						}
						break;
					case 39: // right arrow
						if (active && o.enableKeyboard) { base.goForward(); }
						break;
					case 37: //left arrow
						if (active && o.enableKeyboard) { base.goBack(); }
						break;
				}
			});

			// Binds events
			triggers = "slideshow_paused slideshow_unpaused slide_init slide_begin slideshow_stop slideshow_start initialized swf_completed".split(" ");
			$.each("onShowPause onShowUnpause onSlideInit onSlideBegin onShowStop onShowStart onInitialized onSWFComplete".split(" "), function(i,f){
				if ($.isFunction(o[f])){
					base.$el.bind(triggers[i], o[f]);
				}
			});
			if ($.isFunction(o.onSlideComplete)){
				// Added setTimeout (zero time) to ensure animation is complete... see this bug report: http://bugs.jquery.com/ticket/7157
				base.$el.bind('slide_complete', function(){
					setTimeout(function(){ o.onSlideComplete(base); }, 0);
				});
			}
			base.initialized = true;
			base.$el.trigger('initialized', base);

		};

		// called during initialization & to update the slider if a panel is added or deleted
		base.updateSlider = function(){
			// needed for updating the slider
			base.$el.children('.cloned').remove();
			base.$nav.empty();

			base.$items = base.$el.children(); 
			base.pages = base.$items.length;
			o.showMultiple = parseInt(o.showMultiple,10) || 1; // only integers allowed

			if (o.showMultiple > 1) {
				if (o.showMultiple > base.pages) { o.showMultiple = base.pages; }
				base.adjustMultiple = (o.infiniteSlides && base.pages > 1) ? 0 : parseInt(o.showMultiple, 10) - 1;
				base.pages = base.$items.length - base.adjustMultiple;
			}

			// Remove navigation & player if there is only one page
			if (base.pages <= 1) {
				o.autoPlay = false;
				o.buildNavigation = false;
				o.buildArrows = false;
				base.$controls.hide();
				base.$nav.hide();
				if (base.$forward) { base.$forward.add(base.$back).hide(); }
			} else {
				o.autoPlay = base.original[0];
				o.buildNavigation = base.original[1];
				o.buildArrows = base.original[2];
				base.$controls.show();
				base.$nav.show();
				if (base.$forward) { base.$forward.add(base.$back).show(); }

				// Build navigation tabs
				base.buildNavigation();

				// If autoPlay functionality is included, then initialize the settings
				if (o.autoPlay) {
					base.playing = !o.startStopped; // Sets the playing variable to false if startStopped is true
					base.buildAutoPlay();
				}

				// Build forwards/backwards buttons
				if (o.buildArrows) { base.buildNextBackButtons(); }
			}

			// Top and tail the list with 'visible' number of items, top has the last section, and tail has the first
			// This supports the "infinite" scrolling, also ensures any cloned elements don't duplicate an ID
			if (o.infiniteSlides && base.pages > 1) {
				base.$el.prepend( base.$items.filter(':last').clone().addClass('cloned').removeAttr('id') );
				// Add support for multiple sliders shown at the same time
				if (o.showMultiple > 1) {
					base.$el.append( base.$items.filter(':lt(' + o.showMultiple + ')').clone().addClass('cloned').addClass('multiple').removeAttr('id') );
				} else {
					base.$el.append( base.$items.filter(':first').clone().addClass('cloned').removeAttr('id') );
				}
				base.$el.find('.cloned').each(function(){
					// disable all focusable elements in cloned panels to prevent shifting the panels by tabbing
					$(this).find('a,input,textarea,select').attr('disabled', 'disabled');
					$(this).find('[id]').removeAttr('id');
				});
			}

			// We just added two items, time to re-cache the list, then get the dimensions of each panel
			base.$items = base.$el.children().addClass('panel');
			base.setDimensions();

			// Set the dimensions of each panel
			if (o.resizeContents) {
				if (o.width) {
					base.$items.css('width', o.width);
					base.$wrapper.css('width', base.getDim(base.currentPage)[0]);
				}
				if (o.height) { base.$wrapper.add(base.$items).css('height', o.height); }
			} else {
				base.$win.load(function(){ base.setDimensions(); }); // set dimensions after all images load
			}

			if (base.currentPage > base.pages) {
				base.currentPage = base.pages;
			}
			base.setCurrentPage(base.currentPage, false);
			base.$nav.find('a').eq(base.currentPage - 1).addClass('cur'); // update current selection

		};

		// Creates the numbered navigation links
		base.buildNavigation = function() {
			var tmp, klass, $a;
			if (o.buildNavigation && (base.pages > 1)) {
				base.$items.filter(':not(.cloned)').each(function(i) {
					var index = i + 1;
					klass = ((index === 1) ? 'first' : '') + ((index === base.pages) ? 'last' : '');
					$a = $('<a href="#"></a>').addClass('panel' + index).wrap('<li class="' + klass + '" />');
					base.$nav.append($a.parent()); // use $a.parent() so it will add <li> instead of only the <a> to the <ul>

					// If a formatter function is present, use it
					if ($.isFunction(o.navigationFormatter)) {
						tmp = o.navigationFormatter(index, $(this));
						$a.html('<span>' + tmp + '</span>');
						// Add formatting to title attribute if text is hidden
						if (parseInt($a.find('span').css('text-indent'),10) < 0) { $a.addClass(o.tooltipClass).attr('title', tmp); }
					} else {
						$a.html('<span>' + index + '</span>');
					}

					$a.bind(o.clickControls, function(e) {
						if (!base.flag && o.enableNavigation) {
							// prevent running functions twice (once for click, second time for focusin)
							base.flag = true; setTimeout(function(){ base.flag = false; }, 100);
							base.gotoPage(index);
							if (o.hashTags) { base.setHash(index); }
						}
						e.preventDefault();
					});
				});
			}
		};

		// Creates the Forward/Backward buttons
		base.buildNextBackButtons = function() {
			if (base.$forward) { return; }
			base.$forward = $('<span class="arrow forward"><a href="#"><span>' + o.forwardText + '</span></a></span>');
			base.$back = $('<span class="arrow back"><a href="#"><span>' + o.backText + '</span></a></span>');

			// Bind to the forward and back buttons
			base.$back.bind(o.clickArrows, function(e) {
				base.goBack();
				e.preventDefault();
			});
			base.$forward.bind(o.clickArrows, function(e) {
				base.goForward();
				e.preventDefault();
			});
			// using tab to get to arrow links will show they have focus (outline is disabled in css)
			base.$back.add(base.$forward).find('a').bind('focusin focusout',function(){
			 $(this).toggleClass('hover');
			});

			// Append elements to page
			base.$wrapper.prepend(base.$forward).prepend(base.$back);
			base.$arrowWidth = base.$forward.width();
		};

		// Creates the Start/Stop button
		base.buildAutoPlay = function(){
			if (base.$startStop || base.pages < 2) { return; }
			base.$startStop = $("<a href='#' class='start-stop'></a>").html('<span>' + (base.playing ? o.stopText : o.startText) + '</span>');
			base.$controls.prepend(base.$startStop);
			base.$startStop
				.bind(o.clickSlideshow, function(e) {
					if (o.enablePlay) {
						base.startStop(!base.playing);
						if (base.playing) {
							base.goForward(true);
						}
					}
					e.preventDefault();
				})
				// show button has focus while tabbing
				.bind('focusin focusout',function(){
					$(this).toggleClass('hover');
				});

			// Use the same setting, but trigger the start;
			base.startStop(base.playing);
		};

		// Adjust slider dimensions on parent element resize
		base.checkResize = function(stopTimer){
			clearTimeout(base.resizeTimer);
			base.resizeTimer = setTimeout(function(){
				var w = base.$outer.width(), h = (base.$outer[0].tagName === "BODY") ? base.$win.height() : base.$outer.height(), dim = base.outerDim;
				if (dim[0] !== w || dim[1] !== h) {
					base.outerDim = [ w, h ];
					base.setDimensions(); // adjust panel sizes
					// make sure page is lined up (use 1 millisecond animation time, because "0||x" ignores zeros)
					base.gotoPage(base.currentPage, base.playing, null, 1);
				}
				if (typeof(stopTimer) === 'undefined'){ base.checkResize(); }
			}, 500);
		};

		// Set panel dimensions to either resize content or adjust panel to content
		base.setDimensions = function(){
			var w, h, c, cw, dw, leftEdge = 0,
				// showMultiple must have o.width set!!
				bww = (o.showMultiple > 1) ? o.width || base.$window.width()/o.showMultiple : base.$window.width(),
				winw = base.$win.width();
			if (o.expand){
				w = base.$outer.width() - base.outerPad[0];
				h = base.$outer.height() - base.outerPad[1];
				base.$wrapper.add(base.$window).add(base.$items).css({ width: w, height: h });
				bww = (o.showMultiple > 1) ? w/o.showMultiple : w;
			}
			base.$items.each(function(i){
				c = $(this).children('*');
				if (o.resizeContents){
					// get viewport width & height from options (if set), or css
					w = parseInt(o.width,10) || bww;
					h = parseInt(o.height,10) || base.$window.height();
					// resize panel
					$(this).css({ width: w, height: h });
					if (c.length && c[0].tagName === "EMBED") { c.attr({ width: '100%', height: '100%' }); } // needed for IE7; also c.length > 1
					// resize panel contents, if solitary (wrapped content or solitary image)
					if (c.length === 1){
						c.css({ width: '100%', height: '100%' });
					}
				} else {
					// get panel width & height and save it
					w = $(this).width(); // if not defined, it will return the width of the ul parent
					dw = (w >= winw) ? true : false; // width defined from css?
					if (c.length === 1 && dw){
						cw = (c.width() >= winw) ? bww : c.width(); // get width of solitary child
						$(this).css('width', cw); // set width of panel
						c.css('max-width', cw);   // set max width for all children
						w = cw;
					}
					w = (dw) ? o.width || bww : w;
					$(this).css('width', w);
					h = $(this).outerHeight(); // get height after setting width
					$(this).css('height', h);
				}
				base.panelSize[i] = [w,h,leftEdge];
				leftEdge += w;
			});
			// Set total width of slider, but don't go beyond the set max overall width (limited by Opera)
			base.$el.css('width', (leftEdge < o.maxOverallWidth) ? leftEdge : o.maxOverallWidth);
		};

		// get dimension of multiple panels, as needed
		base.getDim = function(page){
			page = (o.infiniteSlides && base.pages > 1) ? page : page - 1;
			var i,
				w = base.panelSize[page][0],
				h = base.panelSize[page][1];
			if (o.showMultiple > 1) {
				for (i=1; i < o.showMultiple; i++) {
					w += base.panelSize[(page + i)%o.showMultiple][0];
					h = Math.max(h, base.panelSize[page + i][1]);
				}
			}
			return [w,h];
		};

		base.goForward = function(autoplay) {
			base.gotoPage(base.currentPage + parseInt(o.changeBy, 10) * (o.playRtl ? -1 : 1), autoplay);
		};

		base.goBack = function(autoplay) {
			base.gotoPage(base.currentPage + parseInt(o.changeBy, 10) * (o.playRtl ? 1 : -1), autoplay);
		};

		base.gotoPage = function(page, autoplay, callback, time) {
			if (autoplay !== true) { autoplay = false; base.startStop(false); }
			if (o.changeBy !== 1){
				if (page < 0) { page += base.pages; }
				if (page > base.pages) { page -= base.pages; }
			}
			if (base.pages <= 1) { return; } // prevents animation
			base.$lastPage = base.$currentPage;
			if (typeof(page) !== "number") {
				page = o.startPanel;
				base.setCurrentPage(page);
			}

			// pause YouTube videos before scrolling or prevent change if playing
			if (autoplay && o.isVideoPlaying(base)) { return; }

			if (page > base.pages + 1 - base.adj) { page = (!o.infiniteSlides && !o.stopAtEnd) ? 1 : base.pages; }
			if (page < base.adj ) { page = (!o.infiniteSlides && !o.stopAtEnd) ? base.pages : 1; }
			base.currentPage = ( page > base.pages ) ? base.pages : ( page < 1 ) ? 1 : base.currentPage;
			base.$currentPage = base.$items.eq(base.currentPage - base.adj);
			base.exactPage = page;
			base.$targetPage = base.$items.eq( (page === 0) ? base.pages - base.adj : (page > base.pages) ? 1 - base.adj : page - base.adj ); 
			base.$el.trigger('slide_init', base);

			base.slideControls(true, false);

			// When autoplay isn't passed, we stop the timer
			if (autoplay !== true) { autoplay = false; }
			// Stop the slider when we reach the last page, if the option stopAtEnd is set to true
			if (!autoplay || (o.stopAtEnd && page === base.pages)) { base.startStop(false); }

			base.$el.trigger('slide_begin', base);

			// resize slider if content size varies
			if (!o.resizeContents) {
				// animating the wrapper resize before the window prevents flickering in Firefox
				var d = base.getDim(page);
				base.$wrapper.filter(':not(:animated)').animate(
					{ width: d[0], height: d[1] },
					{ queue: false, duration: time || o.animationTime, easing: o.easing }
				);
			}

			// Animate Slider
			base.$el.filter(':not(:animated)').animate(
				{ left : -base.panelSize[(o.infiniteSlides && base.pages > 1) ? page : page - 1][2] },
				{ queue: false, duration: time || o.animationTime, easing: o.easing, complete: function(){ base.endAnimation(page, callback); } }
			);
		};

		base.endAnimation = function(page, callback){
			if (page === 0) {
				base.$el.css('left', -base.panelSize[base.pages][2]);
				page = base.pages;
			} else if (page > base.pages) {
				// reset back to start position
				base.$el.css('left', -base.panelSize[1][2]);
				page = 1;
			}
			base.exactPage = page;
			base.setCurrentPage(page, false);
			// Add active panel class
			base.$items.removeClass('activePage').eq(page - base.adj).addClass('activePage');

			if (!base.hovered) { base.slideControls(false); }

			base.$el.trigger('slide_complete', base);
			// callback from external slide control: $('#slider').anythingSlider(4, function(slider){ })
			if (typeof callback === 'function') { callback(base); }

			// Continue slideshow after a delay
			if (o.autoPlayLocked && !base.playing) {
				setTimeout(function(){
					base.startStop(true);
				// subtract out slide delay as the slideshow waits that additional time.
				}, o.resumeDelay - o.delay);
			}
		};

		base.setCurrentPage = function(page, move) {
			page = parseInt(page, 10);
			if (page > base.pages + 1 - base.adj) { page = base.pages - base.adj; }
			if (page < base.adj ) { page = 1; }

			// Set visual
			if (o.buildNavigation){
				base.$nav
					.find('.cur').removeClass('cur').end()
					.find('a').eq(page - 1).addClass('cur');
			}

			// hide/show arrows based on infinite scroll mode
			if (!o.infiniteSlides && o.stopAtEnd){
				base.$wrapper
					.find('span.forward')[ page === base.pages ? 'addClass' : 'removeClass']('disabled').end()
					.find('span.back')[ page === 1 ? 'addClass' : 'removeClass']('disabled');
				if (page === base.pages && base.playing) { base.startStop(); }
			}

			// Only change left if move does not equal false
			if (!move) {
				var d = base.getDim(page);
				base.$wrapper
					.css({ width: d[0], height: d[1] })
					.add(base.$window).scrollLeft(0); // reset in case tabbing changed this scrollLeft - probably overly redundant
				base.$el.css('left', -base.panelSize[(o.infiniteSlides && base.pages > 1) ? page : page - 1][2] );
			}
			// Update local variable
			base.currentPage = page;
			base.$currentPage = base.$items.eq(page - base.adj).addClass('activePage');

			base.makeActive();

		};

		base.makeActive = function(){
			// Set current slider as active so keyboard navigation works properly
			if (!base.$wrapper.is('.activeSlider')){
				$('.activeSlider').removeClass('activeSlider');
				base.$wrapper.addClass('activeSlider');
			}
		};

		// This method tries to find a hash that matches panel-X
		// If found, it tries to find a matching item
		// If that is found as well, then that item starts visible
		base.gotoHash = function(){
			var n = base.win.location.hash.match(base.regex);
			return (n===null) ? '' : parseInt(n[1],10);
		};

		base.setHash = function(n){
			var s = 'panel' + base.runTimes + '-',
				h = base.win.location.hash;
			if ( typeof h !== 'undefined' ) {
				base.win.location.hash = (h.indexOf(s) > 0) ? h.replace(base.regex, s + n) : h + "&" + s + n;
			}
		};

		// Slide controls (nav and play/stop button up or down)
		base.slideControls = function(toggle){
			var dir = (toggle) ? 'slideDown' : 'slideUp',
				t1 = (toggle) ? 0 : o.animationTime,
				t2 = (toggle) ? o.animationTime: 0,
				op = (toggle) ? 1 : 0,
				sign = (toggle) ? 0 : 1; // 0 = visible, 1 = hidden
			if (o.toggleControls) {
				base.$controls.stop(true,true).delay(t1)[dir](o.animationTime/2).delay(t2); 
			}
			if (o.buildArrows && o.toggleArrows) {
				if (!base.hovered && base.playing) { sign = 1; op = 0; } // don't animate arrows during slideshow
				base.$forward.stop(true,true).delay(t1).animate({ right: sign * base.$arrowWidth, opacity: op }, o.animationTime/2);
				base.$back.stop(true,true).delay(t1).animate({ left: sign * base.$arrowWidth, opacity: op }, o.animationTime/2);
			}
		};

		base.clearTimer = function(paused){
			// Clear the timer only if it is set
			if (base.timer) { 
				base.win.clearInterval(base.timer); 
				if (!paused && base.slideshow) {
					base.$el.trigger('slideshow_stop', base); 
					base.slideshow = false;
				}
			}
		};

		// Handles stopping and playing the slideshow
		// Pass startStop(false) to stop and startStop(true) to play
		base.startStop = function(playing, paused) {
			if (playing !== true) { playing = false; } // Default if not supplied is false

			if (playing && !paused) {
				base.$el.trigger('slideshow_start', base);
				base.slideshow = true;
			}

			// Update variable
			base.playing = playing;

			// Toggle playing and text
			if (o.autoPlay) {
				base.$startStop.toggleClass('playing', playing).html('<span>' + (playing ? o.stopText : o.startText) + '</span>');
				// add button text to title attribute if it is hidden by text-indent
				if (parseInt(base.$startStop.find('span').css('text-indent'),10) < 0) {
					base.$startStop.addClass(o.tooltipClass).attr('title', playing ? 'Stop' : 'Start');
				}
			}

			// Pause slideshow while video is playing
			if (playing && o.resumeOnVideoEnd){
				base.clearTimer(true); // Just in case this was triggered twice in a row
				base.timer = base.win.setInterval(function() {
					// prevent autoplay if video is playing
					if ( !o.isVideoPlaying(base) ) {
						base.goForward(true);
					}
				}, o.delay/2);
			} else {
				base.clearTimer();
			}
		};

		// Trigger the initialization
		base.init();
	};

	$.anythingSlider.defaults = {
		// Appearance
		width               : null,      // Override the default CSS width
		height              : null,      // Override the default CSS height
		expand              : false,     // If true, the entire slider will expand to fit the parent element
		resizeContents      : true,      // If true, solitary images/objects in the panel will expand to fit the viewport
		showMultiple        : false,     // Set this value to a number and it will show that many slides at once
		tooltipClass        : 'tooltip', // Class added to navigation & start/stop button (text copied to title if it is hidden by a negative text indent)
		theme               : 'default', // Theme name

		// Navigation
		startPanel          : 1,         // This sets the initial panel
		changeBy            : 1,         // Amount to go forward or back when changing panels.
		hashTags            : true,      // Should links change the hashtag in the URL?
		infiniteSlides      : true,      // if false, the slider will not wrap
		enableKeyboard      : true,      // if false, keyboard arrow keys will not work for the current panel.
		buildArrows         : true,      // If true, builds the forwards and backwards buttons
		toggleArrows        : false,     // If true, side navigation arrows will slide out on hovering & hide @ other times
		buildNavigation     : true,      // If true, builds a list of anchor links to link to each panel
		enableNavigation    : true,      // if false, navigation links will still be visible, but not clickable.
		toggleControls      : false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
		appendControlsTo    : null,      // A HTML element (jQuery Object, selector or HTMLNode) to which the controls will be appended if not null
		navigationFormatter : null,      // Details at the top of the file on this use (advanced use)
		forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
		backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)

		// Slideshow options
		enablePlay          : true,      // if false, the play/stop button will still be visible, but not clickable.
		autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
		autoPlayLocked      : false,     // If true, user changing slides will not stop the slideshow
		startStopped        : false,     // If autoPlay is on, this can force it to start stopped
		pauseOnHover        : true,      // If true & the slideshow is active, the slideshow will pause on hover
		stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page. This also stops the rewind effect when infiniteSlides is false.
		playRtl             : false,     // If true, the slideshow will move right-to-left
		startText           : "Start",   // Start button text
		stopText            : "Stop",    // Stop button text
		delay               : 3000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
		resumeDelay         : 15000,     // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		animationTime       : 600,       // How long the slideshow transition takes (in milliseconds)
		easing              : "swing",   // Anything other than "linear" or "swing" requires the easing plugin

		// Callbacks - removed from options to reduce size - they still work

		// Interactivity
		clickArrows         : "click",         // Event used to activate arrow functionality (e.g. "click" or "mouseenter")
		clickControls       : "click focusin", // Events used to activate navigation control functionality
		clickSlideshow      : "click",         // Event used to activate slideshow play/stop button

		// Video
		resumeOnVideoEnd    : true,      // If true & the slideshow is active & a supported video is playing, it will pause the autoplay until the video is complete
		addWmodeToObject    : "opaque",  // If your slider has an embedded object, the script will automatically add a wmode parameter with this setting
		isVideoPlaying      : function(base){ return false; }, // return true if video is playing or false if not - used by video extension

		// Misc options
		maxOverallWidth     : 32766     // Max width (in pixels) of combined sliders (side-to-side); set to 32766 to prevent problems with Opera
	};

	$.fn.anythingSlider = function(options, callback) {

		return this.each(function(){
			var page, anySlide = $(this).data('AnythingSlider');

			// initialize the slider but prevent multiple initializations
			if ((typeof(options)).match('object|undefined')){
				if (!anySlide) {
					(new $.anythingSlider(this, options));
				} else {
					anySlide.updateSlider();
				}
			// If options is a number, process as an external link to page #: $(element).anythingSlider(#)
			} else if (/\d/.test(options) && !isNaN(options) && anySlide) {
				page = (typeof(options) === "number") ? options : parseInt($.trim(options),10); // accepts "  2  "
				// ignore out of bound pages
				if ( page >= 1 && page <= anySlide.pages ) {
					anySlide.gotoPage(page, false, callback); // page #, autoplay, one time callback
				}
			}
		});
	};

})(jQuery);

/* AnythingSlider works with works with jQuery 1.4+, but you can uncomment the code below to make it
   work with jQuery 1.3.2. You'll have to manually add the code below to the minified copy if needed */
/*
 // Copied from jQuery 1.4.4 to make AnythingSlider backwards compatible to jQuery 1.3.2
 if (typeof jQuery.fn.delay === 'undefined') {
  jQuery.fn.extend({
   delay: function( time, type ) {
    time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; type = type || "fx";
    return this.queue( type, function() { var elem = this; setTimeout(function() { jQuery.dequeue( elem, type ); }, time ); });
   }
  });
 }
*/


/*
 * 	easyListSplitter 1.0.2 - jQuery Plugin
 *	written by Andrea Cima Serniotti	
 *	http://www.madeincima.eu
 *
 *	Copyright (c) 2010 Andrea Cima Serniotti (http://www.madeincima.eu)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *	Built for jQuery library
 *	http://jquery.com
 *
 */
 
 /*
	To activate the plugin add the following code to your own js file:
	
	$('.your-list-class-name').easyListSplitter({ 
			colNumber: 3,
			direction: 'horizontal'
	});
	
 */

var j = 1;
 
(function(jQuery) {
	jQuery.fn.easyListSplitter = function(options) {
	
	var defaults = {			
		colNumber: 2, // Insert here the number of columns you want. Consider that the plugin will create the number of cols requested only if there are enough items in the list.
		direction: 'vertical'
	};
			
	this.each(function() {
		
		var obj = jQuery(this);
		var settings = jQuery.extend(defaults, options);
		var totalListElements = jQuery(this).children('li').size();
		var baseColItems = Math.ceil(totalListElements / settings.colNumber);
		var listClass = jQuery(this).attr('class');
		
		// -------- Create List Elements given colNumber ------------------------------------------------------------------------------
		
		for (i=1;i<=settings.colNumber;i++)
		{	
			if(i==1){
				jQuery(this).addClass('listCol1').wrap('<div class="listContainer'+j+'"></div>');
			} else if(jQuery(this).is('ul')){ // Check whether the list is ordered or unordered
				jQuery(this).parents('.listContainer'+j).append('<ul class="listCol'+i+'"></ul>');
			} else{
				jQuery(this).parents('.listContainer'+j).append('<ol class="listCol'+i+'"></ol>');
			}
				jQuery('.listContainer'+j+' > ul,.listContainer'+j+' > ol').addClass(listClass);
		}
		
		var listItem = 0;
		var k = 1;
		var l = 0;	
		
		if(settings.direction == 'vertical'){ // -------- Append List Elements to the respective listCol  - Vertical -------------------------------
			
			jQuery(this).children('li').each(function(){
				listItem = listItem+1;
				if (listItem > baseColItems*(settings.colNumber-1) ){
					jQuery(this).parents('.listContainer'+j).find('.listCol'+settings.colNumber).append(this);
				} 
				else {
					if(listItem<=(baseColItems*k)){
						jQuery(this).parents('.listContainer'+j).find('.listCol'+k).append(this);
					} 
					else{
						jQuery(this).parents('.listContainer'+j).find('.listCol'+(k+1)).append(this);
						k = k+1;
					}
				}
			});
			
			jQuery('.listContainer'+j).find('ol,ul').each(function(){
				if(jQuery(this).children().size() == 0) {
				jQuery(this).remove();
				}
			});	
			
		} else{  // -------- Append List Elements to the respective listCol  - Horizontal ----------------------------------------------------------
			
			jQuery(this).children('li').each(function(){
				l = l+1;

				if(l <= settings.colNumber){
					jQuery(this).parents('.listContainer'+j).find('.listCol'+l).append(this);
					
				} else {
					l = 1;
					jQuery(this).parents('.listContainer'+j).find('.listCol'+l).append(this);
				}				
			});
		}
		
		jQuery('.listContainer'+j).find('ol:last,ul:last').addClass('last'); // Set class last on the last UL or OL	
		j = j+1;
		
	});
	};
})(jQuery);


(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	var mh = Math.ceil((ph-ah) / 2);
	$(this).css('margin-top', mh);
	});
};
})(jQuery);


/*
 * Image Centering
 * Copyright 2009 Drew Wilson
 * www.drewwilson.com
 *
 * Version 1.0   -   Updated: Oct. 10, 2009
 *
 * This Plug-In will center images inside of it's parent element.
 * By default it even scales each image up or down to fit inside it's parent element.
 * It will also wait to make sure each image is loaded before doing any re-sizing.
 *
 * This Image Centering jQuery plug-in is dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function($){$.fn.imgCenter=function(options){var defaults={parentSteps:0,scaleToFit:true,centerVertical:true,complete:function(){},start:function(){},end:function(){}};var opts=$.extend(defaults,options);opts.start.call(this);var len=this.length-1;return this.each(function(i){var current=i;var org_image=$(this);org_image.hide();var theParent=org_image;for(var i=0;i<=opts.parentSteps;i++){theParent=theParent.parent();}
var parWidth=parseInt(theParent.width());var parHeight=parseInt(theParent.height());var parAspect=parWidth/parHeight;if(org_image[0].complete){imgMath(org_image);}else{var loadWatch=setInterval(watch,500);}
function watch(){if(org_image[0].complete){clearInterval(loadWatch);imgMath(org_image);}}
function imgMath(org_image){var imgWidth=parseInt(org_image.width());var imgHeight=parseInt(org_image.height());var imgAspect=imgWidth/imgHeight;if(parWidth!=imgWidth||parHeight!=imgHeight){theParent.css("overflow","hidden");if(opts.scaleToFit){if(parAspect>=1){org_image.css({"width":parWidth+"px"});imgWidth=parWidth;imgHeight=Math.round(imgWidth/imgAspect);if((parWidth/imgAspect)<parHeight){org_image.css({"height":parHeight+"px","width":"auto"});imgHeight=parHeight;imgWidth=Math.round(imgHeight*imgAspect);}}else{org_image.css({"height":parHeight+"px"});imgHeight=parHeight;imgWidth=Math.round(imgHeight*imgAspect);if((parHeight*imgAspect)<parWidth){org_image.css({"width":parWidth+"px","height":"auto"});imgWidth=parWidth;imgHeight=Math.round(imgWidth/imgAspect);}}
if(imgWidth>parWidth){org_image.css({"margin-left":"-"+Math.round((imgWidth-parWidth)/2)+"px"});}
if(imgHeight>parHeight&&opts.centerVertical){org_image.css({"margin-top":"-"+Math.round((imgHeight-parHeight)/2)+"px"});}}else{if(imgWidth>parWidth){org_image.css({"margin-left":"-"+Math.round((imgWidth-parWidth)/2)+"px"});}else if(imgWidth<parWidth){org_image.css({"margin-left":Math.round((parWidth-imgWidth)/2)+"px"});}
if(imgHeight>parHeight&&opts.centerVertical){org_image.css({"margin-top":"-"+Math.round((imgHeight-parHeight)/2)+"px"});}else if(imgHeight<parHeight&&opts.centerVertical){org_image.css({"margin-top":Math.round((parHeight-imgHeight)/2)+"px"});}}
opts.complete.call(this);if(current==len){opts.end.call(this);}}
org_image.show();}});}})(jQuery);


/**
 * Equal Heights Plugin
 * Equalize the heights of elements. Great for columns or any elements
 * that need to be the same size (floats, etc).
 * 
 * Version 1.0
 * Updated 12/10/2008
 *
 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
 *
 * Usage: $(object).equalHeights([minHeight], [maxHeight]);
 * 
 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
 * than 300 pixels tall. Elements with too much content will gain a scrollbar.
 * 
 */

(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}
})(jQuery);


/*
 * flickrBomb v1
 * www.ZURB.com/playground
 * Copyright 2011, ZURB
 * Free to use under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
*/

var flickrbombAPIkey='66b5c17019403c96779e8fe88d5b576d',

/*  flickrbombLicenseTypes values (comma delimited)

	empty means all license types
	0: All Rights Reserved
	4: Attribution License http://creativecommons.org/licenses/by/2.0/
	6: Attribution-NoDerivs License http://creativecommons.org/licenses/by-nd/2.0/
	3: Attribution-NonCommercial-NoDerivs License http://creativecommons.org/licenses/by-nc-nd/2.0/
	2: Attribution-NonCommercial License http://creativecommons.org/licenses/by-nc/2.0/
	1: Attribution-NonCommercial-ShareAlike License http://creativecommons.org/licenses/by-nc-sa/2.0/
	5: Attribution-ShareAlike License http://creativecommons.org/licenses/by-sa/2.0/
	7: No known copyright restrictions http://www.flickr.com/commons/usage/
	8: United States Government Work http://www.usa.gov/copyright.shtml
	
	ex. flickrbombLicenseTypes = '5,7,8';
*/

flickrbombLicenseTypes='';

// Underscore.js
// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the terms of the MIT license.
// Portions of Underscore are inspired by or borrowed from Prototype.js,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore
(function(){
var j=this;var k=j._;var m=typeof StopIteration!=='undefined'?StopIteration:'__break__';var o=function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,'\\$1')};var p=Array.prototype,ObjProto=Object.prototype;var q=p.slice,unshift=p.unshift,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,propertyIsEnumerable=ObjProto.propertyIsEnumerable;var r=p.forEach,nativeMap=p.map,nativeReduce=p.reduce,nativeReduceRight=p.reduceRight,nativeFilter=p.filter,nativeEvery=p.every,nativeSome=p.some,nativeIndexOf=p.indexOf,nativeLastIndexOf=p.lastIndexOf,nativeIsArray=Array.isArray,nativeKeys=Object.keys;var _=function(a){return new v(a)};if(typeof exports!=='undefined')exports._=_;j._=_;_.VERSION='1.1.0';var t=_.forEach=function(a,b,c){try{if(r&&a.forEach===r){a.forEach(b,c)}else if(_.isNumber(a.length)){for(var i=0,l=a.length;i<l;i++)b.call(c,a[i],i,a)}else{for(var d in a){if(hasOwnProperty.call(a,d))b.call(c,a[d],d,a)}}}catch(e){if(e!=m)throw e;}return a};_.map=function(d,e,f){if(nativeMap&&d.map===nativeMap)return d.map(e,f);var g=[];t(d,function(a,b,c){g.push(e.call(f,a,b,c))});return g};_.reduce=function(d,e,f,g){if(nativeReduce&&d.reduce===nativeReduce){if(g)e=_.bind(e,g);return d.reduce(e,f)}t(d,function(a,b,c){f=e.call(g,f,a,b,c)});return f};_.reduceRight=function(a,b,c,d){if(nativeReduceRight&&a.reduceRight===nativeReduceRight){if(d)b=_.bind(b,d);return a.reduceRight(b,c)}var e=_.clone(_.toArray(a)).reverse();return _.reduce(e,b,c,d)};_.detect=function(d,e,f){var g;t(d,function(a,b,c){if(e.call(f,a,b,c)){g=a;_.breakLoop()}});return g};_.filter=function(d,e,f){if(nativeFilter&&d.filter===nativeFilter)return d.filter(e,f);var g=[];t(d,function(a,b,c){e.call(f,a,b,c)&&g.push(a)});return g};_.reject=function(d,e,f){var g=[];t(d,function(a,b,c){!e.call(f,a,b,c)&&g.push(a)});return g};_.every=function(d,e,f){e=e||_.identity;if(nativeEvery&&d.every===nativeEvery)return d.every(e,f);var g=true;t(d,function(a,b,c){if(!(g=g&&e.call(f,a,b,c)))_.breakLoop()});return g};_.some=function(d,e,f){e=e||_.identity;if(nativeSome&&d.some===nativeSome)return d.some(e,f);var g=false;t(d,function(a,b,c){if(g=e.call(f,a,b,c))_.breakLoop()});return g};_.include=function(b,c){if(nativeIndexOf&&b.indexOf===nativeIndexOf)return b.indexOf(c)!=-1;var d=false;t(b,function(a){if(d=a===c)_.breakLoop()});return d};_.invoke=function(b,c){var d=_.rest(arguments,2);return _.map(b,function(a){return(c?a[c]:a).apply(a,d)})};_.pluck=function(b,c){return _.map(b,function(a){return a[c]})};_.max=function(e,f,g){if(!f&&_.isArray(e))return Math.max.apply(Math,e);var h={computed:-Infinity};t(e,function(a,b,c){var d=f?f.call(g,a,b,c):a;d>=h.computed&&(h={value:a,computed:d})});return h.value};_.min=function(e,f,g){if(!f&&_.isArray(e))return Math.min.apply(Math,e);var h={computed:Infinity};t(e,function(a,b,c){var d=f?f.call(g,a,b,c):a;d<h.computed&&(h={value:a,computed:d})});return h.value};_.sortBy=function(e,f,g){return _.pluck(_.map(e,function(a,b,c){return{value:a,criteria:f.call(g,a,b,c)}}).sort(function(c,d){var a=c.criteria,b=d.criteria;return a<b?-1:a>b?1:0}),'value')};_.sortedIndex=function(a,b,c){c=c||_.identity;var d=0,high=a.length;while(d<high){var e=(d+high)>>1;c(a[e])<c(b)?d=e+1:high=e}return d};_.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(_.isArray(a))return a;if(_.isArguments(a))return q.call(a);return _.values(a)};_.size=function(a){return _.toArray(a).length};_.first=function(a,n,b){return n&&!b?q.call(a,0,n):a[0]};_.rest=function(a,b,c){return q.call(a,_.isUndefined(b)||c?1:b)};_.last=function(a){return a[a.length-1]};_.compact=function(b){return _.filter(b,function(a){return!!a})};_.flatten=function(c){return _.reduce(c,function(a,b){if(_.isArray(b))return a.concat(_.flatten(b));a.push(b);return a},[])};_.without=function(b){var c=_.rest(arguments);return _.filter(b,function(a){return!_.include(c,a)})};_.uniq=function(c,d){return _.reduce(c,function(a,b,i){if(0==i||(d===true?_.last(a)!=b:!_.include(a,b)))a.push(b);return a},[])};_.intersect=function(c){var d=_.rest(arguments);return _.filter(_.uniq(c),function(b){return _.every(d,function(a){return _.indexOf(a,b)>=0})})};_.zip=function(){var a=_.toArray(arguments);var b=_.max(_.pluck(a,'length'));var c=new Array(b);for(var i=0;i<b;i++)c[i]=_.pluck(a,String(i));return c};_.indexOf=function(a,b){if(nativeIndexOf&&a.indexOf===nativeIndexOf)return a.indexOf(b);for(var i=0,l=a.length;i<l;i++)if(a[i]===b)return i;return-1};_.lastIndexOf=function(a,b){if(nativeLastIndexOf&&a.lastIndexOf===nativeLastIndexOf)return a.lastIndexOf(b);var i=a.length;while(i--)if(a[i]===b)return i;return-1};_.range=function(b,c,d){var a=_.toArray(arguments);var e=a.length<=1;var b=e?0:a[0],c=e?a[0]:a[1],d=a[2]||1;var f=Math.ceil((c-b)/d);if(f<=0)return[];var g=new Array(f);for(var i=b,idx=0;true;i+=d){if((d>0?i-c:c-i)>=0)return g;g[idx++]=i}};_.bind=function(a,b){var c=_.rest(arguments,2);return function(){return a.apply(b||{},c.concat(_.toArray(arguments)))}};_.bindAll=function(a){var b=_.rest(arguments);if(b.length==0)b=_.functions(a);t(b,function(f){a[f]=_.bind(a[f],a)});return a};_.memoize=function(b,c){var d={};c=c||_.identity;return function(){var a=c.apply(this,arguments);return a in d?d[a]:(d[a]=b.apply(this,arguments))}};_.delay=function(a,b){var c=_.rest(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)};_.defer=function(a){return _.delay.apply(_,[a,1].concat(_.rest(arguments)))};_.wrap=function(b,c){return function(){var a=[b].concat(_.toArray(arguments));return c.apply(c,a)}};_.compose=function(){var b=_.toArray(arguments);return function(){var a=_.toArray(arguments);for(var i=b.length-1;i>=0;i--){a=[b[i].apply(this,a)]}return a[0]}};_.keys=nativeKeys||function(a){if(_.isArray(a))return _.range(0,a.length);var b=[];for(var c in a)if(hasOwnProperty.call(a,c))b.push(c);return b};_.values=function(a){return _.map(a,_.identity)};_.functions=function(b){return _.filter(_.keys(b),function(a){return _.isFunction(b[a])}).sort()};_.extend=function(c){t(_.rest(arguments),function(a){for(var b in a)c[b]=a[b]});return c};_.clone=function(a){if(_.isArray(a))return a.slice(0);return _.extend({},a)};_.tap=function(a,b){b(a);return a};_.isEqual=function(a,b){if(a===b)return true;var c=typeof(a),btype=typeof(b);if(c!=btype)return false;if(a==b)return true;if((!a&&b)||(a&&!b))return false;if(a.isEqual)return a.isEqual(b);if(_.isDate(a)&&_.isDate(b))return a.getTime()===b.getTime();if(_.isNaN(a)&&_.isNaN(b))return false;if(_.isRegExp(a)&&_.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=='object')return false;if(a.length&&(a.length!==b.length))return false;var d=_.keys(a),bKeys=_.keys(b);if(d.length!=bKeys.length)return false;for(var e in a)if(!(e in b)||!_.isEqual(a[e],b[e]))return false;return true};_.isEmpty=function(a){if(_.isArray(a)||_.isString(a))return a.length===0;for(var b in a)if(hasOwnProperty.call(a,b))return false;return true};_.isElement=function(a){return!!(a&&a.nodeType==1)};_.isArray=nativeIsArray||function(a){return!!(a&&a.concat&&a.unshift&&!a.callee)};_.isArguments=function(a){return a&&a.callee};_.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};_.isString=function(a){return!!(a===''||(a&&a.charCodeAt&&a.substr))};_.isNumber=function(a){return(a===+a)||(toString.call(a)==='[object Number]')};_.isBoolean=function(a){return a===true||a===false};_.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};_.isRegExp=function(a){return!!(a&&a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};_.isNaN=function(a){return _.isNumber(a)&&isNaN(a)};_.isNull=function(a){return a===null};_.isUndefined=function(a){return typeof a=='undefined'};_.noConflict=function(){j._=k;return this};_.identity=function(a){return a};_.times=function(n,a,b){for(var i=0;i<n;i++)a.call(b,i)};_.breakLoop=function(){throw m;};_.mixin=function(b){t(_.functions(b),function(a){x(a,_[a]=b[a])})};var u=0;_.uniqueId=function(a){var b=u++;return a?a+b:b};_.templateSettings={start:'<%',end:'%>',interpolate:/<%=(.+?)%>/g};_.template=function(a,b){var c=_.templateSettings;var d=new RegExp("'(?=[^"+c.end.substr(0,1)+"]*"+o(c.end)+")","g");var e=new Function('obj','var p=[],print=function(){p.push.apply(p,arguments);};'+'with(obj||{}){p.push(\''+a.replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/\t/g,'\\t').replace(d,"âœ„").split("'").join("\\'").split("âœ„").join("'").replace(c.interpolate,"',$1,'").split(c.start).join("');").split(c.end).join("p.push('")+"');}return p.join('');");return b?e(b):e};_.each=_.forEach;_.foldl=_.inject=_.reduce;_.foldr=_.reduceRight;_.select=_.filter;_.all=_.every;_.any=_.some;_.contains=_.include;_.head=_.first;_.tail=_.rest;_.methods=_.functions;var v=function(a){this._wrapped=a};var w=function(a,b){return b?_(a).chain():a};var x=function(b,c){v.prototype[b]=function(){var a=_.toArray(arguments);unshift.call(a,this._wrapped);return w(c.apply(_,a),this._chain)}};_.mixin(_);t(['pop','push','reverse','shift','sort','splice','unshift'],function(a){var b=p[a];v.prototype[a]=function(){b.apply(this._wrapped,arguments);return w(this._wrapped,this._chain)}});t(['concat','join','slice'],function(a){var b=p[a];v.prototype[a]=function(){return w(b.apply(this._wrapped,arguments),this._chain)}});v.prototype.chain=function(){this._chain=true;return this};v.prototype.value=function(){return this._wrapped}})();
//     Backbone.js 0.3.0
//     (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:
//     http://documentcloud.github.com/backbone
(function(){var j;if(typeof exports!=='undefined'){j=exports}else{j=this.Backbone={}}j.VERSION='0.3.0';var _=this._;if(!_&&(typeof require!=='undefined'))_=require("underscore")._;var $=this.jQuery;j.emulateHTTP=false;j.emulateJSON=false;j.Events={bind:function(a,b){var c=this._callbacks||(this._callbacks={});var d=this._callbacks[a]||(this._callbacks[a]=[]);d.push(b);return this},unbind:function(a,b){var c;if(!a){this._callbacks={}}else if(c=this._callbacks){if(!b){c[a]=[]}else{var d=c[a];if(!d)return this;for(var i=0,l=d.length;i<l;i++){if(b===d[i]){d.splice(i,1);break}}}}return this},trigger:function(a){var b,calls,i,l;if(!(calls=this._callbacks))return this;if(b=calls[a]){for(i=0,l=b.length;i<l;i++){b[i].apply(this,Array.prototype.slice.call(arguments,1))}}if(b=calls['all']){for(i=0,l=b.length;i<l;i++){b[i].apply(this,arguments)}}return this}};j.Model=function(a,b){this.attributes={};this.cid=_.uniqueId('c');this.set(a||{},{silent:true});this._previousAttributes=_.clone(this.attributes);if(b&&b.collection)this.collection=b.collection;if(this.initialize)this.initialize(a,b)};_.extend(j.Model.prototype,j.Events,{_previousAttributes:null,_changed:false,toJSON:function(){return _.clone(this.attributes)},get:function(a){return this.attributes[a]},set:function(a,b){b||(b={});if(!a)return this;if(a.attributes)a=a.attributes;var c=this.attributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return false;if('id'in a)this.id=a.id;for(var d in a){var e=a[d];if(!_.isEqual(c[d],e)){c[d]=e;if(!b.silent){this._changed=true;this.trigger('change:'+d,this,e)}}}if(!b.silent&&this._changed)this.change();return this},unset:function(a,b){b||(b={});var c=this.attributes[a];var d={};d[a]=void 0;if(!b.silent&&this.validate&&!this._performValidation(d,b))return false;delete this.attributes[a];if(!b.silent){this._changed=true;this.trigger('change:'+a,this);this.change()}return this},clear:function(a){a||(a={});var b=this.attributes;var c={};for(attr in b)c[attr]=void 0;if(!a.silent&&this.validate&&!this._performValidation(c,a))return false;this.attributes={};if(!a.silent){this._changed=true;for(attr in b){this.trigger('change:'+attr,this)}this.change()}return this},fetch:function(b){b||(b={});var c=this;var d=function(a){if(!c.set(c.parse(a),b))return false;if(b.success)b.success(c,a)};var e=b.error&&_.bind(b.error,null,c);j.sync('read',this,d,e);return this},save:function(b,c){b||(b={});c||(c={});if(!this.set(b,c))return false;var d=this;var e=function(a){if(!d.set(d.parse(a),c))return false;if(c.success)c.success(d,a)};var f=c.error&&_.bind(c.error,null,d);var g=this.isNew()?'create':'update';j.sync(g,this,e,f);return this},destroy:function(b){b||(b={});var c=this;var d=function(a){if(c.collection)c.collection.remove(c);if(b.success)b.success(c,a)};var e=b.error&&_.bind(b.error,null,c);j.sync('delete',this,d,e);return this},url:function(){var a=v(this.collection);if(this.isNew())return a;return a+'/'+this.id},parse:function(a){return a},clone:function(){return new this.constructor(this)},isNew:function(){return!this.id},change:function(){this.trigger('change',this);this._previousAttributes=_.clone(this.attributes);this._changed=false},hasChanged:function(a){if(a)return this._previousAttributes[a]!=this.attributes[a];return this._changed},changedAttributes:function(a){a||(a=this.attributes);var b=this._previousAttributes;var c=false;for(var d in a){if(!_.isEqual(b[d],a[d])){c=c||{};c[d]=a[d]}}return c},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return _.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);if(c){if(b.error){b.error(this,c)}else{this.trigger('error',this,c)}return false}return true}});j.Collection=function(a,b){b||(b={});if(b.comparator){this.comparator=b.comparator;delete b.comparator}this._boundOnModelEvent=_.bind(this._onModelEvent,this);this._reset();if(a)this.refresh(a,{silent:true});if(this.initialize)this.initialize(a,b)};_.extend(j.Collection.prototype,j.Events,{model:j.Model,toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(_.isArray(a)){for(var i=0,l=a.length;i<l;i++){this._add(a[i],b)}}else{this._add(a,b)}return this},remove:function(a,b){if(_.isArray(a)){for(var i=0,l=a.length;i<l;i++){this._remove(a[i],b)}}else{this._remove(a,b)}return this},get:function(a){return a&&this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw new Error('Cannot sort a set without a comparator');this.models=this.sortBy(this.comparator);if(!a.silent)this.trigger('refresh',this);return this},pluck:function(b){return _.map(this.models,function(a){return a.get(b)})},refresh:function(a,b){a||(a=[]);b||(b={});this._reset();this.add(a,{silent:true});if(!b.silent)this.trigger('refresh',this);return this},fetch:function(b){b||(b={});var c=this;var d=function(a){c.refresh(c.parse(a));if(b.success)b.success(c,a)};var e=b.error&&_.bind(b.error,null,c);j.sync('read',this,d,e);return this},create:function(c,d){var e=this;d||(d={});if(!(c instanceof j.Model)){c=new this.model(c,{collection:e})}else{c.collection=e}var f=function(a,b){e.add(a);if(d.success)d.success(a,b)};return c.save(null,{success:f,error:d.error})},parse:function(a){return a},chain:function(){return _(this.models).chain()},_reset:function(a){this.length=0;this.models=[];this._byId={};this._byCid={}},_add:function(a,b){b||(b={});if(!(a instanceof j.Model)){a=new this.model(a,{collection:this})}var c=this.getByCid(a);if(c)throw new Error(["Can't add the same model to a set twice",c.id]);this._byId[a.id]=a;this._byCid[a.cid]=a;a.collection=this;var d=this.comparator?this.sortedIndex(a,this.comparator):this.length;this.models.splice(d,0,a);a.bind('all',this._boundOnModelEvent);this.length++;if(!b.silent)this.trigger('add',a);return a},_remove:function(a,b){b||(b={});a=this.getByCid(a);if(!a)return null;delete this._byId[a.id];delete this._byCid[a.cid];delete a.collection;this.models.splice(this.indexOf(a),1);a.unbind('all',this._boundOnModelEvent);this.length--;if(!b.silent)this.trigger('remove',a);return a},_onModelEvent:function(a,b){if(a==='change:id'){delete this._byId[b.previous('id')];this._byId[b.id]=b}this.trigger.apply(this,arguments)}});var k=['forEach','each','map','reduce','reduceRight','find','detect','filter','select','reject','every','all','some','any','include','invoke','max','min','sortBy','sortedIndex','toArray','size','first','rest','last','without','indexOf','lastIndexOf','isEmpty'];_.each(k,function(a){j.Collection.prototype[a]=function(){return _[a].apply(_,[this.models].concat(_.toArray(arguments)))}});j.Controller=function(a){a||(a={});if(a.routes)this.routes=a.routes;this._bindRoutes();if(this.initialize)this.initialize(a)};var m=/:([\w\d]+)/g;var n=/\*([\w\d]+)/g;_.extend(j.Controller.prototype,j.Events,{route:function(c,d,e){j.history||(j.history=new j.History);if(!_.isRegExp(c))c=this._routeToRegExp(c);j.history.route(c,_.bind(function(a){var b=this._extractParameters(c,a);e.apply(this,b);this.trigger.apply(this,['route:'+d].concat(b))},this))},saveLocation:function(a){j.history.saveLocation(a)},_bindRoutes:function(){if(!this.routes)return;for(var a in this.routes){var b=this.routes[a];this.route(a,b,this[b])}},_routeToRegExp:function(a){a=a.replace(m,"([^\/]*)").replace(n,"(.*?)");return new RegExp('^'+a+'$')},_extractParameters:function(a,b){return a.exec(b).slice(1)}});j.History=function(){this.handlers=[];this.fragment=this.getFragment();_.bindAll(this,'checkUrl')};var o=/^#*/;_.extend(j.History.prototype,{interval:50,getFragment:function(a){return(a||window.location).hash.replace(o,'')},start:function(){var a=document.documentMode;var b=($.browser.msie&&a<7);if(b){this.iframe=$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow}if('onhashchange'in window&&!b){$(window).bind('hashchange',this.checkUrl)}else{setInterval(this.checkUrl,this.interval)}return this.loadUrl()},route:function(a,b){this.handlers.push({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();if(a==this.fragment&&this.iframe){a=this.getFragment(this.iframe.location)}if(!a||a==this.fragment||a==decodeURIComponent(this.fragment))return false;if(this.iframe){window.location.hash=this.iframe.location.hash=a}this.loadUrl()},loadUrl:function(){var b=this.fragment=this.getFragment();var c=_.any(this.handlers,function(a){if(a.route.test(b)){a.callback(b);return true}});return c},saveLocation:function(a){a=(a||'').replace(o,'');if(this.fragment==a)return;window.location.hash=this.fragment=a;if(this.iframe&&(a!=this.getFragment(this.iframe.location))){this.iframe.document.open().close();this.iframe.location.hash=a}}});j.View=function(a){this._configure(a||{});this._ensureElement();this.delegateEvents();if(this.initialize)this.initialize(a)};var p=function(a){return $(a,this.el)};var q=/^(\w+)\s*(.*)$/;_.extend(j.View.prototype,j.Events,{tagName:'div',$:p,jQuery:p,render:function(){return this},make:function(a,b,c){var d=document.createElement(a);if(b)$(d).attr(b);if(c)$(d).html(c);return d},delegateEvents:function(a){if(!(a||(a=this.events)))return;$(this.el).unbind();for(var b in a){var c=a[b];var d=b.match(q);var e=d[1],selector=d[2];var f=_.bind(this[c],this);if(selector===''){$(this.el).bind(e,f)}else{$(this.el).delegate(selector,e,f)}}},_configure:function(a){if(this.options)a=_.extend({},this.options,a);if(a.model)this.model=a.model;if(a.collection)this.collection=a.collection;if(a.el)this.el=a.el;if(a.id)this.id=a.id;if(a.className)this.className=a.className;if(a.tagName)this.tagName=a.tagName;this.options=a},_ensureElement:function(){if(this.el)return;var a={};if(this.id)a.id=this.id;if(this.className)a.className=this.className;this.el=this.make(this.tagName,a)}});var r=function(a,b){var c=u(this,a,b);c.extend=r;return c};j.Model.extend=j.Collection.extend=j.Controller.extend=j.View.extend=r;var s={'create':'POST','update':'PUT','delete':'DELETE','read':'GET'};j.sync=function(b,c,d,e){var f=b==='create'||b==='update';var g=s[b];var h=JSON.stringify(c.toJSON());var i={url:v(c),type:g,contentType:'application/json',data:f?h:null,dataType:'json',processData:false,success:d,error:e};if(j.emulateJSON){i.contentType='application/x-www-form-urlencoded';i.processData=true;i.data=f?{model:h}:{}}if(j.emulateHTTP){if(g==='PUT'||g==='DELETE'){if(j.emulateJSON)i.data._method=g;i.type='POST';i.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",g)}}}$.ajax(i)};var t=function(){};var u=function(a,b,c){var d;if(b&&b.hasOwnProperty('constructor')){d=b.constructor}else{d=function(){return a.apply(this,arguments)}}t.prototype=a.prototype;d.prototype=new t();if(b)_.extend(d.prototype,b);if(c)_.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d};var v=function(a){if(!(a&&a.url))throw new Error("A 'url' property or function must be specified");return _.isFunction(a.url)?a.url():a.url}})();
//Backbone.js Local Storage
function supports_local_storage(){try{return'localStorage'in window&&window['localStorage']!==null}catch(e){return false}}if(supports_local_storage()){function S4(){return(((1+Math.random())*0x10000)|0).toString(16).substring(1)};function guid(){return(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4())};var Store=function(a){this.name=a;var b=localStorage.getItem(this.name);this.data=(b&&JSON.parse(b))||{}};_.extend(Store.prototype,{save:function(){localStorage.setItem(this.name,JSON.stringify(this.data))},create:function(a){if(!a.id)a.id=a.attributes.id=guid();this.data[a.id]=a;this.save();return a},update:function(a){this.data[a.id]=a;this.save();return a},find:function(a){return this.data[a.id]},findAll:function(){return _.values(this.data)},destroy:function(a){delete this.data[a.id];this.save();return a}});Backbone.sync=function(a,b,c,d){var e;var f=b.localStorage||b.collection.localStorage;switch(a){case"read":e=b.id?f.find(b):f.findAll();break;case"create":e=f.create(b);break;case"update":e=f.update(b);break;case"delete":e=f.destroy(b);break}if(e){c(e)}else{}}}else{Backbone.sync=$.noop}
//FlickrBomb by ZURB 2011; http://www.zurb.com/playground
(function($){var localStorage=(supports_local_storage())?new Store("flickrBombImages"):null,FlickrImage=Backbone.Model.extend({fullsize_url:function(){return this.image_url('medium')},thumb_url:function(){return this.image_url('square')},image_url:function(size){var size_code;switch(size){case'square':size_code='_s';break;case'medium':size_code='_z';break;case'large':size_code='_b';break;default:size_code=''}return"http://farm"+this.get('farm')+".static.flickr.com/"+this.get('server')+"/"+this.get('id')+"_"+this.get('secret')+size_code+".jpg"}}),Image=Backbone.Model.extend({localStorage:localStorage,initialize:function(){_.bindAll(this,'loadFirstImage');this.flickrImages=new FlickrImages();this.flickrImages.fetch(this.get('keywords'),this.loadFirstImage);this.set({id:this.get("id")||this.get('keywords')});this.bind('change:src',this.changeSrc)},changeSrc:function(){this.save()},loadFirstImage:function(){if(this.get('src')===undefined){this.set({src:this.flickrImages.first().image_url()})}}}),FlickrImages=Backbone.Collection.extend({model:FlickrImage,key:flickrbombAPIkey,page:1,fetch:function(keywords,success){var self=this;success=success||$.noop;this.keywords=keywords||this.keywords;$.ajax({url:'http://api.flickr.com/services/rest/',data:{api_key:self.key,format:'json',method:'flickr.photos.search',tags:this.keywords,per_page:9,page:this.page,license:flickrbombLicenseTypes},dataType:'jsonp',jsonp:'jsoncallback',success:function(response){self.add(response.photos.photo);success()}})},nextPage:function(callback){this.page+=1;this.remove(this.models);this.fetch(null,callback)},prevPage:function(callback){if(this.page>1){this.page-=1}this.remove(this.models);this.fetch(null,callback)}}),FlickrImageView=Backbone.View.extend({tagName:'a',template:_.template('<img src="<%= thumb_url() %>" />'),className:'photo',events:{"click":"setImageSrc"},render:function(){$(this.el).html(this.template(this.model));$(this.el).addClass('photo');return this},setImageSrc:function(event){this.options.image.set({'src':this.model.fullsize_url()})}}),ImageView=Backbone.View.extend({tagName:"div",className:"flickrbombContainer",lock:false,template:_.template('<div id="<%= this.image.id.replace(" ","") %>" class="flickrbombWrapper"><img class="flickrbomb" src="" /><a href="#" title="Setup" class="setupIcon"></a></div><div class="flickrbombFlyout"><div class="content"><a href="#" title="Previous Page" class="prev">&#9664;</a><a href="#" title="Next Page" class="next">&#9654;</a></div></div>'),initialize:function(options){_.bindAll(this,'addImage','updateSrc','setDimentions','updateDimentions');var keywords=options.img.attr('src').replace('flickr://','');this.$el=$(this.el);this.ratio=this.options.img.attr('data-ratio');this.image=new Image({keywords:keywords,id:options.img.attr('id')});this.image.flickrImages.bind('add',this.addImage);this.image.bind('change:src',this.updateSrc)},events:{"click .setupIcon":"clickSetup","click .flickrbombFlyout a.photo":"selectImage","click .flickrbombFlyout a.next":"nextFlickrPhotos","click .flickrbombFlyout a.prev":"prevFlickrPhotos"},render:function(){$(this.el).html(this.template());this.image.fetch();if(!this.ratio){this.resize()}else{this.$('.flickrbombWrapper').append('<img style="width: 100%;" class="placeholder" src="http://placehold.it/'+this.ratio+'" />')}return this},updateSrc:function(model,src){var self=this;this.$('img.flickrbomb').css({top:'auto',left:'auto',width:'auto',height:'auto'}).attr('src','').bind('load',self.setDimentions).attr('src',src)},setDimentions:function(event){this.image.set({width:this.$('img').width(),height:this.$('img').height()});this.updateDimentions(this.image);$(event.target).unbind('load')},updateDimentions:function(){var image=this.$('img.flickrbomb'),flickrWidth=this.image.get('width'),flickrHeight=this.image.get('height'),flickrAspectRatio=flickrWidth/flickrHeight,clientWidth=this.$('div.flickrbombWrapper').width(),clientHeight=this.$('div.flickrbombWrapper').height(),clientAspectRatio=clientWidth/clientHeight;if(flickrAspectRatio<clientAspectRatio){image.css({width:'100%',height:null});image.css({top:((clientHeight-image.height())/2)+'px',left:null})}else{image.css({height:'100%',width:null});image.css({left:((clientWidth-image.width())/2)+'px',top:null})}},addImage:function(image){this.flickrImageView=new FlickrImageView({model:image,image:this.image});this.$('.flickrbombFlyout').append(this.flickrImageView.render().el)},clickSetup:function(event){event.preventDefault();this.toggleFlyout()},toggleFlyout:function(event){this.$('.flickrbombFlyout').toggle()},selectImage:function(event){event.preventDefault();this.toggleFlyout()},nextFlickrPhotos:function(event){event.preventDefault();var self=this;if(!this.lock){this.lock=true;this.$('.flickrbombFlyout').find('a.photo').remove();this.image.flickrImages.nextPage(function(){self.lock=false})}},prevFlickrPhotos:function(event){event.preventDefault();var self=this;if(!this.lock){this.lock=true;this.$('.flickrbombFlyout').find('a.photo').remove();this.image.flickrImages.prevPage(function(){self.lock=false})}},resize:function(){this.$('div.flickrbombWrapper').css({width:this.width()+'px',height:this.height()+'px'})},width:function(){return parseInt(this.options.img.width())},height:function(){return parseInt(this.options.img.height())}});$("img[src^='flickr://']").each(function(){var img=$(this);var imageView=new ImageView({img:img});img.replaceWith(imageView.render().el)});$('body').click(function(event){if(!$(event.target).closest('.setupIcon').length&&!$(event.target).closest('.flickrbombFlyout').length){$('.flickrbombFlyout').hide()}})})(jQuery);

