	
	var PhotoSet = new Class({

		Extends : Flicker.Set,

		initialize : function( container, userId, photoset, apiKey, options ) {

			this.parent( container, userId, photoset, apiKey, options );

			this.reload = new Element('p.reload').grab( new Element('a[href=#][text=Shuffle]') );

			// Attach events
			$(this).addEvent( 'click:relay(a)', this.expandImg );

			this.addEvent( 'complete', this.addReloadLink.bind( this ) );

			this.addEvent( 'request', this.removeReloadLink.bind( this ) );

			$(this).getParent().addEvent( 'click:relay(.reload a)', this.reloadImages.bind( this ) );

			this.getPhotos();

		},

		reloadImages : function( event ) {

			this.getPhotos();

			event.preventDefault();

		},

		expandImg : function( event ) {

			event.preventDefault();

			hs.expand( this );

		},

		addReloadLink : function() {

			$(this.reload).fade('hide').inject( $(this).getParent() ).fade('in');

			$(this).getParent().getElement('h1').removeClass('loading');	

		},

		removeReloadLink : function() {

			$(this.reload).destroy();

			$(this).getParent().getElement('h1').addClass('loading');

		}

	});

