var Hero = new Class( {
	
	  hardpoint:	null
	, heroes:		new Array( )
	, cursor:		0
	, thread:		0
	, hold:			false
	, interval:		10000
	
	, isPaused:		function( ) { return this.hold; }
	
	, initialize:	function( hardpoint ) {
	 	this.hardpoint = $( hardpoint );
	 	if( !this.hardpoint ) {
	 		log( 'No hero found for hardpoint: `'+hardpoint+"'" );
	 	}
	  }
	
	, start:		function( ) {
		this.rotate( );
	  }
	
	, next:			function( ) {
		if( this.shouldSwap( ) ) {
			this.didBeginSwap( );
				if( this.hasHero( this.getNextCursor( ) ) ) {
					this.hardpoint.src = this.getNextHero( ).src;
				}
			this.didEndSwap( );
		}
		
		if( --this.thread == 0 ) {
			this.rotate( );
		}
	  }
	
	, rotate:		function( ) {
		this.thread++;
		var handle = this;
		setTimeout( function( ) { handle.next( ) }, this.interval );
	  }
	
	, pause:		function( ) {
		this.hold = true;
	  }
	
	, resume:		function( ) {
		this.hold = false;
		this.rotate( );
	  }
	
	, callOrder:	0
	, load:			function( uri ) {
		this.heroes[ this.callOrder ] = null;
		var img = new Image( );
		img.onload = bind(
			  this
			, function( which ) {
				this.heroes[ which ] = img;
			  }
			, this.callOrder
		);
		img.src = auri( uri );
		this.callOrder++;
	  }
	
	, addHero:		function( uri ) {
		this.load( uri );
	  }
	
	, hasHero:		function( which ) {
		return ( this.heroes[ which ] !== null );
	  }
	
	, getHero:		function( which ) {
		return this.heroes[ which ];
	  }
	
	, getCurrentHero: function( ) {
		return this.getHero( this.cursor );
	  }
	
	, getNextHero: function( ) {
		return this.getHero( this.getNextCursor( ) );
	  }
	
	, getNextCursor: function( ) {
		if( this.cursor == this.heroes.length - 1 ) {
			this.cursor = -1;
		}
		return this.cursor + 1;
	  }
	
	, shouldSwap:	function( ) {
		if( this.isPaused( ) ) {
			return false;
		}
		
		if( this.thread != 1 ) {
			return false;
		}
		
		return true;
	  }
	
	, didBeginSwap:	function( ) {
		
	  }
	
	, didEndSwap:	function( ) {
		this.cursor = this.getNextCursor( );
	  }
	
} );