Mission.tasks(0).extend ( {

	setup : function ( cb ) {
		Portal.loadPage ( this, 'whitesmoke/', function ( ) { cb(); } );
	},
	start : function ( cb ) {
		setStoppableTimeout ( this, function ( ) {
			loadScript ( '/scripts/chat/audio.js', function ( s ) {
				loadConversation ( '/scripts/gatecrashers/conversations/intro.js', function ( s ) {
					var ringing = new SoundStage.Sound ( '/audio/ringtone.mp3', { repeat : true, noSubtitles : true, autoPlay : true } );
					var stopRinging = function ( ) {
						$( '#hud-incoming-call' ).remove();
						if ( ringing.loaded() )
							ringing.stop()
						else
							ringing.onLoad ( function ( ) { this.stop(); } );
					}
					var timeout = setTimeout( function () {
						stopRinging();
						Mission.fail( 'You should have answered the phone' );
					}, 30000 );
					$( '#portal_top' ).append( '<div class="hud-box" id="hud-incoming-call"><div class="hud-box-wrapper"><div class="hud-box-inner"><div class="hud-box-content"><div class="hud-message"><button class="hud-button"><span><span>Answer call from Max</span></span></button></div></div></div></div></div>' );
					$( '#hud-incoming-call button' ).click( function () {
						clearTimeout( timeout );
						stopRinging();
						Portal.setHint ( "Listen to Max" );
						window.conversation = new Audio ( window.scripts.INTRO, true, function ( ) {
							if ( Fakebook.reported() ) doAction ( '218091' );
							cb();
						} );
					} );
				} );
			} );
		}, 500 );
	}

} );
