<!--  Zero day attachs prevention Common version -->
<ControllerBehavior>
	<ModuleReplaced>
		<ExecuteNamedActionSet setName="ModuleLoadedActions" />
		<If condition="IfModuleHasBeenVisited">
		    <IfTrueActions>
				<If condition="IfTargetPageSpecified">
					<IfTrueActions>
						<GoToTargetPage />
					</IfTrueActions>
					<IfFalseActions>
						<GoToLastPageVisited/>
					</IfFalseActions>
				</If>
 		    </IfTrueActions>
		    <IfFalseActions>
				<GoToFirstPage/>
		    </IfFalseActions>
		</If>
	</ModuleReplaced>
	<ModuleLoaded>
		<ExecuteNamedActionSet setName="ModuleLoadedActions" />
		<If condition="IfModuleHasBeenVisited">
		    <IfTrueActions>
			<!-- If target page specified -->
				<If condition="IfTargetPageSpecified">
					<IfTrueActions>
						<GoToTargetPage />
					</IfTrueActions>
					<IfFalseActions>
						<GoToLastPageVisited/>
					</IfFalseActions>
				</If>				
 		    </IfTrueActions>
			<IfFalseActions>
				<GoToFirstPage/>
			</IfFalseActions>
		</If>
	</ModuleLoaded>
	<ModuleLoadedActions>
		<InitializeInterface/>
		<LoadBackground />
		<!--<LoadTopicBarMovie />-->
		<MarkModuleVisited />
		<HideShowText />
		<StoreParameters />
	</ModuleLoadedActions>
	<LaunchIntro />
	<PageStartPlaying>
		<If condition="IfKnowledgeCheckPage">
			<IfTrueActions>
				<ResetKnowledgeCheck/>
				<DisableAllControls />
			</IfTrueActions>
			<IfFalseActions>
			</IfFalseActions>
		</If>
		<CollapseTopicsMap />
		<UpdatePagePlaying />
		<CacheVisitedState />
        <LoadPageFunctions/>
		<SetPopupButtonsState buttonsEnabled="false" />
		<MarkPageVisited />
		<MarkModuleVisited />
		<StoreParameters />
    	<If condition="IfCurrentPageComplete">
		    <IfTrueActions>
				<SetButton button="Next" buttonEnabled="true" state="blink" />
		    </IfTrueActions>
		    <IfFalseActions>
		        <SetButton button="Next" buttonEnabled="true" state="on" />
		    </IfFalseActions>
		</If>
		<If condition="IfFirstPage">
			<IfTrueActions>
				<SetButton button="Previous" buttonEnabled="true" state="off" />
			</IfTrueActions>
			<IfFalseActions>
				<SetButton button="Previous" buttonEnabled="true" state="on" />
			</IfFalseActions>
		</If>
		<!-- Michael
		Disable the next button if it's the last page -->
		<If condition="IfLastPage">
			<IfTrueActions>
				<SetButton button="Next" buttonEnabled="false" state="off" />
			</IfTrueActions>
			<IfFalseActions>
			</IfFalseActions>
		</If>
	</PageStartPlaying>
	<EmbeddedVideoStartPlaying>
		<StopPagePlaying/>
	</EmbeddedVideoStartPlaying>
	<EmbeddedVideoFinishedPlaying>
		<ContinuePagePlaying/>
	</EmbeddedVideoFinishedPlaying>
	<ContinueButtonClicked>
		<GoToEndOfEmbeddedVideo/>
		<ContinuePagePlaying/>
	</ContinueButtonClicked>
	<NextButtonClicked>
		<SetButton button="Next" buttonEnabled="true" state="off" />
		
		<MarkPageComplete />
<!--		<StoreParameters />  -->
		<If condition="IfLastPage">
			<IfTrueActions>
				<If condition="IfAllModulePagesVisited">
					<IfTrueActions>
						<!--<SetLinkParameter name="CertificateAwarded" value="1" />-->
						<SetButton button="Next" buttonEnabled="false" state="off" />
					</IfTrueActions>
					<IfFalseActions>
						<GoToFirstPage />
					</IfFalseActions>
				</If>
			</IfTrueActions>
			<IfFalseActions>
				<GoToNextPage/>
			</IfFalseActions>
		</If>
	</NextButtonClicked>
	<PreviousButtonClicked>
		<If condition="IfFirstPage">
			<IfTrueActions>
<!--			<GoToMainMenu /> -->
			</IfTrueActions>
			<IfFalseActions>
				 <GoToPreviousPage/>
			</IfFalseActions>
		</If>
	</PreviousButtonClicked>
	<ExternalLinkClicked>
		<OpenExternalResource/>
	</ExternalLinkClicked>
	<CourseMapLinkClicked>
		<GoToCourseMapLink />
		<ResumeInterface/>
		<LoadTopicBarMovie />
	</CourseMapLinkClicked>
	<TopicButtonClicked>
		<GoToTopic />
	</TopicButtonClicked>
	<PauseButtonClicked>
		<PausePlayback/>
	</PauseButtonClicked>
	<ResumeButtonClicked_508>
		<ResumeTopLevel_508/>
	</ResumeButtonClicked_508>
	<PauseButtonClicked_508>
		<PauseTopLevel_508/>
	</PauseButtonClicked_508>
	<LinkClicked>
		<GoToLink />
	</LinkClicked>
<!-- Course Map -->
	<PageLinkClicked>
		<GoToPageLink />
	</PageLinkClicked>
	<PopupClicked>
		<HideTopicBar/>
	    <OpenPopupPage/>
		<MarkPopupVisited/>
	</PopupClicked>
	<PopupClosed>
		<ShowTopicBar/>
		<ClosePopupPage />
	</PopupClosed>
	<PopupStartPlaying>
		<UpdatePagePlaying />
		<CacheVisitedState />
		<LoadPageFunctions/>
<!-- REVIIST VERIFY THIS IS WHAT WE WANT -->
		<SetPopupButtonsState buttonsEnabled="true" />
		<MarkPopupVisited />
	</PopupStartPlaying>
	<PopupFinshedPlaying>
		<UpdatePageFinished />
		<RestoreVisitedState />
		<SetPopupButtonsState buttonsEnabled="true" />
		<MarkPopupComplete />
		<MakeCloseButtonBlink />
	</PopupFinshedPlaying>
	<PopupFinishedPlaying>
		<UpdatePageFinished />
		<RestoreVisitedState />
		<SetPopupButtonsState buttonsEnabled="true" />
		<MarkPopupComplete />
		<MakeCloseButtonBlink />
	</PopupFinishedPlaying>
	<GlossaryButtonClicked>
		<DisplayGlossary/>
		<SuspendInterface/>
	</GlossaryButtonClicked>
	<MainMenuButtonClicked>
		<GoToMainMenu />
		<SuspendInterface/>
	</MainMenuButtonClicked>
	<ReplayButtonClicked>
		<RestoreVisitedState />
		<ReplayPage/>
	</ReplayButtonClicked>
	<ResourcesButtonClicked>
		<DisplayResources/>
		<SuspendInterface/>
	</ResourcesButtonClicked>
	<TopicsButtonClicked>
		<DisplayTopics/>
		<SuspendInterface/>
	</TopicsButtonClicked>
	<CourseMapButtonClicked>
		<DisplayCourseMap />
		<SuspendInterface/>
	</CourseMapButtonClicked>
	<ExitButtonClicked>
		<ConfirmExit />
		<SuspendInterface />
	</ExitButtonClicked>
	<ExitConfirmationClicked>
		<StoreParameters />
		<PlayCredits />
		<UnloadSpecial2 resume="no" />
		<ExitSCO closeWindow="false"/>
	</ExitConfirmationClicked>
	<ExitCancelClicked>
		<CancelExit />
	</ExitCancelClicked>
	<IdleLimitExceeded>
		<DisplayIdleLimit/>
		<SuspendInterface/>
	</IdleLimitExceeded>
	<SpecialFeatureUnloaded>
		<UnloadSpecial />
		<ResumeInterface />
	</SpecialFeatureUnloaded>
	<PageFinishedPlaying>
		<UpdatePageFinished />
		<RestoreVisitedState />
		<SetPopupButtonsState buttonsEnabled="true" />
		<If condition="IfKnowledgeCheckPage">
			<IfTrueActions>
				<EnableAllControls />
			</IfTrueActions>
			<IfFalseActions>
				<If condition="IfAllPopupsVisited">
					<IfTrueActions>
						<If condition="IfPageTypeEquals" pageType="Normal">
							<IfTrueActions>
								<MarkPageComplete />
								<StoreParameters />
								<!-- Michael 
								Does nothing, if it's the last page. Otherwise, set its state to blink -->
								<If condition="IfLastPage">
									<IfTrueActions>
									</IfTrueActions>
									<IfFalseActions>
										<SetButton button="Next" buttonEnabled="true" state="blink" />
									</IfFalseActions>
								</If>
							</IfTrueActions>
							<IfFalseActions>
							</IfFalseActions>
						</If>
				 	</IfTrueActions>
					<IfFalseActions>
					</IfFalseActions>
				</If>
			</IfFalseActions>
		</If>
		<ExecuteNamedActionSet setName="PerformCertificateCheck" />
	</PageFinishedPlaying>
	<PrintComplete>
		<ResumeInterface/>
		<PrintClose/>
	</PrintComplete>
	<AllPopupVisited>
		<MarkPageComplete />
		<StoreParameters />
		<SetButton button="Next" buttonEnabled="true" state="blink" />
	</AllPopupVisited>
	<PageCompleted/>
	<EnteredSection/>
	<DepartedSection/>
	<SectionCompleted/>
	<ModuleStarted/>
	<EnteredModule/>
	<DepartedModule>
		<StoreProgress/>
	</DepartedModule>
<!-- This code pops up ther certificate upon course completion -->
	<ModuleComplete>
		<If condition="IfCourseIsComplete">
			<IfTrueActions>
				<SetSCOCompletionStatus complete="true" />
				<SetSCOSuccessStatus success="true" />

				<If condition="IfThisAUEquals" name="GuidedTour">
					<IfTrueActions>
					</IfTrueActions>
					<IfFalseActions>
						<If condition="IfLinkParameterEquals" name="CertificateAwarded" value="1">
							<IfTrueActions>
							</IfTrueActions>
							<IfFalseActions>
								<SetLinkParameter name="CertificateAwarded" value="1" />
								<!-- Michael
								Now, screen 8 is the certificate page, so we don't the following element -->
								<!--<PresentCertificate />-->
							</IfFalseActions>
						</If>
					</IfFalseActions>
				</If>
			</IfTrueActions>
			<IfFalseActions>
			</IfFalseActions>
		</If>
		<MarkModuleComplete />
		<StoreParameters />
	</ModuleComplete>
<!--
-->
	<IntroStarted>
		<LoadPageFunctions/>
		<SetLinkParameter name="IntroVisited" value="1" />
		<StoreParameters />
	</IntroStarted>
	<IntroFinished>
		<LoadTopicBarMovie />
		<GoToMainMenu/>
	</IntroFinished>
	<IdleLimitExceeded/>
	<ConnectionFault/>

    <ControlClicked>
      <If condition="IfKnowledgeCheckPage">
        <IfTrueActions>
          <CheckInputCompleteStatus />
        </IfTrueActions>
        <IfFalseActions> </IfFalseActions>
      </If>
    </ControlClicked>

    <!--  Knowledge Check Feedback related events -->
    <DoneButtonClicked>
      <EvaluateAndProvideFeedback />
      <!-- if only 1 question and no summary feedback then make forward blink -->
    </DoneButtonClicked>

    <PreviousFeedbackClicked>
      <FeedbackClosedWithPrevious />
    </PreviousFeedbackClicked>

<!--  NEW WAY:   -->
    <NextFeedbackClicked>
      <FeedbackClosedWithNext />
    </NextFeedbackClicked>

    <TryAgainClicked>
    	<FeedbackClosedWithTryAgain />
    </TryAgainClicked>

    <CloseFeedbackClicked>
      <FeedbackClosedWithDone />
      <SetButton button="Next" buttonEnabled="true" state="blink" />
      <SetPopupButtonsState buttonsEnabled="true" />
      <If condition="IfOnLastPageOfTopic">
          <IfTrueActions>
              <ExpandTopicsMap />
              <MarkPageComplete />
          </IfTrueActions>
          <IfFalseActions> </IfFalseActions>
      </If>
    </CloseFeedbackClicked>

    <ProvideSummaryFeedback />

    <UserEnteredText>
      <If condition="IfCurrentQuestionAnswered">
        <IfTrueActions>
          <GoToState name="doneButton_MC" state="on" btnEnabled="true" />
        </IfTrueActions>
        <IfFalseActions> </IfFalseActions>
      </If>
    </UserEnteredText>

    <PerformCertificateCheck>
<!--      <XMLDebug>Performing certificate check</XMLDebug> -->
      <If condition="IfAllModulePagesVisited">
        <IfTrueActions>
          <MarkModuleComplete />
          <ExecuteNamedActionSet setName="ModuleComplete" />
        </IfTrueActions>
        <IfFalseActions>
        </IfFalseActions>
      </If>
    </PerformCertificateCheck>

</ControllerBehavior>