Mission.tasks(0).extend ( {

	setup : function ( cb ) {
		Portal.loadPage ( this, 'ws-home/', null, function() { cb(); } );
	},

	start : function ( cb ) {
		setStoppableTimeout ( this, function ( ) {
			showStatusUpdate ( "One Year Ago" );
			loadConversation ( '/scripts/replay/conversations/task-0.js', function ( s ) {
				if ( !s || !(window.scripts||{}).TASK_0_0 || window.chatClient ) return;
				var chat = new Chat ( "" );
				chat.play ( window.scripts.TASK_0_0, function ( ) {
					setTimeout ( function ( ) {
						Portal.loadPage ( null, 'emometer/', function ( ) {
							var i = setInterval ( function ( ) {
								if ( !window.Emometer ) return;
								clearInterval ( i );
								var bg = null;
								SoundStage.whenReady ( function ( ) {
									bg = new SoundStage.Sound ( '/audio/replay/m12_bg2.mp3', {
										noSubtitles : true,
										autoPlay : true,
										id : "t0bg"
									} );
								} );
								Emometer.init ( {
									love : {
										target : { min : 0.7, max : 0.9 },
										bar : 0.1,
										click : 0.1,
										decay : 0.01
									},
									empathy : {
										target : { min : 0.3, max : 0.7 },
										bar : 0.1,
										click : 0.1,
										decay : 0.05
									},
									happiness : {
										target : { min : 0.5, max : 0.9 },
										bar : 0.1,
										click : 0.1,
										decay : 0.05
									},
									sadness : {
										target : { min : 0.3, max : 0.5 },
										bar : 0.1,
										click : 0.1,
										decay : 0.01
									},
									hatred : {
										target : { min : 0.3, max : 0.5 },
										bar : 0.1,
										click : 0.1,
										decay : 0.01
									}
								} );
								chat.close();
								Portal.alert ( $("#help").html(), function ( ) {
									setTimeout ( function ( ) {
										var timer = Timer.start ( 60, function ( t ) {
											if ( !t.remaining ) {
												Emometer.stop ( false );
												setTimeout( function() { Mission.fail( "Too slow" ); }, 2000 );
											}
										} );
										Emometer.start ( function ( ) {
											timer.stop();
											setTimeout ( function ( ) {
												if ( bg && bg.loaded() ) bg.stop();
												Portal.loadPage ( null, 'ws-billy/1/', function ( ) {
													loadScript ( '/scripts/chat/thoughts.js', function ( s ) {
														showStatusUpdate ( "One Day Later" );
														var t = new Thoughts ( window.scripts.TASK_0_1, true, cb );
													} );
												} );
											}, 2000 );
										} );
									}, 500 );
								}, true );
							}, 50 );
						} );
					}, 1000 );
				} );
			} );
		}, 500 );
	}

} );

