<?xml version="1.0" encoding="utf-8"?>

<ControllerBehavior
    xmlns="com.carney"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="com.carney controllerbehavior_schema.xsd">


	<!--
	
	Section I - Interface and Navigation Behavior
	
	This section defines properties and behaviors for the Interface and Navigation, for instance the state of the controller as it is loaded. 
	This section also sets the states of buttons and the Interface conditionally based on input from the user, or based on the user's 
	location in the course, for instance setting the next button to blink when a user reaches the end of a page.
	
	-->


	<!-- 
	
	ModuleLoaded - This is called by XMLActions.as through ControllerLoader.as, and is triggered when the course is first initialized. If 
	the course has been previously loaded, this command sends the course to the last visited module and page. If the course is being opened 
	for the first time, this command directs the user to the first page, or the main menu. This command also triggers the 
	"ModuleLoadedActions" command below.
	
	-->
	
	<ModuleLoaded>
		<XMLDebug>### ModuleLoaded ###</XMLDebug>
		<If condition="IfCourseHasBeenVisited">
			<IfTrueActions>
				<GoToLastVisitedModuleAndPage/>
			</IfTrueActions>
			<IfFalseActions>
				<ExecuteNamedActionSet setName="ModuleLoadedActions"/>
				<GoToFirstPage/>
				<!--GoToMainMenu/-->
			</IfFalseActions>
		</If>
	</ModuleLoaded>

	<!-- 
	
	ModuleReplaced - This is called by XMLActions.as through ControllerLoader.as, and is triggered when the course is re-initialized. If 
	the course has been previously loaded, this command sends the course to the last visited module and page. If the course is being opened 
	for the first time, this command directs the user to the first page, or the main menu. This command also triggers the 
	"ModuleLoadedActions" command below.
	
	-->

	<ModuleReplaced>
		<XMLDebug>### ModuleReplaced ###</XMLDebug>
		<ExecuteNamedActionSet setName="ModuleLoadedActions"/>
		<If condition="IfModuleHasBeenVisited">
		    <IfTrueActions>
				<If condition="IfTargetPageSpecified">
					<IfTrueActions>
						<GoToTargetPage/>
					</IfTrueActions>
					<IfFalseActions>
						<GoToLastPageVisited/>
					</IfFalseActions>
				</If>
 		    </IfTrueActions>
		    <IfFalseActions>
				<GoToFirstPage/>
				<!--GoToMainMenu/-->
		    </IfFalseActions>
		</If>
	</ModuleReplaced>

	<!--
	
	 ModuleLoadedActions - This is called by controllerbehavior.xml from the ModuleLoaded command, and is triggered when the course is first 
	 initialized. This command initializes the courseware interface, and sets parameters.
	 
	 -->
	
	<ModuleLoadedActions>
		<XMLDebug>### ModuleLoadedActions ###</XMLDebug>
		<InitializeInterface/>
		<LoadBackground/>
		<MarkModuleVisited/>
		<StoreParameters/>
		<TurnShowTextOff/>
		<UpdateShowText/>
		<CheckIfPlaying/>
	</ModuleLoadedActions>

	<!--
	
	 InterfaceNormal - This is called by controllerbehavior.xml from several commands, and is triggered when the course is first 
	 initialized. This command initializes the courseware interface, and sets parameters.
	 
	 -->

	<InterfaceNormal>
		<XMLDebug>### InterfaceNormal ###</XMLDebug>
        <ExecuteNamedActionSet setName="UpdateButtonStates"/>
		<CheckState/>
	</InterfaceNormal>
	
	<!--
	
	PageStartLoading - The following is used to show the loading.swf animation (progress bar) for the loading of a page or popup.  
	
	-->
	
	<PageStartLoading>
          <ShowLoadProgress percent=".8"/>
     </PageStartLoading>

	
	<!--
	
	PageStartPlaying - This is called by Controller.as, and called each time the controller loads a new page.  
	
	-->

    <PageStartPlaying>
        <XMLDebug>### PageStartPlaying ###</XMLDebug>
        <CollapseTopicsMap/>
        <CacheVisitedState/>
        <LoadPageFunctions/>
        <SetPageControlsState buttonsEnabled="false"/>
        <MarkPageVisited/>
        <MarkModuleVisited/>
        <StoreParameters/>
		<ResetTotalAnswered/>
		<SetBarrierType/>
		<ResetAllControls/>
		<CheckIfPlaying/>
        <ExecuteNamedActionSet setName="UpdateButtonStates"/>
        <If condition="IfKnowledgeCheckPage">
            <IfTrueActions>
       			<XMLDebug>### KnowledgeCheckPage ###</XMLDebug>
                <ResetKnowledgeCheck/>
                <DisableAllControls/>
            </IfTrueActions>
            <IfFalseActions>
            </IfFalseActions>
        </If>
		<SetNavigationResumed/>
    </PageStartPlaying>
	
	<!--
	
	PageFinishedPlaying – This is called by Controller.as when a page has finished playing.
	
	-->

    <PageFinishedPlaying>
        <XMLDebug>### PageFinishedPlaying ###</XMLDebug>
        <SetPageControlsState buttonsEnabled="true"/>
        <UpdatePageFinished/>
        <RestoreVisitedState/>
     	<SetButton button="pauseBtn" buttonEnabled="false" state="off" />     
        <If condition="IfKnowledgeCheckPage">
            <IfTrueActions>
                <EnableAllControls/>
            </IfTrueActions>
            <IfFalseActions>
                <If condition="IfAllPopupsVisited">
                    <IfTrueActions>
                        <If condition="IfPageTypeEquals" pageType="Normal">
                            <IfTrueActions>
                                <MarkPageComplete/>
                                <StoreParameters/>
                                <ExecuteNamedActionSet setName="UpdateButtonStates"/>
                            </IfTrueActions>
                            <IfFalseActions>
                            </IfFalseActions>
                        </If>
                    </IfTrueActions>
                    <IfFalseActions>
                    </IfFalseActions>
                </If>
            </IfFalseActions>
        </If>
        <ExecuteNamedActionSet setName="PerformCertificateCheck"/>
		<DelayCloseCC/>
    </PageFinishedPlaying>
	
	<!--
	
	UpdateButtonStates - This is called by controllerbehavior.xml and controls the functionality and appearance of the navigation buttons 
	on the interface.
	
	-->
	
	<UpdateButtonStates>
        <XMLDebug>### UpdateButtonStates ###</XMLDebug>
		<If condition="IfKnowledgeCheckPage">
			<IfTrueActions>
				<If condition="IfKnowledgeCheckPageComplete" value="true">
					<IfTrueActions>
					<XMLDebug>###KnowledgeCheckPageComplete calling next button Blink###</XMLDebug>
                        <ExecuteNamedActionSet setName="SetNextButtonBlink"/>
					</IfTrueActions>
					<IfFalseActions>
						<If condition ="IfPageCompleted" value="true">
							<IfTrueActions>
                        		<ExecuteNamedActionSet setName="SetNextButtonBlink"/>
							</IfTrueActions>
							<IfFalseActions>
                				<SetButton button="Next" buttonEnabled="false" state="off"/>
							</IfFalseActions>
						</If>
					</IfFalseActions>
				</If>
			</IfTrueActions>
			<IfFalseActions>
        		<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>
            		</IfTrueActions>
            		<IfFalseActions>
                		<If condition="IfCurrentPageComplete">
                    		<IfTrueActions>
							 	<If condition="IfAllPopupsVisited">
									<IfTrueActions>
                        				<ExecuteNamedActionSet setName="SetNextButtonBlink"/>
									</IfTrueActions>
									<IfFalseActions>
									</IfFalseActions>
								</If>
                    		</IfTrueActions>
                    		<IfFalseActions>
                        		<SetButton button="Next" buttonEnabled="true" state="on"/>
                    		</IfFalseActions>
                		</If>
            		</IfFalseActions>
        		</If>
			</IfFalseActions>
		</If>
		<CheckState/>		
	</UpdateButtonStates>

	<!--
	
	definition - 

	-->

	
	<SetPlaying>
		<XMLDebug>### SetPauseButtonDisabled ###</XMLDebug>
     	<SetButton button="pauseBtn" buttonEnabled="true" state="on" />     
	</SetPlaying>

	<!--
	
	definition - 

	-->

	<SetPlayingStopped>
		<XMLDebug>### SetPauseButtonDisabled ###</XMLDebug>
     	<SetButton button="pauseBtn" buttonEnabled="false" state="off" /> 
	</SetPlayingStopped>
	
	<!--
	
	SetNextButtonBlink - This is called by controllerbehavior.xml and controls the functionality and appearance of the navigation buttons 
	on the interface.

	-->

	<SetNextButtonBlink>
		<XMLDebug>### SetNextButtonBlink ###</XMLDebug>
		<SetButton button="Next" buttonEnabled="true" state="blink"/>
	</SetNextButtonBlink>

	<!--
	
	SuspendInterface - This is called by controllerbehavior.xml and controls the functionality and appearance of the navigation buttons 
	on the interface.

	-->

	<SuspendInterface>
		<XMLDebug>### SuspendInterface ###</XMLDebug>
		<SuspendInterface/>
	</SuspendInterface>

	<!--
	
	ConnectionFault - This is currently not being used.

	-->
	
	<ConnectionFault>
		<XMLDebug>### ConnectionFault ###</XMLDebug>
	</ConnectionFault>
	
	<!--
	
	Section - Conditional Behavior
	
	Sub-section - Interface Navigation Controls
	
	This section defines conditional behaviors based on user input, for instance the controller’s response to clicking on the next button. 
	This section is the first sub-section of two:
		i)	Interface Navigation Controls – This sub-section defines the conditional response based on user input to the central 
			interface.

	
	-->	
	
	
	<!--
	
	NextButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the next button is clicked.
	
	-->

	
	<NextButtonClicked>
		<XMLDebug>### NextButtonClicked ###</XMLDebug>
		<SetNextClicked/>
		<SetButton button="Next" buttonEnabled="true" state="on"/>
		<MarkPageComplete/>
		<StoreParameters/>
		<If condition="IfLastPage">
			<IfTrueActions>
				<If condition="IfLinkParameterEquals" name="CertificateAwarded" value="1">
					<IfTrueActions>
					</IfTrueActions>
					<IfFalseActions>
						<ExecuteNamedActionSet setName="MainMenuButtonClicked"/>
					</IfFalseActions>
				</If>
			</IfTrueActions>
			<IfFalseActions>
				<If condition="IfAllPopupsVisitedRecursive" recursionLimit="1">
					<IfTrueActions>
						<MarkPageComplete/>
						<StoreParameters/>
						<GoToNextPage/>
					</IfTrueActions>
					<IfFalseActions>
						<If condition="IfKnowledgeCheckPage">
							<IfTrueActions>
								<MarkPageComplete/>
								<StoreParameters/>
								<GoToNextPage/>
							</IfTrueActions>
							<IfFalseActions>
								<LoadBarrier/>	
								<SuspendInterface/>
							</IfFalseActions>
						</If>
					</IfFalseActions>
				</If>
			</IfFalseActions>
		</If>
	</NextButtonClicked>

	<!--
	
	PreviousButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the previous button is clicked.
	
	-->

	
	<PreviousButtonClicked>
		<XMLDebug>### PreviousButtonClicked ###</XMLDebug>
		<If condition="IfFirstPage">
			<IfTrueActions>
				<!--GoToMainMenu /-->
			</IfTrueActions>
			<IfFalseActions>
				 <GoToPreviousPage/>
			</IfFalseActions>
		</If>
	</PreviousButtonClicked>

	<!--
	
	PauseButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the pause button is clicked.
	
	-->


	<PauseButtonClicked>
		<XMLDebug>### PauseButtonClicked ###</XMLDebug>
		<PausePlayback/>
		<!--DisplayPause/-->
		<!--SuspendInterface/-->
	</PauseButtonClicked>

	<!--
	
	ResumeButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the resume button is clicked.
	
	-->
	
	
	<ResumeButtonClicked>
		<XMLDebug>### ResumeButtonClicked ###</XMLDebug>
		<ResumeInterface/>
	</ResumeButtonClicked>

	<!--
	
	SkipReverseButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the skip back button is clicked.
	
	-->


	<SkipReverseButtonClicked>
		<XMLDebug>### SkipReverseButtonClicked ###</XMLDebug>
		<SkipReverse frames="30"/>
	</SkipReverseButtonClicked>

	<!--
	
	SkipForwardButtonClicked – This is called by controllerbehavior.xml, and called when the forwards skip button is clicked .
	
	-->

	
	<SkipForwardButtonClicked>
		<XMLDebug>### SkipForwardButtonClicked ###</XMLDebug>
		<SkipForward frames="30"/>
	</SkipForwardButtonClicked>
	
	<!--
	
	SkipToEndButtonClicked – This is called by controllerbehavior.xml, and called when the skip to end button is clicked .
	
	-->
	
	<SkipToEndButtonClicked>
		<XMLDebug>### SkipToEndButtonClicked ###</XMLDebug>
		<GoToEndScreen/>	
	</SkipToEndButtonClicked>

	<!--
	
	RewindButtonClicked – This is called by controllerbehavior.xml, and called when the rewind button is clicked.
	
	-->

	<RewindButtonClicked>
		<XMLDebug>### RewindButtonClicked ###</XMLDebug>
		<GoToBeginScreen/>
	</RewindButtonClicked>

	<!--
	
	ReplayButtonClicked – This is called by controllerbehavior.xml, and called when the replay button is clicked.
	
	-->
	
	<ReplayButtonClicked>
		<XMLDebug>### ReplayButtonClicked ###</XMLDebug>
		<RestoreVisitedState/>
		<!--ReplayBasePage/-->
		<ReplayPage/>
	</ReplayButtonClicked>

	<!--
	
	HelpButtonClicked – This is called by controllerbehavior.xml, and called when the help button is clicked.
	
	-->

	<HelpButtonClicked>
		<XMLDebug>### HelpButtonClicked ###</XMLDebug>
		<DisplayHelp/>
		<SuspendInterface/>
	</HelpButtonClicked>
	
	<!--
	
	SkipTopNavButtonClicked – This is called by controllerbehavior.xml, and called when the skip button is clicked.
	
	-->
	
	<SkipTopNavButtonClicked>
		<XMLDebug>### SkipTopNavButtonClicked ###</XMLDebug>
		<SkipTopNavigation/>
	</SkipTopNavButtonClicked>
	
	<!--
	
	SkipBtmNavButtonClicked – This is called by controllerbehavior.xml, and called when the skip button is clicked.
	
	-->

	<SkipBtmNavButtonClicked>
		<XMLDebug>### SkipBtmNavButtonClicked ###</XMLDebug>
		<SkipBtmNavigation/>
	</SkipBtmNavButtonClicked>

	<!--
	
	GlossaryButtonClicked – This is called by controllerbehavior.xml, and called when the glossary button is clicked.
	
	-->
	
	<GlossaryButtonClicked>
		<XMLDebug>### GlossaryButtonClicked ###</XMLDebug>
		<DisplayGlossary/>
		<SuspendInterface/>
	</GlossaryButtonClicked>

	<!--
	
	MainMenuButtonClicked – This is called by controllerbehavior.xml, and called when the main menu button is clicked.
	
	-->
	
	<MainMenuButtonClicked>
		<XMLDebug>### MainMenuButtonClicked ###</XMLDebug>
		<GoToMainMenu/>
		<SuspendInterface/>
	</MainMenuButtonClicked>

	<!--
	
	CourseMapButtonClicked – This is called by controllerbehavior.xml, and called when the course map button is clicked.
	
	-->

	<CourseMapButtonClicked>
		<XMLDebug>### CourseMapButtonClicked ###</XMLDebug>
		<DisplayCourseMap/>
		<SuspendInterface/>
	</CourseMapButtonClicked>

	<!--
	
	CourseMapLinkClicked – This is called by controllerbehavior.xml, and called when the course link button is clicked.
	
	-->

	<CourseMapLinkClicked>
		<XMLDebug>### CourseMapLinkClicked ###</XMLDebug>
		<GoToCourseMapLink/>
	</CourseMapLinkClicked>

	<!--
	
	ResourcesButtonClicked – This is called by controllerbehavior.xml, and called when the resources button is clicked.
	
	-->

	<ResourcesButtonClicked>
		<XMLDebug>### ResourcesButtonClicked ###</XMLDebug>
		<DisplayResources/>
		<SuspendInterface/>
	</ResourcesButtonClicked>

	<!--
	
	LinkClicked – This is called by controllerbehavior.xml, and called when a link is clicked.
	
	-->

	<LinkClicked>
		<XMLDebug>### LinkClicked ###</XMLDebug>	
		<GoToLink/>
	</LinkClicked>

	<!--
	
	PageLInkClicked – This is called by controllerbehavior.xml, and called when a link to the page is clicked.
	
	-->
	
	<PageLinkClicked>
		<XMLDebug>### PageLinkClicked ###</XMLDebug>
		<GoToPageLink/>
	</PageLinkClicked>

	<!--
	
	ExternalLinkClicked – This is called by controllerbehavior.xml, and called when an external link is clicked.
	
	-->
	
	<ExternalLinkClicked>
		<XMLDebug>### ExternalLinkClicked ###</XMLDebug>
		<OpenExternalResource/>
	</ExternalLinkClicked>

	<!--
	
	ExitButtonClicked – This is called by controllerbehavior.xml, and called when the exit button is clicked .
	
	-->

	<ExitButtonClicked>
		<XMLDebug>### ExitButtonClicked ###</XMLDebug>
		<ConfirmExit/>
		<SuspendInterface/>
	</ExitButtonClicked>

	<!--
	
	ExitConfirmationButtonClicked – This is called by controllerbehavior.xml, and called when the exiting is confirmed from the dialog box.
	
	-->
	
	<ExitConfirmationClicked>
		<XMLDebug>### ExitConfirmationClicked ###</XMLDebug>
		<ExitCourse/>
	</ExitConfirmationClicked>

	<!--
	
	ExitCancelClicked – This is called by controllerbehavior.xml, and called when the exit is canceled from the dialog box.
	
	-->
	
	<ExitCancelClicked>
		<XMLDebug>### ExitCancelClicked ###</XMLDebug>
		<CancelExit/>
	</ExitCancelClicked>

	<!--
	
	PreviousButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the previous button is clicked.
	
	-->
	
	<SpeedbumpYesClicked>
		<XMLDebug>### SpeedbumpYesClicked ###</XMLDebug>
		<CloseSpeedbump/>
		<MarkPageComplete/>
		<StoreParameters/>
		<GoToNextPage/>
	</SpeedbumpYesClicked>

	<!--
	
	PreviousButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the previous button is clicked.
	
	-->
	
	<SpeedbumpNoClicked>
		<XMLDebug>### SpeedbumpNoClicked ###</XMLDebug>
		<CloseSpeedbump/>
	</SpeedbumpNoClicked>

	<!--
	
	PreviousButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the previous button is clicked.
	
	-->

	<RoadblockOkClicked>
		<XMLDebug>### RoadblockOkClicked ###</XMLDebug>
		<CloseRoadblock/>
	</RoadblockOkClicked>

	<!--
	
	TranscriptButtonClicked – This is called by controllerbehavior.xml, and called when the transcript button is clicked .
	
	-->
	
    <TranscriptButtonClicked>
		<XMLDebug>### TranscriptButtonClicked ###</XMLDebug>
		<DisplayTranscript/>
		<SuspendInterface/>
    </TranscriptButtonClicked>

	<!--
	
	ShowTextButtonClicked – This is called by controllerbehavior.xml, and called when the show text button is clicked .
	
	-->

	<ShowTextButtonClicked>
		<XMLDebug>### ShowTextButtonClicked ###</XMLDebug>
		<TurnShowTextOn/>
	</ShowTextButtonClicked>

	<!--
	
	HideTextButtonClicked – This is called by controllerbehavior.xml, and called when the hide text button is clicked .
	
	-->
	
	<HideTextButtonClicked>
		<XMLDebug>### HideTextButtonClicked ###</XMLDebug>
		<TurnShowTextOff/>
		<ResetFocus/>
	</HideTextButtonClicked>

	<!--
	
	ShowCCButtonClicked – This is called by controllerbehavior.xml, and called when the cc button is toggled on.
	
	-->

	<ShowCCButtonClicked>
		<XMLDebug>### ShowCCButtonClicked ###</XMLDebug>
		<ShowCC/>
	</ShowCCButtonClicked>

	<!--
	
	HidCCButtonClicked – This is called by controllerbehavior.xml, and called when the cc button is toggled off .
	
	-->
	
	<HideCCButtonClicked>
		<XMLDebug>### HideCCButtonClicked ###</XMLDebug>
		<HideCC/>
	</HideCCButtonClicked>

	<!--
	
	PreviousButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the previous button is clicked.
	
	-->

	<AudioDescriptionsOnButtonClicked>
		<XMLDebug>### AudioDescriptionsOnButtonClicked ###</XMLDebug>
		<TurnAudioDescriptionsOn/>
	</AudioDescriptionsOnButtonClicked>	

	<!--
	
	PreviousButtonClicked - This is called by controllerbehavior.xml and XMLActions.as when the previous button is clicked.
	
	-->
	
	<AudioDescriptionsOffButtonClicked>
		<XMLDebug>### AudioDescriptionsOffButtonClicked ###</XMLDebug>
		<TurnAudioDescriptionsOff/>
	</AudioDescriptionsOffButtonClicked>

	<!--
	
	UserSettingsButtonClicked – This is called by controllerbehavior.xml, and called when the user settings button is clicked .
	
	-->

	<UserSettingsButtonClicked>
		<XMLDebug>### UserSettingsButtonClicked ###</XMLDebug>
		<LoadUserSettings/>
	</UserSettingsButtonClicked>

	<!--
	
	UserSettingsOKCliked – This is called by controllerbehavior.xml, and called when the user settings is confirmed by clicking ok .
	
	-->
	
	<UserSettingsOKClicked>
		<XMLDebug>### UserSettingsOKClicked ###</XMLDebug>	
		<CloseUserSettings/>
	</UserSettingsOKClicked>

	<!--
	
	UserSettingsCancelClicked – This is called by controllerbehavior.xml, and called when the user settings are canceled by clicking the cancel button .
	
	-->
	
	<UserSettingsCancelClicked>
		<XMLDebug>### UserSettingsCancelClicked ###</XMLDebug>
		<CloseUserSettings/>
	</UserSettingsCancelClicked>
	
	
	<!--
	
	Section - Conditional Behavior
	
	Sub-section - Independent Page Controls
	
	This section defines conditional behaviors based on user input, for instance the controller’s response to clicking on the next button. 
	This is the second sub-section of two:
		ii)	Independent Page Controls – This sub-section defines the conditional response based on user input on independent pages.

	End of Definition 
	
	-->		
	
	<!--
	
	This is called when a Popup button is clicked
	
	-->
	
	<PopupClicked>
		<XMLDebug>### PopupClicked ###</XMLDebug>	
	    <OpenPopupPage/>
		<MarkPopupVisited/>
		<SetPopupClicked/>
	</PopupClicked>
	
	<!--
	
	This is called when the popup close button is clicked.
	
	-->
	
	<PopupClosed>
		<XMLDebug>### PopupClosed ###</XMLDebug>
		 <If condition="IfAudioDescriptionsEnabled">
			<IfTrueActions>
				<StopAudioDescription/>
            </IfTrueActions>
            <IfFalseActions>
            </IfFalseActions>
          </If>
		<ClosePopupPage/>
		<ExecuteNamedActionSet setName="SetPlayingStopped"/>
		<SetPopupClicked/>
	</PopupClosed>
	
	<!--
	
	description
	
	-->
	
    <ControlClicked>
		<XMLDebug>### ControlClicked ###</XMLDebug>
      <If condition="IfKnowledgeCheckPage">
        <IfTrueActions>
          <CheckInputCompleteStatus/>
        </IfTrueActions>
        <IfFalseActions> 
		</IfFalseActions>
      </If>
    </ControlClicked>
	
	<!--
	
	description
	
	-->
	
	<ContinueButtonClicked>
		<XMLDebug>### ContinueButtonClicked ###</XMLDebug>	
		<GoToEndOfEmbeddedVideo/>
		<ContinuePagePlaying/>
	</ContinueButtonClicked>
	
	<!--
	
	This is called when the done button is clicked on a knowledge check page
	
	-->

    <DoneButtonClicked>
        <XMLDebug>### DoneButtonClicked ###</XMLDebug>
        <EvaluateAndProvideFeedback/>
		<KnowledgeCheckTotalAnswered/>
        <ExecuteNamedActionSet setName="UpdateButtonStates"/>
		<SetDoneClicked/>
    </DoneButtonClicked>
	
	<!--
	
	This is called when the previous feedback button is clicked
	
	-->
	
    <PreviousFeedbackClicked>
		<XMLDebug>### PreviousFeedbackClicked ###</XMLDebug>
      <FeedbackClosedWithPrevious/>
		<SetFeedbackClicked/>
    </PreviousFeedbackClicked>
	
	<!--
	
	This is called when the next feedback button is clicked. 
	
	-->
	
    <NextFeedbackClicked>
		<XMLDebug>### NextFeedbackClicked ###</XMLDebug>
		<FeedbackClosedWithNext/>
		<SetFeedbackClicked/>
    </NextFeedbackClicked>
	
	<!--
	
	This is called when the try again button is clicked on a KC page. 
	
	-->
    
	<TryAgainClicked>
		<XMLDebug>### TryAgainClicked ###</XMLDebug>
    	<FeedbackClosedWithTryAgain/>
		<SetFeedbackClicked/>
    </TryAgainClicked>

	<!--
	
	This is called when the close feedback button is clicked
	
	-->
    
	<CloseFeedbackClicked>
		<XMLDebug>### CloseFeedbackClicked ###</XMLDebug>
		<FeedbackClosedWithDone/>
		<ExecuteNamedActionSet setName="SetNextButtonBlink"/>
		<SetPageControlsState buttonsEnabled="false"/>
		<If condition="IfOnLastPageOfTopic">
			<IfTrueActions>
              <ExpandTopicsMap/>
              <MarkPageComplete/>
			</IfTrueActions>
			<IfFalseActions> </IfFalseActions>
		</If>
    </CloseFeedbackClicked>


	<!--
	
	Section - Individual Page Behavior 
	
	This section defines the behavior of individual pages, for instance enabling popups.
	
	End of Definition 
	
	-->
	
	<!--
	
	This is called by controllerbehaviour to enable popups. 
	
	-->
	
	<EnablePopups>
		<XMLDebug>### EnablePopups ###</XMLDebug>
		<TestMessage TMessage="pop enabled"/>
	 	<SetPageControlsState buttonsEnabled="true"/>
	</EnablePopups>
	
	<!--
	
	description
	
	-->
    
	<ProvideSummaryFeedback/>
	
	<!--
	
	This is triggered when the user enters text
	
	-->
    
	<UserEnteredText>
		<XMLDebug>### UserEnteredText ###</XMLDebug>
		<If condition="IfCurrentQuestionAnswered">
			<IfTrueActions>
				<GoToState name="doneButton_MC" state="on" btnEnabled="true"/>
			</IfTrueActions>
        <IfFalseActions> </IfFalseActions>
		</If>
    </UserEnteredText>
	
	<!--
	
	This is called by controllerbehavior to start audio descriptions, if audio descriptions are on. 
	
	-->

	<AudioDescriptionReady>
		<XMLDebug>### AudioDescriptionReady ###</XMLDebug>
		<If condition="IfAudioDescriptionsEnabled">
			<IfTrueActions>
				<PlayAudioDescription/>
			</IfTrueActions>
			<IfFalseActions>
			</IfFalseActions>
		</If>
	</AudioDescriptionReady>
		
	<!--
	
	This plays the audio descriptions.
	
	-->
	
	<AudioDescriptionStart>
		<XMLDebug>### AudioDescriptionStart ###</XMLDebug>
	</AudioDescriptionStart>

	<!--
	
	This sets the audio description to off, at the end of the audio description file. 
	
	-->
	
	<AudioDescriptionFinish>
		<XMLDebug>### AudioDescriptionFinish ###</XMLDebug>	
		<StopAudioDescription/>
	</AudioDescriptionFinish>
	
	<!--
	
	Called by controllerbehavior when an embedded video starts playing
	
	-->

	<EmbeddedVideoStartPlaying>
		<XMLDebug>### EmbeddedVideoStartPlaying ###</XMLDebug>
		<StopPagePlaying/>
	</EmbeddedVideoStartPlaying>
	
	<!--
	
	Called by controller behaviour when the embedded video finishes. 
	
	-->
	
	<EmbeddedVideoFinishedPlaying>
		<XMLDebug>### EmbeddedVideoFinishedPlaying ###</XMLDebug>	
		<ContinuePagePlaying/>
	</EmbeddedVideoFinishedPlaying>
	
	<!--
	
	description
	
	-->
	
	<SpecialFeatureUnloaded>
		<XMLDebug>### SpecialFeatureUnloaded ###</XMLDebug>
		<UnloadSpecial resume="maybe"/>
		<ResumeInterface/>
	</SpecialFeatureUnloaded>


	<!--
	
	Section - Progression Tracking and Behavior 
	
	This section defines the behavior of the controller based on progression status by the user, for instance when the module has been completed.
		
	End of Definition 
	
	-->
	
	<!--
	
	EnteredModule – This is called by controllerbehavior.xml, and called when the module is entered. 
	
	-->
	
	<EnteredModule>
		<XMLDebug>### EnteredModule ###</XMLDebug>
	</EnteredModule>
		
	<!--
	
	ModuleStarted – This is called by controllerbehavior.xml, and called when the module is started.
	
	-->
	
	<ModuleStarted>
		<XMLDebug>### ModuleStarted ###</XMLDebug>
	</ModuleStarted>
	
	<!--
	
	DepartedModule – This is called by controllerbehavior.xml, and called when the module is exited.
	
	-->
	
	<DepartedModule>
		<XMLDebug>### DepartedModule ###</XMLDebug>
		<StoreProgress/>
	</DepartedModule>
	
	<!--
	
	ModuleComplete – This is called by controllerbehavior.xml_XMLActions.as_commonfunctions.js_flashfunctions.js, and called when the module is completed.
	
	-->
	
	<ModuleComplete>
		<XMLDebug>### ModuleComplete ###</XMLDebug>	
		<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>
							</IfTrueActions>
							<IfFalseActions>
								<SetLinkParameter name="CertificateAwarded" value="1"/>
								<!--PresentCertificate /-->
							</IfFalseActions>
						</If>
					</IfFalseActions>
				</If>
			</IfTrueActions>
			<IfFalseActions>
			</IfFalseActions>
		</If>
	</ModuleComplete>
	
	<!--
	
	description
	
	-->
	
	<EnteredSection>
		<XMLDebug>### EnteredSection ###</XMLDebug>
	</EnteredSection>
	
	<!--
	
	description
	
	-->
	
	<DepartedSection>
		<XMLDebug>### DepartedSection ###</XMLDebug>
	</DepartedSection>
		
	<!--
	
	description
	
	-->
	
	<SectionCompleted>
		<XMLDebug>### SectionCompleted ###</XMLDebug>
	</SectionCompleted>
		
	<!--
	
	PageStarted – This is called by controllerbehavior.xml, and called when the page is started.
	
	-->
	
	<PageStarted>
		<XMLDebug>### PageStarted ###</XMLDebug>
	</PageStarted>
		
	<!--
	
	PageCompleted – This is called by controllerbehavior.xml, and called when the page is completed.
	
	-->
	
	<PageCompleted>
		<XMLDebug>### PageCompleted ###</XMLDebug>
	</PageCompleted>
	
	<!--
	
	PopupStartPlaying – This is called by controllerbehavior.xml_Controller.as, and called when the popup starts playing.
	
	-->
	
	<PopupStartPlaying>
		<XMLDebug>### PopupStartPlaying ###</XMLDebug>
		<CacheVisitedState/>
		<LoadPageFunctions/>
		<SetPageControlsState buttonsEnabled="false"/>
		<MarkPopupVisited/>
		<CheckIfPlaying/>
	</PopupStartPlaying>
	
	<!--
	
	PopupFinishedPlaying – This is called by controllerbehavior.xml_Controller.as, and called when the popup finishes playing.
	
	-->
	
	<PopupFinishedPlaying>	
		<XMLDebug>### PopupFinishedPlaying ###</XMLDebug>
		<UpdatePageFinished/>
		<RestoreVisitedState/>
		<SetPageControlsState buttonsEnabled="true"/>
		<MarkPopupComplete/>
		<MakeCloseButtonBlink/>
	</PopupFinishedPlaying>
		
	<!--
	
	AllPopupVisited – This is called by controllerbehavior.xml_BasicPage.as_clientmercury.swf_mercury.as, and called when all the popups have been visited already.
	
	-->

	<AllPopupVisited>
		<XMLDebug>### AllPopupVisited ###</XMLDebug>	
		<MarkPageComplete/>
		<StoreParameters/>
		<ExecuteNamedActionSet setName="SetNextButtonBlink"/>
	</AllPopupVisited>
		
	<!--
	
	SpeedBumpMarkPageComplete – This is called by controllerbehavior.xml, and called when the speed bump has been completed.
	
	-->
	
	<SpeedBumpMarkPageComplete>
		<XMLDebug>### SpeedBumpMarkPageComplete ###</XMLDebug>
		<MarkPageComplete/>
		<StoreParameters/>
		<GoToNextPage/>
		<ExecuteNamedActionSet setName="SetNavButtons"/>
	</SpeedBumpMarkPageComplete>
	
	<!--
	
	KnowledgeCheckComplete – This is called by KnowledgeCheckPageBase.as_KnowledgeCheckPageTypeII.as_XMLActions.as_controllerbehavior.xml, and called when the knowledge check is completed.
	
	-->
	
	 <KnowledgeCheckComplete>
		<XMLDebug>### KnowledgeCheckComplete ###</XMLDebug>
		<!--ExecuteNamedActionSet setName="SetNextButtonBlink"/-->
	</KnowledgeCheckComplete>
	
	<!--
	
	PerformCertificateCheck – This is called by controllerbehavior.xml, and called when the certificate check is completed.
	
	-->
	
     <PerformCertificateCheck>
		<XMLDebug>### PerformCertificateCheck ###</XMLDebug>
	       <If condition="IfAllModulePagesVisited">
	         <IfTrueActions>
				<ExecuteNamedActionSet setName="ModuleComplete"/>
	         </IfTrueActions>
	         <IfFalseActions>
	 			<TestMessage TMessage ="All Modules not Complete"/>
	         </IfFalseActions>
	       </If>
	 </PerformCertificateCheck>
		
	<!--
	
	PrintComplete – This is called by controllerbehavior.xml, and called when the certificate needs to be printed.
	
	-->
	
	<PrintComplete>
		<XMLDebug>### PrintComplete ###</XMLDebug>
		<ResumeInterface/>
		<PrintClose/>
	</PrintComplete>


</ControllerBehavior>