Type.registerNamespace("ExpressionPlayer");ExpressionPlayer.UrlParam={startTime:"startTime",chapter:"chapter",loopCount:"loopCount",mediaSource:"mediaSource",volume:"volume",muted:"muted",duration:"duration",autoplay:"autoplay",autoload:"autoload",mediainfo:"mediainfo",fakeoutput:"fakeoutput"};ExpressionPlayer.Player=function(A){ExpressionPlayer.Player.initializeBase(this,[A])};ExpressionPlayer.Player.prototype={_fInitialized:false,_fakeOutput:"",_startButton:null,initialize:function(){ExpressionPlayer.Player.callBaseMethod(this,"initialize");var A=this.get_element().content;this.set_autoPlay($getArgument(ExpressionPlayer.UrlParam.autoplay,this.get_autoPlay().toString())==="true");this.set_autoLoad($getArgument(ExpressionPlayer.UrlParam.autoload,this.get_autoLoad().toString())==="true");this.set_mediaSource($getArgument(ExpressionPlayer.UrlParam.mediaSource,this.get_mediaSource()));this.set_mediainfo($getArgument(ExpressionPlayer.UrlParam.mediainfo,this.get_mediainfo()));this.set_muted($getArgument(ExpressionPlayer.UrlParam.muted,this.get_muted().toString())==="true");this.set_volume(parseFloat($getArgument(ExpressionPlayer.UrlParam.volume,this.get_volume())));this.set_fakeOutput($getArgument(ExpressionPlayer.UrlParam.fakeoutput,this.get_fakeOutput()));var B=$getArgument(ExpressionPlayer.UrlParam.chapter);if(B!==""){this.set_currentChapter(parseInt(B))}if(this.get_mediainfo()!==""){this._initMediainfo()}this._fInitialized=true},_meOpened:function(){ExpressionPlayer.Player.callBaseMethod(this,"_meOpened");this.set_position(parseFloat($getArgument(ExpressionPlayer.UrlParam.startTime,this.get_position())))},set_galleryInfo:function(D,C){if(this._gallery==null){var A=this.get_element().content.findName("GalleryArea");if(A!=null){var B=this.get_element().content.findName("GalleryToggleButton");this._gallery=new Sys.UI.Silverlight._ImageList(A,B,false,C,this)}}if(this._gallery!=null){this._gallery.set_items(D)}},get_mediainfo:function(){return this._mediainfo},set_mediainfo:function(A){this._mediainfo=A;if(this._fInitialized){this._initMediainfo()}},_initMediainfo:function(){if(typeof (this._mediainfo)==="function"){this.set_chapters(this._mediainfo().chapters);this.set_placeholderSource(this._mediainfo().placeholderSource);this.set_mediaSource(this._mediainfo().mediaSource)}else{if(this._mediainfo.mediaSource!=null){this.set_chapters(this._mediainfo.chapters);this.set_placeholderSource(this._mediainfo.placeholderSource);this.set_mediaSource(this._mediainfo.mediaSource)}else{throw Error.invalidOperation("unknown type for mediainfo")}}},set_fakeOutput:function(A){if("".length>0){this._fakeOutput=unescape(A);if(this._fakeOutput!=""){this.set_mediainfo({mediaSource:this._fakeOutput+"/sl.wmv",placeholderSource:this._fakeOutput+"/sl1.jpg",chapters:[new Sys.UI.Silverlight.MediaChapter("",1,this._fakeOutput+"/sl1.jpg"),new Sys.UI.Silverlight.MediaChapter("",2,this._fakeOutput+"/sl2.jpg"),new Sys.UI.Silverlight.MediaChapter("",4,this._fakeOutput+"/sl3.jpg")]})}}},get_fakeOutput:function(){return this._fakeOutput},set_timeIndex:function(A){if(this._mediaElement&&this._canSeek&&A>this._naturalduration){this._raiseEvent("mediaEnded",Sys.EventArgs.Empty)}else{ExpressionPlayer.Player.callBaseMethod(this,"set_position",[A])}},add_playPreviousVideo:function(A){this.get_events().addHandler("playPreviousVideo",A)},remove_playPreviousVideo:function(A){this.get_events().removeHandler("playPreviousVideo",A)},_onPrevious:function(){var B=this.get_chapters();var A=2;if(B!=null&&B.length>0){A=Math.min(A,B[0].get_position())}if(this.get_position()<A){this._raiseEvent("playPreviousVideo");return }ExpressionPlayer.Player.callBaseMethod(this,"_onPrevious")},add_playNextVideo:function(A){this.get_events().addHandler("playNextVideo",A)},remove_playNextVideo:function(A){this.get_events().removeHandler("playNextVideo",A)},_onNext:function(){var C=this.get_chapters();if(!C||!C.length){var D=Math.max(5,this._duration/10);var B=D+this.get_position();if(B>this._duration){this._raiseEvent("playNextVideo");return }}else{var A=C[C.length-1];if(A.get_position()<this.get_position()){this._raiseEvent("playNextVideo");return }}ExpressionPlayer.Player.callBaseMethod(this,"_onNext")}};ExpressionPlayer.Player._playerCount=0;ExpressionPlayer.Player._getUniqueName=function(A){return A+ExpressionPlayer.Player._playerCount++};ExpressionPlayer.Player.registerClass("ExpressionPlayer.Player",Sys.UI.Silverlight.MediaPlayer);ExpressionPlayer.GalleryItem=function(B,A){this._title=B;this._thumbnailSource=A;ExpressionPlayer.GalleryItem.initializeBase(this)};ExpressionPlayer.GalleryItem.prototype={get_thumbnailSource:function(){return this._thumbnailSource},get_title:function(){return this._title}};ExpressionPlayer.GalleryItem.registerClass("ExpressionPlayer.GalleryItem");ExpressionPlayer.ShowHideAnimationButton=function(B,D,A,C){var E=B.get_element().content.findName(D);ExpressionPlayer.ShowHideAnimationButton.initializeBase(this,[E,true,null,this._onToggle,null,this]);this._animOpen=A?B.get_element().content.findName(A+"_Show"):null;this._animClose=A?B.get_element().content.findName(A+"_Hide"):null;this._showing=!!C};ExpressionPlayer.ShowHideAnimationButton.prototype={_onToggle:function(){this._showing=!this._showing;if(this._showing&&this._animOpen){this._animOpen.begin()}if(!this._showing&&this._animClose){this._animClose.begin()}},dispose:function(){this._animOpen=null;this._animClose=null;ExpressionPlayer.ShowHideAnimationButton.callBaseMethod(this,"dispose")}};ExpressionPlayer.ShowHideAnimationButton.registerClass("ExpressionPlayer.ShowHideAnimationButton",Sys.UI.Silverlight._Button);ExpressionPlayer.HotspotButton=function(A,B){var C=A.get_element().content.findName(B);ExpressionPlayer.HotspotButton.initializeBase(this,[C,true,null,null,null,this]);this.timeoutId=0;this._showAnim=A.get_element().content.findName(B+"_MouseEnter");this._hideAnim=A.get_element().content.findName(B+"_MouseLeave")};ExpressionPlayer.HotspotButton.prototype={_onEnter:function(){this._showHideControls(true)},_onLeave:function(){this._showHideControls(false)},_showHideControls:function(A){if(this._timeoutId!=0){window.clearTimeout(this._timeoutId);this._timeoutId=0}if(!A){this._timeoutId=window.setTimeout(Function.createDelegate(this,this._hideControls),1000)}else{this._showControls()}},_hideControls:function(){if(this._controlsShowing){this._hideAnim.begin()}this._controlsShowing=false},_showControls:function(){if(!this._controlsShowing){this._showAnim.begin()}this._controlsShowing=true}};ExpressionPlayer.HotspotButton.registerClass("ExpressionPlayer.HotspotButton",Sys.UI.Silverlight._Button);function $getArgument(D,G){var F=window.location.search.substring(1);var E=F.split("&");var A=D.toLowerCase();for(var C=0;C<E.length;C++){var B=E[C].split("=");if(B[0].toLowerCase()===A){return unescape(B[1])}}if(typeof (G)!=="undefined"){return G}return""};