var Sx={Object:function(c,a){function b(){}b.prototype=c;var d=new b();if(a){Sx.mix(d,a)}return d},mix:function(c,b,d){for(var a in b){if(!(d&&c[a])){c[a]=b[a]}}return c},extend:function(e,d,b,a){var f=d.prototype;var c=Sx.Object(f);e.prototype=c;c.constructor=e;e.superclass=f;if(d!=Object&&f.constructor==Object.prototype.constructor){f.constructor=d}if(b){Sx.mix(c,b)}if(a){Sx.mix(e,a)}return e},Element:function(e,c){var b=window.document.createElement(e);for(var a in c){var d=Sx.Modifiers[a];if(d){d(b,c[a])}else{b.setAttribute(a,c[a])}}return b},Modifiers:{html:function(a,b){a.innerHTML=b},cls:function(a,b){Sx.addClass(a,b)},style:function(a,b){Sx.setStyle(a,b)}},_reCl:function(a){return new RegExp("(^|\\s)"+a+"(\\s|$)")},hasClass:function(b,a){return Sx._reCl(a).test(b.className)},addClass:function(c,a){if(!Sx.hasClass(c,a)){var b=c.className[0]!=" "?" ":"";c.className=a+b+c.className}},removeClass:function(b,a){b.className=b.className.replace(Sx._reCl(a),"$1")},changeClass:function(b,a){if(b._chgCl){Sx.removeClass(b,b._chgCl)}if(a){b._chgCl=a;Sx.addClass(b,a)}},setStyle:function(b,c){for(var a in c){b.style[a]=c[a]}},getPosition:function(a,b){var c={x:0,y:0};while(a&&a!=b){c.x+=a.offsetLeft;c.y+=a.offsetTop;a=a.offsetParent}return c},hide:function(a){a.style.display="none";return a},show:function(a){a.style.display="";return a},getElementsByClassName:function(b,a,f){var e;if(!f&&b.constructor&&b.constructor.prototype.getElementsByClassName){e=b.constructor.prototype.getElementsByClassName.call(b,a)}else{e=[];var g=Sx._reCl(a);var h=b.getElementsByTagName(f||"*");for(var c,d=0;c=h[d];d++){if(g.test(c.className)){e.push(c)}}}return e},findAll:function(c,a){var b=c.split(" ");return Sx._find(b,[a||window.document])},find:function(b,a){return this.findAll(b,a)[0]},_find:function(b,l){if(b.length==0){return l}var h=[];var g=b.shift();var e=g.split(".");for(var c,f=0;c=l[f];f++){var k;if(e[0]==""){k=Sx.getElementsByClassName(c,e[1])}else{if(e[0].charAt(0)=="#"){var a=e[0].slice(1);k=[c.getElementById(a)]}else{if(e[1]){k=Sx.getElementsByClassName(c,e[1],e[0])}else{k=c.getElementsByTagName(e[0])}}}if(!(k instanceof Array)){for(var d=0;d<k.length;d++){h.push(k[d])}}else{h.push.apply(h,k)}}return Sx._find(b,h)},replace:function(c,b){var a=c.parentNode;if(a){a.insertBefore(b,c);a.removeChild(c)}},remove:function(b){var a=b.parentNode;if(a){a.removeChild(b)}},addEvent:function(a,c,b){if(a.addEventListener){a.addEventListener(c,b,false)}else{a.attachEvent("on"+c,b)}},removeEvent:function(a,c,b){if(a.removeEventListener){a.removeEventListener(c,b,false)}else{a.detachEvent("on"+c,b)}},bind:function(a,c){var b=Array.prototype.slice.call(arguments,2);return function(){var d=b.concat(Array.prototype.slice.call(arguments,0));return a.apply(c||null,d)}},capitalize:function(a){return a.replace(/\b[a-z]/g,function(b){return b.toUpperCase()})},_xmlEntities:[["&","&amp;"],["'","&apos;"],['"',"&quot;"],["<","&lt;"],[">","&gt;"]],escapeXml:function(a){Sx._xmlEntities.forEach(function(b){a=a.replace(new RegExp(b[0],"g"),b[1])});return a},urlEncode:function(b){var c=[];for(var a in b){if(b[a]!=undefined){c.push(a+"="+encodeURIComponent(b[a]))}}return c.join("&")},extendUrl:function(b,c){var a=Sx.urlEncode(c);if(a){b+=(b.indexOf("?")>=0?"&":"?")+a}return b},doPost:function(c){var b=Sx.mix({method:"post",action:c.url},c.form);var d=window.document.body.appendChild(Sx.Element("form",b));for(var a in c.data){if(c.data[a]!=undefined){d.appendChild(Sx.Element("input",{type:"hidden",name:a,value:c.data[a]}))}}d.submit();window.document.body.removeChild(d)},buildSwfObject:function(d,c,a,f){c=c||{};f=f||{};f.flashvars=Sx.urlEncode(a);var e="swf"+Sx.genUid(4);if(!c.id){c.id=e}if(!c.name){c.name=e}if(Sx.isIE()){c.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";f.movie=d}else{c.data=d;c.type="application/x-shockwave-flash"}html_attrs=[];for(var b in c){html_attrs.push(b+'="'+c[b]+'"')}html_params=[];for(var b in f){html_params.push('<param name="'+b+'" value="'+f[b]+'"/>')}return"<object "+html_attrs.join(" ")+">"+html_params.join("")+"</object>"},removeSwf:function(a){if(a&&a.nodeName=="OBJECT"){if(Sx.isIE()){a.style.display="none";(function(){if(a.readyState==4){for(var b in a){if(typeof a[b]=="function"){a[b]=null}}a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.removeChild(a)}}},memoize:function(b,c){var a;return function(){return(a!=undefined)?a:(a=b.call(c||window))}}};Sx.isIE=Sx.memoize(function(){return navigator.userAgent.match(/MSIE/)!=null});Sx.isIE6=Sx.memoize(function(){return navigator.userAgent.match(/MSIE 6.0/)!=null});Sx.isIE7=Sx.memoize(function(){return navigator.userAgent.match(/MSIE 7.0/)!=null});Sx.isIpad=Sx.memoize(function(){return navigator.userAgent.match(/iPad/i)!=null});Sx.isMobileSafari=Sx.memoize(function(){return navigator.userAgent.match(/Apple.*Mobile.*Safari/)!=null});Sx.Array={forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this)}},map:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this)}return c},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b])}}return c},indexOf:function(c){var a=this.length;for(var b=0;b<a;b++){if(this[b]===c){return b}}return -1}};Sx.mix(Array.prototype,Sx.Array,true);Sx.Controller={addListener:function(b,a){if(!this._listeners){this._listeners=[]}this._listeners.push({listener:b,name:a||""});return this},removeListener:function(b,a){if(!this._listeners){return}this._listeners=this._listeners.filter(function(d){var c=d.listener==b;if(a){c&=d.name==a}return !c})},setDelegate:function(b,a){if(this._delegate){this.removeListener(this._delegate)}this.addListener(b,a);this._delegate=b;return this},fire:function(a,g){if(!this._listeners){return}for(var e,d=0;e=this._listeners[d];d++){var f=e.listener;var c=Sx.capitalize(e.name);var h="on"+c+"All";var b="on"+c+Sx.capitalize(a);if(f[h]){f[h](b,this,g)}else{if(f[b]){f[b](this,g)}}}}};Sx.Url=function(a){if(a){this.parse(a)}};Sx.mix(Sx.Url.prototype,{parse:function(b){var e=b.split("?");this.base=e[0];this.params={};var a=e[1];if(a){var g=a.split("&");for(var f,c=0;f=g[c];c++){var d=f.split("=");this.params[d[0]]=decodeURIComponent(d[1])}}},toString:function(){var a=Sx.urlEncode(this.params);return this.base+(a?"?"+a:"")}});Sx.Template=function(a){this._tpl=a};Sx.mix(Sx.Template.prototype,{render:function(c){var b=new String(this._tpl);for(var a in c){b=b.replace(new RegExp("{{"+a+"}}","g"),c[a])}return b}});Sx.Duration=function(a){this.hour=Math.floor(a/3600);this.minutes=Math.floor(a%3600/60);this.seconds=Math.floor(a%60)};Sx.Duration.prototype={reduced:function(){return(this.hour?this.hour+":":"")+String(100+this.minutes).slice(1)+":"+String(100+this.seconds).slice(1)},full:function(){return(this.hour?this.hour+"h ":"")+(this.minutes?this.minutes+"min ":"")+this.seconds+"s"}};Sx.fixUrl=function(a){if(a.search(/^https?:\/\//)<0){var d=window.location;if(a.charAt(0)!="/"){var c=d.pathname.split("/");c.pop();var b=c.join("/")+"/";if(a.slice(0,2)=="./"){a=b+a.slice(2)}else{a=b+a}}a=d.protocol+"//"+d.host+a}return a};Sx.genUid=function(d,a){d=d||32;a=a||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var c="";for(var b=0;b<d;b++){c+=a.charAt(Math.floor(Math.random()*a.length))}return c};Sx.Callbacks={_idx:0,register:function(b){var a="_"+this._idx++;this[a]=function(c){b(c);delete Sx.Callbacks[a]};return"Sx.Callbacks."+a}};Sx.Get=function(c){var d=this;var e=Sx.Callbacks.register(function(f){if(!d._stopped&&c.onComplete){c.onComplete(f)}document.body.removeChild(a)});var b=new Sx.Url(c.url);Sx.mix(b.params,c.data);b.params.callback=e;var a=Sx.Element("script",{src:b.toString()});document.body.appendChild(a)};Sx.Post=function(a){var d="sx_iframe_"+Sx.Callbacks._idx++;var b=Sx.Element("div",{html:'<iframe name="'+d+'" style="display:none" src=""/>'}).firstChild;document.body.appendChild(b);var c=this;Sx.addEvent(b,"load",function(){if(!c._stopped&&a.onComplete){a.onComplete()}setTimeout(function(){document.body.removeChild(b)},0)});a.form=a.form||{};a.form.target=d;Sx.doPost(a)};Sx.Get.prototype=Sx.Post.prototype={stop:function(){this._stopped=true}};Sx.Video=function(c,b){var a,d=Sx.Element("video");if(d.play){if(d.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2')){a=Sx.Html5Player}}if(!a||b){a=Sx.FlvPlayer}return new a(c,"video")};Sx.Audio=function(c,b){var a,d=Sx.Element("audio");if(d.play){if(d.canPlayType("audio/mpeg")){a=Sx.Html5Player}}if(!a||b){a=Sx.FlvPlayer}return new a(c,"audio")};Sx.SwfManager={_uid:0,getUid:function(){return"swf"+this._uid},register:function(b){var a=this.getUid();this._uid++;this[a]=b;return"Sx.SwfManager."+a}};Sx.FlvPlayer=function(a){this._delayedCalls=[];this.addListener(this);var b=Sx.buildSwfObject("http://static.stupeflix.com/player/1.1/assets/player.swf",{id:Sx.SwfManager.getUid(),width:"100%",height:"100%"},{jshandler:Sx.SwfManager.register(this)+".fire"},{allowfullscreen:"true",allowscriptaccess:"always",wmode:"transparent"});a.innerHTML=b;this._player=a.firstChild};Sx.mix(Sx.FlvPlayer.prototype,Sx.Controller);Sx.mix(Sx.FlvPlayer.prototype,{swfCall:function(){this._delayedCalls.push(arguments)},_swfCall:function(){return this._player.callMethod.apply(this._player,arguments)},makeDelayedCalls:function(){this.swfCall=this._swfCall;var a;while(a=this._delayedCalls.shift()){this.swfCall.apply(this,a)}},onInit:function(){this.makeDelayedCalls()},onMediaPlayerStateChange:function(a,b){switch(b.state){case"ready":if(this._loaded){this.fire("end")}else{setTimeout(Sx.bind(function(){this.fire("ready")},this),0);this._loaded=true}break;case"playing":this.fire("play");break;case"paused":this.fire("pause");break}},onBytesLoadedChange:function(a,b){this.fire("progress")},onCurrentTimeChange:function(a,b){this.fire("timeUpdate")},getProgress:function(){var b=this.swfCall("get","bytesTotal");var a=this.swfCall("get","bytesLoaded");return(a/b)||0},getDisplay:function(){return this._player},getDuration:function(){return this.swfCall("get","duration")},getCurrentTime:function(){return this.swfCall("get","currentTime")},isPaused:function(){return this.swfCall("get","paused")},isMuted:function(){return this.swfCall("get","muted")},load:function(b,a){this._loaded=false;this.swfCall("loadURL",b,a)},play:function(){this.swfCall("play")},pause:function(){this.swfCall("pause")},seek:function(a){if(this.swfCall("get","canSeek")){this.swfCall("seek",a)}},mute:function(a){this.swfCall("set","muted",a!=undefined?a:true)},setVolume:function(a){this.swfCall("set","volume",a)},setAutoPlay:function(a){this.swfCall("set","autoPlay",a)}});Sx.Html5Player=function(a,b){this._player=a.appendChild(Sx.Element(b||"video"));Sx.addEvent(this._player,"loadedmetadata",Sx.bind(this.fire,this,"loadedMetadata"));Sx.addEvent(this._player,"progress",Sx.bind(this.fire,this,"progress"));Sx.addEvent(this._player,"canplay",Sx.bind(this.onPlayerCanPlay,this));Sx.addEvent(this._player,"play",Sx.bind(this.fire,this,"play"));Sx.addEvent(this._player,"pause",Sx.bind(this.fire,this,"pause"));Sx.addEvent(this._player,"timeupdate",Sx.bind(this.fire,this,"timeUpdate"));Sx.addEvent(this._player,"ended",Sx.bind(this.fire,this,"end"))};Sx.mix(Sx.Html5Player.prototype,Sx.Controller);Sx.mix(Sx.Html5Player.prototype,{onPlayerCanPlay:function(){this._loaded=true;this.fire("ready")},getProgress:function(){var a=this._player.buffered;return a.length?a.end(0)/this.getDuration():0},getDisplay:function(){return this._player},getCurrentTime:function(){return this._player.currentTime},getDuration:function(){return this._player.duration||0},isPaused:function(){return this._player.paused},isMuted:function(a){return this._player.muted},load:function(a){this._loaded=false;this._player.src=a;this._player.load()},play:function(){this._player.play()},pause:function(){this._player.pause()},seek:function(a){this._player.currentTime=a},mute:function(a){this._player.muted=(a!=undefined?a:true)},setAutoPlay:function(a){this._player.autoplay=a}});Sx.Event=function(b){if(b instanceof Sx.Event){return b}this.event=b;this.type=b.type;this.target=b.target||b.srcElement;if(this.type.match(/(click|mouse|menu)/i)){var a=Sx.find("html");this.pageX=b.pageX||b.clientX+a.scrollLeft;this.pageY=b.pageY||b.clientY+a.scrollTop}};Sx.mix(Sx.Event.prototype,{stop:function(){return this.preventDefault().stopPropagation()},stopPropagation:function(){this.event.stopPropagation?this.event.stopPropagation():(this.event.cancelBubble=false);return this},preventDefault:function(){this.event.preventDefault?this.event.preventDefault():(this.event.returnValue=false);return this}});Sx.Drag=function(a){this.document=window.document;this.bound={dragStart:Sx.bind(this.dragStart,this),drag:Sx.bind(this.drag,this),dragEnd:Sx.bind(this.dragEnd,this)};Sx.addEvent(a,"mousedown",this.bound.dragStart)};Sx.mix(Sx.Drag.prototype,Sx.Controller);Sx.mix(Sx.Drag.prototype,{dragStart:function(a){a=new Sx.Event(a);Sx.addEvent(this.document,"mousemove",this.bound.drag);Sx.addEvent(this.document,"mouseup",this.bound.dragEnd);this.deltaX=0;this.deltaY=0;this.event=a;a.preventDefault();this.fire("dragStart",this)},drag:function(a){a=new Sx.Event(a);this.deltaX=a.pageX-this.event.pageX;this.deltaY=a.pageY-this.event.pageY;this.event=a;this.fire("drag",this);return false},dragEnd:function(a){Sx.removeEvent(this.document,"mousemove",this.bound.drag);Sx.removeEvent(this.document,"mouseup",this.bound.dragEnd);this.event=new Sx.Event(a);this.fire("dragEnd",this)}});Sx.StateManager=function(){this._state=[];this._initialized={}};Sx.mix(Sx.StateManager.prototype,{setState:function(a){if(!this.hasState(a)||this._state.length>1){var b;while(b=this._state.shift()){this._unloadState(b)}return this.addState(a)}},addState:function(a){if(!this.hasState(a)){this._state.unshift(a);this._loadState(a)}},removeState:function(b){var a=this._state.indexOf(b);if(a>=0){this._state.splice(a,1);this._unloadState(b)}},hasState:function(a){return this._state.indexOf(a)>=0},_loadState:function(a){var b=this.getState(a);if(!this._initialized[a]){if(b._init){b._init.call(this)}this._initialized[a]=true}if(b._load){b._load.call(this)}},_unloadState:function(a){var b=this.getState(a);if(b._unload){b._unload.call(this)}},getState:function(a){},call:function(a){for(var c,d=0;c=this._state[d];d++){var e=this.getState(c);if(e[a]){var b=Array.prototype.slice.call(arguments,1);return e[a].apply(this,arguments)}}throw"UnknowMethod"},dispatchEvent:function(a){try{this.call.apply(this,arguments)}catch(c){if(this[a]){var b=Array.prototype.slice.call(arguments,1);this[a].apply(this,b)}}}});Sx.Player=function(b,d,a,c){Sx.Player.superclass.constructor.call(this);if(typeof(b)=="string"){b=window.document.getElementById(b)}if(Sx.isMobileSafari()){return new Sx.MobilePlayer(b,d,a,c)}this.view=b.appendChild(Sx.Element("div",{cls:"SxPlayer"+(Sx.isIE()?" SxPlayerIE":""),style:{width:typeof(d)=="number"?d+"px":d,height:typeof(a)=="number"?a+"px":a}}));this.options=c;this.options.file=Sx.fixUrl(c.file);if(!this.options.actions){this.options.actions=[["Replay",function(e){e.play()}]]}this.setState("stopped")};Sx.extend(Sx.Player,Sx.StateManager);Sx.mix(Sx.Player.prototype,Sx.Controller);Sx.mix(Sx.Player.prototype,{getState:function(a){return Sx.Player.State[a]},$:function(a){return Sx.find(a,this.view)},proxy:function(a){if(!this._bound){this._bound={}}return this._bound[a]||(this._bound[a]=Sx.bind(this[a],this))},buildCmdBar:function(){this.cmdBar=this.view.appendChild(Sx.Element("div",{cls:"cmdBar",html:['<div class="seekBar">','<div class="loadBar"></div>','<div class="playBar"></div>',"</div>",'<div class="btnBar">','<div class="bt playBtn"><span></span></div>','<div class="bt volumeBtn"><span></span></div>','<div class="timeSpan"></div>',"</div>",].join("")}));Sx.addEvent(this.view,"mousemove",this.proxy("onMouseMove"));Sx.addEvent(this.view,"mouseout",this.proxy("_hiddle"));Sx.addEvent(this.$(".btnBar"),"click",this.proxy("onBtnBarClick"));new Sx.Drag(this.$(".seekBar")).addListener(this,"seekBar")},_refreshReadBar:function(b){var c=this.video.getDuration();var a=Math.round(100*b/c)+"%";this.$(".playBar").style.width=a;this.$(".timeSpan").innerHTML=new Sx.Duration(b).reduced()+" / "+new Sx.Duration(c).reduced()},_refreshProgressBar:function(){this._progress=this.video.getProgress();this.$(".loadBar").style.width=(this._progress*100)+"%"},_hiddle:function(){Sx.addClass(this.view,"hiddle")},play:function(){this.call("play")},pause:function(){this.call("pause")},stop:function(){this.setState("stopped")},onVideoAll:function(a,b,c){this.dispatchEvent(a,b,c)},onVideoProgress:function(a){this._refreshProgressBar()},onVideoTimeUpdate:function(a){this._refreshReadBar(this.video.getCurrentTime());this._refreshProgressBar()},onMouseMove:function(){Sx.removeClass(this.view,"hiddle");clearTimeout(this._hiddleTimer);this._hiddleTimer=setTimeout(this.proxy("_hiddle"),2000)},onBtnBarClick:function(d){d=new Sx.Event(d);var b,c=d.target;while(c!=this.cmdBar&&!b){if(Sx.hasClass(c,"bt")){b=c}c=c.parentNode}if(b){var f=b.className.split(" ")[1];var a="on"+Sx.capitalize(f)+"Click";this.dispatchEvent(a,b,d)}},onVolumeBtnClick:function(){var a=this.video.isMuted();Sx[a?"removeClass":"addClass"](this.view,"muted");this.video.mute(!a)},onSeekBarDragStart:function(b){var a=this.hasState("playing");if(a){Sx.addClass(this.$(".cmdBar .playBtn"),"playing")}this._resumePlay=this.hasState("ended")||a;this.video.pause();this.addState("seeking");var c=Sx.getPosition(this.$(".seekBar"));this._x=b.event.pageX-c.x;this.onSeekBarDrag(b)},onSeekBarDrag:function(a){this._x+=a.deltaX;var b=Math.min(Math.max(this._x/this.$(".seekBar").offsetWidth,0),this._progress);var c=b*this.video.getDuration();this.video.seek(c);this._refreshReadBar(c);if(b<1){this.video.fire("unend")}},onSeekBarDragEnd:function(){this.removeState("seeking");Sx.removeClass(this.$(".cmdBar .playBtn"),"playing");if(this._resumePlay&&!this.hasState("ended")){this.video.play()}}});Sx.Player.State={};Sx.Player.State.stopped={_init:function(){this.poster=new Sx.Player.Poster(this.options.image);Sx.addEvent(this.poster.view,"click",this.proxy("play"))},_load:function(){if(this.video){this.video.pause();this.video.seek(0);this._refreshReadBar(0)}Sx.addClass(this.view,"stopped");this.view.appendChild(this.poster.view)},_unload:function(){Sx.removeClass(this.view,"stopped");this.view.removeChild(this.poster.view)},play:function(){this.setState("loading")},pause:function(){}};Sx.Player.State.loading={_init:function(){this.container=this.view.appendChild(Sx.Element("div",{cls:"videoContainer"}));this.video=new Sx.Video(this.container,Sx.isIE()?true:false).addListener(this,"video");this.buildCmdBar();this.loadingSlate=Sx.Element("div",{cls:"slate loadingSlate"});this.loadingSlate.appendChild(Sx.Element("div",{cls:"content",html:"Loading..."}));this.video.load(this.options.file)},_load:function(){Sx.addClass(this.view,"loading");this.view.appendChild(this.loadingSlate);if(this.video._loaded){this.video.play()}},_unload:function(){Sx.removeClass(this.view,"loading");this.view.removeChild(this.loadingSlate)},play:function(){},pause:function(){},onVideoReady:function(){this.video.play()},onVideoPlay:function(){this.setState("paused");this.addState("playing")},};Sx.Player.State.paused={play:function(){this.video.play()},pause:function(){},onPlayBtnClick:function(){this.call("play")},onVideoPlay:function(){this.addState("playing")},onVideoPause:function(){this.removeState("playing")},onVideoEnd:function(){this.addState("ended");this.video.pause()},onVideoUnend:function(){this.removeState("ended")}};Sx.Player.State.playing={_load:function(){this.onMouseMove();Sx.addClass(this.view,"playing")},_unload:function(){Sx.removeClass(this.view,"playing")},pause:function(){this.video.pause()},onPlayBtnClick:function(){this.call("pause")}};Sx.Player.State.ended={_init:function(){this.endSlate=Sx.Element("div",{cls:"slate endSlate"});var b=this.endSlate._content=this.endSlate.appendChild(Sx.Element("div",{cls:"content"}));var a=this;this.options.actions.forEach(function(e){var d=b.appendChild(Sx.Element("button",{type:"button",cls:e[3]||"",html:e[0]}));var c=e[1];if(!(c instanceof Function)){c=function(){window.top.location=e[1]}}Sx.addEvent(d,"click",function(){c(a)})})},_load:function(){Sx.addClass(this.view,"ended");this.view.appendChild(this.endSlate);this.endSlate._content.style.marginTop=-this.endSlate._content.offsetHeight/2+"px";this.fire("ended")},_unload:function(){Sx.removeClass(this.view,"ended");this.view.removeChild(this.endSlate)},play:function(){this.video.seek(0);this.video.fire("unend");this._refreshReadBar(0);this.video.play()},onPlayBtnClick:function(){this.call("play")}};Sx.Player.State.seeking={_load:function(){Sx.addClass(this.view,"seeking")},_unload:function(){Sx.removeClass(this.view,"seeking")},onVideoTimeUpdate:function(){}};Sx.Player.Poster=function(a){this.view=Sx.Element("div",{cls:"slate poster"});this.image=this.view.appendChild(Sx.Element("img"));this.view.appendChild(Sx.Element("div",{cls:"coat"}));Sx.addEvent(this.image,"load",Sx.bind(this.onImageLoaded,this));if(a){this.setImage(a)}};Sx.mix(Sx.Player.Poster.prototype,{setImage:function(a){Sx.addClass(this.view,"loading");this.image.src=a},onImageLoaded:function(){Sx.removeClass(this.view,"loading")}});Sx.MobilePlayer=function(b,e,a,d){var c=Sx.Element("div");c.appendChild(Sx.Element("video",{cls:"SxPlayer",src:d.file,poster:d.image,width:e,height:a,controls:true,"x-webkit-airplay":"allow"}));b.innerHTML=c.innerHTML;this.view=this.video=b.firstChild};
