

	var Pagination = new Class(function() {

		function clickEvent( event, that ) {

			that.loadPage( this.get('href') );

			event.preventDefault();

		};

		function injectResults( domTree, elements ) {

			var results = elements.filter( this.options.filter )[0];

			this.target.empty();
			this.target.grab( results );

		};

		return {

			Implements : Options,

			initialize : function( target, delegateElem, selector, options ) {

				var delegationSelector = 'click:relay({selector})'.substitute({ selector: selector });

				this.target = $( target );
				this.delegateElem = $( delegateElem ); // Element to attach event to

				this.request = new Request.HTML({

					evalScripts : false,

					onComplete : injectResults.bind( this )

				});

				this.delegateElem.addEvent( delegationSelector, clickEvent.bindEvent( this ) );

			},

			options : {

				filter : '#content div[role=main] > article'

			},

			loadPage : function( url ) {

				this.request.options.url = url;
				this.request.send();

			}

		}

	}());
	

