<?xml version="1.0" encoding="utf-8"?>

<ControllerBehavior>
    <SuspendInterface>
        <SuspendInterface/>
    </SuspendInterface>
    <SpeedBumpMarkPageComplete>
        <MarkPageComplete />
        <StoreParameters />
        <GoToNextPage/>
        <ExecuteNamedActionSet setName="SetNavButtons" />
    </SpeedBumpMarkPageComplete>
    <EnablePopups>
        <TestMessage TMessage="pop enabled" />
        <SetPageControlsState buttonsEnabled="true" />
    </EnablePopups>
    <SetNextButtonBlink>
        <XMLDebug>### SetNextButtonBlink ###</XMLDebug>
        <SetButton button="Next" buttonEnabled="true" state="blink" />
    </SetNextButtonBlink>
    <InterfaceNormal>
        <If condition="IfFirstPage">
            <IfTrueActions>
                <SetButton button="Previous" buttonEnabled="false" state="off" />
            </IfTrueActions>
            <IfFalseActions>
                <SetButton button="Previous" buttonEnabled="true" state="on" />
            </IfFalseActions>
        </If>
        <If condition="IfLastPage">
            <IfTrueActions>
                <SetButton button="Next" buttonEnabled="false" state="off" />

            </IfTrueActions>
            <IfFalseActions>
                <SetButton button="Next" buttonEnabled="true" state="on" />
            </IfFalseActions>
        </If>
    </InterfaceNormal>

    <ModuleReplaced>
		<ShowCC/>
        <ExecuteNamedActionSet setName="ModuleLoadedActions" />
        <If condition="IfModuleHasBeenVisited">
            <IfTrueActions>
                <If condition="IfTargetPageSpecified">
                    <IfTrueActions>
                        <GoToTargetPage />
                    </IfTrueActions>
                    <IfFalseActions>
                        <GoToLastPageVisited/>
                    </IfFalseActions>
                </If>
            </IfTrueActions>
            <IfFalseActions>
                <GoToFirstPage/>
            </IfFalseActions>
        </If>
    </ModuleReplaced>
    <ModuleLoaded>
		<ShowCC/>
        <If condition="IfCourseHasBeenVisited">
            <IfTrueActions>
                <GoToLastVisitedModuleAndPage />
            </IfTrueActions>
            <IfFalseActions>
                <ExecuteNamedActionSet setName="ModuleLoadedActions" />
                <GoToFirstPage/>
            </IfFalseActions>
        </If>
    </ModuleLoaded>
    <ModuleLoadedActions>
        <InitializeInterface/>
        <LoadBackground />
        <MarkModuleVisited />
        <StoreParameters />
        <UpdateShowText />

    </ModuleLoadedActions>
    <AudioDescriptionReady>
        <If condition="IfAudioDescriptionsEnabled">
            <IfTrueActions>
                <PlayAudioDescription/>
            </IfTrueActions>
            <IfFalseActions>
            </IfFalseActions>
        </If>
    </AudioDescriptionReady>
    <AudioDescriptionStart>
    </AudioDescriptionStart>
    <AudioDescriptionFinish>
        <StopAudioDescription/>
    </AudioDescriptionFinish>
    <PageStartPlaying>

        <If condition="IfKnowledgeCheckPage">
            <IfTrueActions>
                <XMLDebug>### IsKnowledgeCheckPage ###</XMLDebug>
                <ResetKnowledgeCheck/>
                <DisableAllControls />
            </IfTrueActions>
            <IfFalseActions>
            </IfFalseActions>
        </If>
        <CollapseTopicsMap />
        <CacheVisitedState />
        <LoadPageFunctions/>
        <SetPageControlsState buttonsEnabled="false" />
        <MarkPageVisited />
        <MarkPageComplete />
        <MarkModuleVisited />
        <StoreParameters />
        <!--<SetProgressStatus />-->
        <ExecuteNamedActionSet setName="SetNextButton" />
        <If condition="IfFirstPage">
            <IfTrueActions>
                <SetButton button="Previous" buttonEnabled="false" state="off" />
            </IfTrueActions>
            <IfFalseActions>
                <SetButton button="Previous" buttonEnabled="true" state="on" />
            </IfFalseActions>
        </If>
    </PageStartPlaying>
    <SetNextButton>
        <If condition="IfLastPageOfLastModule">
            <IfTrueActions>
                <SetButton button="Next" buttonEnabled="false" state="off" />

            </IfTrueActions>
            <IfFalseActions>
                <If condition="IfCurrentPageComplete">
                    <IfTrueActions>
                        <!--TestMessage TMessage="IfCurrentPageComplete: true" /-->
                        <ExecuteNamedActionSet setName="SetNextButtonBlink" />
                    </IfTrueActions>
                    <IfFalseActions>
                        <!--TestMessage TMessage="IfCurrentPageComplete: false" /-->
                        <SetButton button="Next" buttonEnabled="true" state="on" />
                    </IfFalseActions>
                </If>
            </IfFalseActions>
        </If>
    </SetNextButton>
    <EmbeddedVideoStartPlaying>
        <StopPagePlaying/>
    </EmbeddedVideoStartPlaying>
    <EmbeddedVideoFinishedPlaying>
        <ContinuePagePlaying/>
    </EmbeddedVideoFinishedPlaying>
    <ContinueButtonClicked>
        <GoToEndOfEmbeddedVideo/>
        <ContinuePagePlaying/>
    </ContinueButtonClicked>
    <ShowTextButtonClicked>
        <TurnShowTextOn />
    </ShowTextButtonClicked>
    <HideTextButtonClicked>
        <TurnShowTextOff />
        <ResetFocus />
    </HideTextButtonClicked>
    <NextButtonClicked>
        <XMLDebug>### NextButtonClicked ###</XMLDebug>
        <SetButton button="Next" buttonEnabled="true" state="on" />
        <MarkPageComplete />
        <StoreParameters />
        <If condition="IfLastPage">
            <IfTrueActions>
                <If condition="IfLinkParameterEquals" name="CertificateAwarded" value="1">
                    <IfTrueActions><XMLDebug>### Certificate Has been awarded ###</XMLDebug></IfTrueActions>
                    <IfFalseActions>
						<XMLDebug>### certificate not awarded ###</XMLDebug>
                        <!--ExecuteNamedActionSet setName="MainMenuButtonClicked" /-->
                    </IfFalseActions>
                </If>
            </IfTrueActions>
            <IfFalseActions>
                <If condition="IfFirstPage">
                    <IfTrueActions>
                        <MarkPageComplete />
                        <StoreParameters />
                        <GoToNextPage/>
                    </IfTrueActions>
                    <IfFalseActions>
                        <If condition="IfAllPopupsVisitedRecursive" recursionLimit="1">
                            <IfTrueActions>
                                <MarkPageComplete />
                                <StoreParameters />
                                <GoToNextPage/>
                            </IfTrueActions>
                            <IfFalseActions>
                                <If condition="IfKnowledgeCheckPage">
                                    <IfTrueActions>
                                        <XMLDebug>### IsKnowledgeCheckPage ###</XMLDebug>
                                        <MarkPageComplete />
                                        <StoreParameters />
                                        <GoToNextPage/>
                                    </IfTrueActions>
                                    <IfFalseActions>
                                        <LoadSpeedbump/>
                                        <SuspendInterface />
                                    </IfFalseActions>
                                </If>
                            </IfFalseActions>
                        </If>
                    </IfFalseActions>
                </If>
            </IfFalseActions>
        </If>
    </NextButtonClicked>
    <PreviousButtonClicked>
        <If condition="IfFirstPage">
            <IfTrueActions>
                <XMLDebug>Prev button clicked on first page, calling GoToMainMenu</XMLDebug>
                <!--GoToMainMenu /-->
            </IfTrueActions>
            <IfFalseActions>
                <GoToPreviousPage/>
            </IfFalseActions>
        </If>
    </PreviousButtonClicked>
    <ExternalLinkClicked>
        <OpenExternalResource/>
    </ExternalLinkClicked>
    <CourseMapLinkClicked>
        <GoToCourseMapLink />
    </CourseMapLinkClicked>
    <PauseButtonClicked>
        <PausePlayback/>
        <!--DisplayPause/-->
        <!--SuspendInterface/-->
    </PauseButtonClicked>
    <ResumeButtonClicked>
        <ResumeInterface/>
    </ResumeButtonClicked>
    <LinkClicked>
        <GoToLink />
    </LinkClicked>
    <!-- Course Map -->
    <PageLinkClicked>
        <GoToPageLink />
    </PageLinkClicked>
    <PopupClicked>
        <OpenPopupPage/>
        <MarkPopupVisited/>
    </PopupClicked>
    <PopupClosed>
        <ClosePopupPage />
    </PopupClosed>
    <PopupStartPlaying>
        <CacheVisitedState />
        <LoadPageFunctions/>
        <SetPageControlsState buttonsEnabled="false" />
        <MarkPopupVisited />
    </PopupStartPlaying>
    <PopupFinishedPlaying>
        <UpdatePageFinished />
        <RestoreVisitedState />
        <SetPageControlsState buttonsEnabled="true" />
        <MarkPopupComplete />
        <MakeCloseButtonBlink />
    </PopupFinishedPlaying>
    <HideCCButtonClicked>
        <HideCC/>
    </HideCCButtonClicked>
    <ShowCCButtonClicked>
        <ShowCC/>
    </ShowCCButtonClicked>
    <AudioDescriptionsOffButtonClicked>
        <TurnAudioDescriptionsOff/>
    </AudioDescriptionsOffButtonClicked>
    <AudioDescriptionsOnButtonClicked>
        <TurnAudioDescriptionsOn/>
    </AudioDescriptionsOnButtonClicked>
    <UserSettingsButtonClicked>
        <LoadUserSettings/>
    </UserSettingsButtonClicked>
    <SkipReverseButtonClicked>
        <SkipReverse frames="30"/>
    </SkipReverseButtonClicked>
    <SkipForwardButtonClicked>
        <SkipForward frames="30"/>
    </SkipForwardButtonClicked>
    <SkipToEndButtonClicked>
        <GoToEndScreen/>
    </SkipToEndButtonClicked>
    <TranscriptButtonClicked>
        <DisplayTranscript/>
        <SuspendInterface/>
    </TranscriptButtonClicked>
    <HelpButtonClicked>
        <DisplayHelp/>
        <SuspendInterface/>
    </HelpButtonClicked>
    <GlossaryButtonClicked>
        <DisplayGlossary/>
        <SuspendInterface/>
    </GlossaryButtonClicked>
    <MainMenuButtonClicked>
        <XMLDebug>MainMenuButtonClicked firing, calling GoToMainMenu</XMLDebug>
        <GoToMainMenu />
        <SuspendInterface/>
    </MainMenuButtonClicked>
    <RewindButtonClicked>
        <GoToBeginScreen/>
    </RewindButtonClicked>
    <ReplayButtonClicked>
        <RestoreVisitedState />
        <ReplayPage/>
    </ReplayButtonClicked>
    <ResourcesButtonClicked>
        <DisplayResources/>
        <SuspendInterface/>
    </ResourcesButtonClicked>
    <CourseMapButtonClicked>
        <DisplayCourseMap />
        <SuspendInterface/>
    </CourseMapButtonClicked>
    <ExitButtonClicked>
        <ConfirmExit />
        <SuspendInterface />
    </ExitButtonClicked>
    <ExitConfirmationClicked>
        <ExitCourse />
    </ExitConfirmationClicked>
    <ExitCancelClicked>
        <CancelExit />
    </ExitCancelClicked>
    <SpeedbumpYesClicked>
        <CloseSpeedbump />
        <MarkPageComplete />
        <StoreParameters />
        <GoToNextPage />
    </SpeedbumpYesClicked>
    <SpeedbumpNoClicked>
        <CloseSpeedbump />
    </SpeedbumpNoClicked>

    <UserSettingsOKClicked>
        <CloseUserSettings />
    </UserSettingsOKClicked>
    <UserSettingsCancelClicked>
        <CloseUserSettings />
    </UserSettingsCancelClicked>
    <SpecialFeatureUnloaded>
        <UnloadSpecial resume="maybe" />
        <ResumeInterface/>
    </SpecialFeatureUnloaded>
    <PageFinishedPlaying>
        <XMLDebug>### PageFinishedPlaying ###</XMLDebug>
        <SetPageControlsState buttonsEnabled="true" />
        <UpdatePageFinished />
        <RestoreVisitedState />
        <If condition="IfKnowledgeCheckPage">
            <IfTrueActions>
                <XMLDebug>### IsKnowledgeCheckPage ###</XMLDebug>
                <EnableAllControls />
            </IfTrueActions>
            <IfFalseActions>
                <If condition="IfAllPopupsVisited">
                    <IfTrueActions>
                        <If condition="IfPageTypeEquals" pageType="Normal">
                            <IfTrueActions>
                                <MarkPageComplete />
                                <StoreParameters />
                                <ExecuteNamedActionSet setName="SetNextButton" />
                            </IfTrueActions>
                            <IfFalseActions>
                            </IfFalseActions>
                        </If>
                    </IfTrueActions>
                    <IfFalseActions>
                    </IfFalseActions>
                </If>
            </IfFalseActions>
        </If>
        <ExecuteNamedActionSet setName="PerformCertificateCheck" />
    </PageFinishedPlaying>
    <PrintComplete>
        <ResumeInterface/>
        <PrintClose/>
    </PrintComplete>
    <AllPopupVisited>
        <MarkPageComplete />
        <StoreParameters />
        <ExecuteNamedActionSet setName="SetNextButtonBlink" />
    </AllPopupVisited>
    <PageCompleted/>
    <EnteredSection/>
    <DepartedSection/>
    <SectionCompleted/>
    <ModuleStarted/>
    <EnteredModule/>
    <DepartedModule>
        <StoreProgress/>
    </DepartedModule>
    <!--<PageStartLoading>
	  The following is used to show the loading.swf animation (progress bar) for the loading of a page or popup 
          <ShowLoadProgress percent=".2"/>
     </PageStartLoading>
 This code pops up ther certificate upon course completion -->
    <ModuleComplete>
        <MarkModuleComplete />
        <StoreParameters />
        <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>
								<XMLDebug>### Certificate Has been awarded (module complete) ###</XMLDebug>
                            </IfTrueActions>
                            <IfFalseActions>
                                <!--SetLinkParameter name="CertificateAwarded" value="1" />
								<PresentCertificate/>
								<ResumeInterface/-->
								<XMLDebug>### Certificate Has not been awarded (module complete) ###</XMLDebug>
                            </IfFalseActions>
                        </If>
                    </IfFalseActions>
                </If>
            </IfTrueActions>
            <IfFalseActions>
            </IfFalseActions>
        </If>
    </ModuleComplete>

    <ConnectionFault/>

    <ControlClicked>
        <XMLDebug>### ControlClicked ###</XMLDebug>
        <If condition="IfKnowledgeCheckPage">
            <IfTrueActions>
                <XMLDebug>### IsKnowledgeCheckPage ###</XMLDebug>
                <CheckInputCompleteStatus />
            </IfTrueActions>
            <IfFalseActions> </IfFalseActions>
        </If>
    </ControlClicked>
    <DoneButtonClicked>
        <XMLDebug>### DoneButtonClicked ###</XMLDebug>
        <EvaluateAndProvideFeedback />
        <If condition="IfKnowledgeCheckComplete">
            <IfTrueActions>
                <ExecuteNamedActionSet setName="KnowledgeCheckComplete"/>
            </IfTrueActions>
            <IfFalseActions/>
        </If>
    </DoneButtonClicked>
    <PreviousFeedbackClicked>
        <FeedbackClosedWithPrevious />
    </PreviousFeedbackClicked>
    <NextFeedbackClicked>
        <FeedbackClosedWithNext />
    </NextFeedbackClicked>
    <TryAgainClicked>
        <FeedbackClosedWithTryAgain />
    </TryAgainClicked>
    <CloseFeedbackClicked>
        <FeedbackClosedWithDone />
        <ExecuteNamedActionSet setName="SetNextButtonBlink" />
        <SetPageControlsState buttonsEnabled="false" />
        <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>
	 <!--<TestMessage TMessage="PCC" />-->
	 <!--      <XMLDebug>Performing certificate check</XMLDebug> -->
		<If condition="IfAllModulePagesVisited">
			<IfTrueActions>
				<TestMessage TMessage ="all modPage Visited" />
				<ExecuteNamedActionSet setName="ModuleComplete" />
			</IfTrueActions>
			<IfFalseActions>
				<TestMessage TMessage ="all modPage Not Visited" />
			</IfFalseActions>
		</If>
	</PerformCertificateCheck>
    <KnowledgeCheckComplete>
        <XMLDebug>### Knowledge Check Complete ###</XMLDebug>
        <ExecuteNamedActionSet setName="SetNextButtonBlink" />
    </KnowledgeCheckComplete>
	<!--<PrintCertificateAward>
	<If condition="IfCourseIsComplete">
			<IfTrueActions>
				these two lines need to stay commented out
				<!--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" />
								<PresentCertificate/>
								<ResumeInterface/>
							</IfFalseActions>
						</If>
					</IfFalseActions>
				</If>
			</IfTrueActions>
			<IfFalseActions>
			</IfFalseActions>
		</If>
	</PrintCertificateAward> -->

</ControllerBehavior>