<Popup>
	<ViewController>
		<View	Name		=	"PopupVideo"
				ModelName	=	"OTModel"
				Type		=	"PopupView"
				WindowTitle	=	"AOL Video"
				Width		=	"352"
				Height		=	"440"
				Caption		=	"yes" >

			<Layout lf="PopupVideo.lyt" default="yes" gf="http" xv="1" r="t"/>

			<ChildViews>
				<View Type="PopupButtonChrome" Name="ChildButtonChrome" Container="ButtonChrome"/>
			</ChildViews>

			<StartAction>
				<InitAction />
			</StartAction>

			<XMLGlyphs>
				<Glyph Name="Video"/>
			</XMLGlyphs>

			<ViewActions>
				<ViewAction Name="InitAction">
					<GlyphCommand Glyph="Video">
						<Controls Set="ImageWindow" />
 					</GlyphCommand>
				</ViewAction>

				<ViewAction Name="ShowVideo" >
					<xsl:choose>
						<xsl:when expr="[@Provider $eq$ cnnvideo]" >
							<GlyphCommand Glyph="TopFrame" >
								<ShowGlyph />
							</GlyphCommand>
							<GlyphCommand Glyph="LeftFrame" >
								<ShowGlyph />
							</GlyphCommand>
							<GlyphCommand Glyph="RightFrame" >
								<ShowGlyph />
							</GlyphCommand>
							<GlyphCommand Glyph="BottomFrame" >
								<ShowGlyph />
							</GlyphCommand>
							<RequisitionChanged />
						</xsl:when>
						<xsl:otherwise>
							<GlyphCommand Glyph="TopFrame" >
								<HideGlyph />
							</GlyphCommand>
							<GlyphCommand Glyph="LeftFrame" >
								<HideGlyph />
							</GlyphCommand>
							<GlyphCommand Glyph="RightFrame" >
								<HideGlyph />
							</GlyphCommand>
							<GlyphCommand Glyph="BottomFrame" >
								<HideGlyph />
							</GlyphCommand>
							<RequisitionChanged />
						</xsl:otherwise>
					</xsl:choose>

					<GlyphCommand Glyph="Video">
						<Source Set="@URL" />
						<Play />
 					</GlyphCommand>

				</ViewAction>	
				
				<ViewAction Name="StopVideo">
					<ButtonState button="VideoStopBtn" state="focus" />
					<GlyphCommand Glyph="Video">
						<Stop />
 					</GlyphCommand>
				</ViewAction>	
				<ViewAction Name="PlayVideo">
					<ButtonState button="VideoPlayBtn" state="focus" />
					<GlyphCommand Glyph="Video">
						<Play />
 					</GlyphCommand>
				</ViewAction>	
				<ViewAction Name="PauseVideo">
					<ButtonState button="VideoPauseBtn" state="focus" />
					<GlyphCommand Glyph="Video">
						<Pause />
 					</GlyphCommand>
				</ViewAction>	
				<ViewAction Name="ToggleMute">
					<GlyphCommand Glyph="Video">
						<MuteToggle />
 					</GlyphCommand>
				</ViewAction>
				<ViewAction Name="ButtonState" >
					<DbgMsg Msg="SetAltState [@button]-[@state]" />
					<GlyphCommand Glyph="@button">
						<SetAltState State="@state" />
 					</GlyphCommand>
				</ViewAction>	
				<ViewAction Name="ChangeState" >
					<DbgMsg Msg="SetAltState [@button]-[@state]" />
					<GlyphCommand Glyph="@button">
						<ChangeState State="@state" />
 					</GlyphCommand>
				</ViewAction>	

				<ViewAction Name="Status" >
					<DbgMsg Msg="Status = [@state]" />
					<xsl:choose>
						<xsl:when expr="[@state $eq$ play]" >
							<ButtonState button="VideoPlayBtn" state="focus" />
							<ChangeState button="VideoPauseBtn" state="Normal" />
							<ButtonState button="VideoPauseBtn" state="Normal" />
							<ButtonState button="VideoStopBtn" state="Normal" />
						</xsl:when>
						<xsl:when expr="[@state $eq$ stop]" >
							<ButtonState button="VideoStopBtn" state="focus" />
							<ChangeState button="VideoPauseBtn" state="Disabled" />
							<ButtonState button="VideoPlayBtn" state="Normal" />
						</xsl:when>
						<xsl:when expr="[@state $eq$ pause]" >
							<ButtonState button="VideoPauseBtn" state="focus" />
							<ButtonState button="VideoPlayBtn" state="Normal" />
							<ButtonState button="VideoStopBtn" state="Normal" />
						</xsl:when>
					</xsl:choose>
				</ViewAction>	

				<ViewAction Name="MuteStatus">
					<DbgMsg Msg="MuteStatus = [@mute]" />
					<xsl:choose>
						<xsl:when expr="[@mute $eq$ on]" >
							<ButtonState button="VideoMuteBtn" state="focus" />
						</xsl:when>
						<xsl:otherwise >
							<ButtonState button="VideoMuteBtn" state="Normal" />
						</xsl:otherwise>
					</xsl:choose>
				</ViewAction>	

			</ViewActions>
		</View>
	</ViewController>
</Popup>
