iii.shareprice.apps.stockexplorer = new ( new Class( {
	Implements: Events,
	mode: 'ready',
	version: 0.12,
	initialize: function ( ) {
		var self = this;
		
		this.fireEvent( 'app-start' );
		
		window.addEvent( 'domready', function( ) {
			
			iii.shareprice.apps.com.stock.implement( {
				updateAll: function ( ) {
					var stocks = [];
					for( var k in this.data )
						if( this.data[k].data )
							stocks.include( this.data[k].data.descriptor.exchangecode );
				},
				include: function ( stock ) {
					if( !stock.id || !stock.id.contains(':') )
						stock.id = stock.exchangecode;
					for( var key in this.data ) {
						if( key == stock.id )
							return this.data[ key ].up( stock );
					}
					return new iii.shareprice.apps.com.stock( stock, this );
				}
			} );
			
			self.stocks = new iii.shareprice.apps.com.stock( );
			
			self.fixed = iii.shareprice.apps.fixed;
			
			self.com = iii.shareprice.apps.com;
		
			self.cookie = new iii.shareprice.apps.com.cookie( self );
		
			self.request = new iii.shareprice.apps.com.request( self );
			
			self.growl = new iii.shareprice.apps.com.growl( self );
			
			self.stock = new iii.shareprice.apps.stock( self );
			
			self.ly = new iii.shareprice.apps.ly( self );
			
			self.recent = new iii.shareprice.apps.com.recent( self );
		
			self.user = new iii.shareprice.apps.user( self );
			
			self.active = new iii.shareprice.apps.com.activeState( self );
			
			self.preloader = new iii.shareprice.apps.com.preloader( self );			
			self.stream = new iii.shareprice.apps.com.stream( self, {
				hostName: iii.shareprice.apps.config.get( 'host' ),
				hostDomain: iii.shareprice.apps.config.get( 'domain' ),
				port: iii.shareprice.apps.config.get( 'port' )
			} );
			
			self.ly.render();
			
			( function( ) {
				self.growl.add( '<iframe tabindex="-1" class="iframe-ad" width="100%" height="60" src="./ad.html"></iframe>', 0, 30 );
			} ).periodical( 300000 );
			self.growl.add( '<iframe tabindex="-1" class="iframe-ad" width="100%" height="60" src="./ad.html"></iframe>', 0, 30 );
		} );
	}
} ) );