var existingVideo=false,existingVideoSrc=false,playExistingVideo=false,languageJsonComplete=false,movieJsonLoaded=false,movieJsonComplete=false,ac_media_language=false,initializedCP=false; var MediaLanguage={translationDictionary:{"de-AT":"de-AT.json","de-CH":"de-CH.json","de-DE":"de-DE.json","dk-DK":"dk-DK.json",en:"en.json","en-US":"en-US.json","en-AP":"en-AP.json","en-CA":"en-CA.json","en-GB":"en-GB.json","en-HK":"en-HK.json","en-IE":"en-IE.json","en-IN":"en-IN.json","en-KR":"en-KR.json","en-AU":"en-AU.json","en-NZ":"en-NZ.json","en-SG":"en-SG.json","en-ZA":"en-ZA.json",es:"es.json","es-LA":"es-LA.json","es-MX":"es-MX.json","es-ES":"es-ES.json","fi-FI":"fi-FI.json",fr:"fr.json","fr-BE":"fr-BE.json","fr-CA":"fr-CA.json","fr-CH":"fr-CH.json","fr-FR":"fr-FR.json","it-IT":"it-IT.json",ja:"ja.json","ja-JP":"ja-JP.json","ko-KR":"ko-KR.json","nl-BE":"nl-BE.json","nl-NL":"nl-NL.json","no-NO":"no-NO.json","pl-PL":"pl-PL.json",pt:"pt.json","pt-BR":"pt-BR.json","pt-PT":"pt-PT.json","ru-RU":"ru-RU.json","se-SE":"se-SE.json",zh:"zh.json","zh-CN":"zh-CN.json","zh-HK":"zh-HK.json","zh-TW":"zh-TW.json"},getLangFromAttr:function(a){if(!a){return"en-US" }switch(a.toLowerCase()){case"de-at":return"de-AT";case"de-ch":return"de-CH";case"de-de":return"de-DE"; case"dK-dk":return"dK-DK";case"en-us":return"en-US";case"en-ca":return"en-CA";case"en-ap":return"en-AP"; case"en-au":return"en-AU";case"en-gb":return"en-GB";case"en-hk":return"en-HK";case"en-ie":return"en-IE"; case"en-in":return"en-IN";case"en-nz":return"en-NZ";case"en-sg":return"en-SG";case"en-kr":return"en-KR"; case"en-za":return"en-ZA";case"es-es":return"es-ES";case"es-419":case"es-la":return"es-LA"; case"es-mx":return"es-MX";case"fi-fi":return"fi-FI";case"fr-be":return"fr-BE";case"fr-ca":return"fr-CA"; case"fr-ch":return"fr-CH";case"fr-fr":return"fr-FR";case"it-it":return"it-IT";case"ja-jp":return"ja-JP"; case"ko-kr":return"ko-KR";case"nl-be":return"nl-BE";case"nl-nl":return"nl-NL";case"no-no":return"no-NO"; case"pl-pl":return"pl-PL";case"pt":case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT"; case"ru-ru":return"ru-RU";case"se-se":return"se-SE";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK"; case"zh-tw":return"zh-TW";default:return a}},getTranslations:function(c){var b=document.getElementsByTagName("html").item(0),a=b.getAttribute("lang"),e=this.getLangFromAttr(a),d=this.langDictionary(e); new Ajax.Request("/global/scripts/ac_media_languages/"+d,{method:"get",requestHeaders:{Accept:"application/json"},onSuccess:function(f){ac_media_language=new Function("return "+f.responseText)() }.bind(this),onComplete:function(){languageJsonComplete=true;if(c&&typeof c.translationDidLoad==="function"){c.translationDidLoad() }},evalJS:false})},langDictionary:function(a){var c=a.toLowerCase().split("-")[0],b=this.translationDictionary[a]||false; if(!b){b=this.translationDictionary[c]}if(!b){b=this.translationDictionary.en}return b }};var Media={VERSION:"3.5",MIN_QUICKTIME_VERSION:"7.4",CAPTIONS_NS:"http://www.w3.org/2006/04/ttaf1",create:function(b,a,m){var e,l,j,f,c=true,k=true,d=true,i=AC.Detector.isiPad(); movieJsonLoaded=false;movieJsonComplete=false;languageJsonComplete=false;switch(true){case Media.Detection.Firefox():Element.addClassName(b,"mozilla"); break;case Media.Detection.Opera():Element.addClassName(b,"opera");break;case Media.Detection.IE():Media._createEventSource(); break;default:break}if(m.target==="quicktimeplayer"){m.spec="qt"}if(m.spec){switch(m.spec){case"qt":c=false; d=false;break;case"video":case"audio":k=false;d=false;break;case"sbvdp":c=false; k=false;break;default:break}}var g=(Media.Detection.Mobile())?Media.Detection.iPhoneOSVersion():null; if(g&&g[0]<3){c=false;k=true}switch(true){case (i||(c&&Media._isHTML5VideoAvailable()&&!Media.Detection.Firefox()&&!Media.Detection.Mobile()&&!Media.Detection.Chrome()&&!Media.Detection.Opera())):if(m.audio==true&&typeof Media.Spec.Audio!==undefined){return h(Media.Spec.Audio) }return h(Media.Spec.Video);break;case (k&&Media._isQuickTimeAvailable(Media.MIN_QUICKTIME_VERSION)):case Media.Detection.Mobile():return h(Media.Spec.QuickTime); break;case (d&&Media._isSBVDPAvailable(Media.MIN_SBVDP_VERSION)):return h(Media.Spec.SBVDP); break;case Media._shouldShowDownloadPrompt():default:Media.createDownloadPrompt(b,a,m); break}function h(r){f=Media.Controller(b);if(m.disableSizeSelector){f.disableSizeSelector=m.disableSizeSelector }e=r.create(b,a,m);l=Media.VideoInterface(e,f);if(i&&(m.autoplay===true||m.autostart===true)){e.forcePlay() }var n=r.eventsToRegister;for(var q in n){var o=n[q].name||n[q],p=n[q].callback; l.registerEvent(q,o,p)}if(r.pollForChanges){l.pollForChanges(r.pollForChanges)}if(r.interfaceMethods){l.override(r.interfaceMethods) }l.setup();f.setVideo(l);f.setVideoSrc(a);f.configureSettingsControls(a);f.container=b; f.movieLoadingPanelClass="movie-loading-panel";if(typeof m.width!="undefined"&&typeof m.height!="undefined"){if(typeof f.currentWidth=="undefined"&&typeof f.currentHeight=="undefined"){f.currentWidth=m.width; f.currentHeight=m.height}f.movieLoadingPanelClass="movie-loading-panel_"+m.width+"x"+m.height }Element.addClassName(b,f.movieLoadingPanelClass);if(AC.Detector.isWin()&&Media.Detection.Chrome()){Element.addClassName(b,"winchrome") }return f}return false},createDownloadPrompt:function(a,h,d){Element2.Methods.removeAllChildNodes(a); var e=document.createElement("a"),f=document.createElement("span"),g=document.createElement("span"),c=document.createElement("span"),b=d.downloadUrl||ac_media_language.downloadquicktimeurl||"http://www.apple.com/quicktime/download/"; Element.addClassName(e,"quicktime-download");if(typeof d.width!=="undefined"&&typeof d.height!=="undefined"){Element.addClassName(e,"size"+d.width+"x"+d.height) }e.setAttribute("href",b);Element.addClassName(f,"quicktime-download-title");Element.addClassName(g,"quicktime-download-text"); Element.addClassName(c,"quicktime-download-button");f.innerHTML=d.downloadTitle||ac_media_language.downloadquicktimetitle||"Get QuickTime."; g.innerHTML=d.downloadText||ac_media_language.downloadquicktimetext||"Download QuickTime to view this video.
QuickTime is free for Mac + PC."; c.innerHTML=d.downloadButton||ac_media_language.downloadquicktimebutton||"Download"; e.appendChild(f);e.appendChild(g);e.appendChild(c);a.appendChild(e);if("fire" in Element){Element.fire(document.body,"QuickTime:noCompatibleQTAvailable",{controller:this,minVersion:Media.MIN_QUICKTIME_VERSION}) }return e},_isHTML5VideoAvailable:function(){return Media.Detection.HTML5()},_isQuickTimeAvailable:function(){return Media.Detection.QuickTime(Media.MIN_QUICKTIME_VERSION) },_isSBVDPAvailable:function(){return Media.Detection.SBVDP(Media.MIN_SBVDP_VERSION) },_shouldShowDownloadPrompt:function(){return !Media.Detection.Mobile()},_createEventSource:function(){var c="qt_event_source",b,a; if(document.getElementById(c)){return}b=document.createElement("object");b.id=c; b.setAttribute("clsid","CB927D12-4FF7-4a9e-A169-56E4B8A75598");a=document.getElementsByTagName("head")[0]; a.appendChild(b)}};Media.Detection={HTML5:function(){if(!("HTMLMediaElement" in window)){return false }var a=document.createElement("video");return(a.canPlayType&&a.canPlayType("video/mp4")!=="") },QuickTime:function(a){return AC.Detector.isValidQTAvailable(a)},SBVDP:function(a){return AC.Detector.isSBVDPAvailable(a) },Mobile:function(){return(AC.Detector.isiPad())?true:AC.Detector.isMobile()},iPhoneOSVersion:function(){return AC.Detector.iPhoneOSVersion() },iPad:function(){return AC.Detector.isiPad()},Safari:function(){return AC.Detector.isSafari2() },IE:function(){return AC.Detector.isIEStrict()},Firefox:function(){return AC.Detector.isFirefox() },Opera:function(){return AC.Detector.isOpera()},Chrome:function(){return AC.Detector.isChrome() },SnowLeopard:function(){return AC.Detector.isSnowLeopard()},SnowLeopard1062:function(){var c=AC.Detector.getAgent(),b=c.match(/mac\sos\sx\D*([\.\w]*)/i),a=false; if(b&&b[1]){a=b[1]}return(AC.Detector.isWebKit()&&(a==="10_6_2"||a==="10_6_1"||a==="10_6")) },CSSTransitions:function(){try{var a=document.createElement("div").style;a.setProperty("-webkit-transition","inherit",null); a.setProperty("-moz-transition","inherit",null);a.setProperty("-o-transition","inherit",null); a.setProperty("transition","inherit",null);return(a.getPropertyValue("-webkit-transition")=="inherit"||a.getPropertyValue("-moz-transition")=="inherit"||a.getPropertyValue("-o-transition")=="inherit"||a.getPropertyValue("transition")=="inherit") }catch(b){return false}},CSSBorderRadius:function(){try{var a=document.createElement("div").style; a.setProperty("-webkit-border-radius","inherit",null);a.setProperty("-moz-border-radius","inherit",null); a.setProperty("-o-border-radius","inherit",null);a.setProperty("border-radius","inherit",null); return(a.getPropertyValue("-webkit-border-radius").match("inherit")||a.getPropertyValue("-moz-border-radius").match("inherit")||a.getPropertyValue("-o-border-radius").match("inherit")||a.getPropertyValue("border-radius").match("inherit")) }catch(b){return false}}};Media.Spec={Video:{create:function(b,a,l){var e=(l&&l.audio)?"audio":"video",d,i=(a.indexOf("?")>0)?a.substring(0,a.lastIndexOf("?")):a,h,k=i.lastIndexOf("."),j=(k>0)?i.substring(k+1,a.length):null,g="video/mp4"; if(j){j=j.split("#")[0];g=e+"/"+j}if(!AC.Detector.isiPad()&&existingVideo!=false){if(existingVideoSrc==i){d=existingVideo; b.appendChild(d);playExistingVideo=true;return d}else{existingVideoSrc=false}}d=document.createElement(e); h=document.createElement("source");d.playerType=e;if((d.playerType==="video"&&(d.canPlayType("video/mp4")||d.canPlayType("application/x-mpegURL")))||(d.playerType==="audio"&&(((AC.Detector.isWebKit()||AC.Detector.isMobile()||AC.Detector.isiPad())&&j==="mov")||d.canPlayType(g)))){if(d.playerType==="video"){g="video/mp4" }var c=l.id||(b.id?b.id+"_video":""),f=(a.indexOf("?")>0)?a.substring(a.lastIndexOf("."),a.lastIndexOf("?")):a.substring(a.lastIndexOf("."),a.length); d.setAttribute("id",c);Element.addClassName(d,d.playerType);if(d.playerType==="video"){h.setAttribute("src",i); switch(f){case".m3u8":d.setAttribute("src",a);break;default:h.setAttribute("type",g); d.appendChild(h);break}}else{d.setAttribute("src",a)}this._configure(d,i,l);Event.observe(window,"unload",function(){try{d.stop() }catch(m){}d.style.display="none";d=null});b.appendChild(d);existingVideoSrc=i; existingVideo=d}else{d=this._createFallback(b,a,l)}return d},eventsToRegister:{load:"load",loadedmetadata:"loadedmetadata",timeupdate:"timeupdate",durationchange:"durationchange",progress:"progress",playing:"playing",play:"play",pause:"pause",ended:"ended"},_captions:null,interfaceMethods:{readystate:function(){return this.readyState },autoplay:function(){return this.autoplay},duration:function(){return this.duration },time:function(){if(!this.webkitClosedCaptionsVisible&&this._captionsEnabled===true){if(typeof Media.Spec.Video._captions!=="undefined"){var k=Media.Spec.Video._captions.getElementsByTagName("p"); if(k.length>0){var m="";function g(q){var p=0;if(q){var n=q.split(":");switch(n.length){case 3:for(var o=0; o<3;o++){p=p*60+parseFloat(n[o].replace(",","."))}break;case 4:for(var o=0;o<3; o++){p=p*60+parseFloat(n[o].replace(",","."))}break;default:break}}return p}for(var j=0,a; a=k[j];j++){var e=g(a.getAttribute("begin")),f=g(a.getAttribute("end"));if(this.currentTime=e&&this.currentTime"+b.nodeValue+""}}if(l===""){this.trackTextSpan.style.display="none" }else{this.trackTextSpan.style.display="inline-block";this.trackTextSpan.innerHTML=l }}}}}return this.currentTime},setTime:function(a){this.currentTime=a},volume:function(){return this.volume },setVolume:function(a){this.volume=a},muted:function(){return this.muted},setMuted:function(a){this.muted=a },rate:function(){return this.playbackRate},setRate:function(a){this.playbackRate=a },defaultRate:function(){return this.defaultPlaybackRate},src:function(){return this.src },setSrc:function(a){this.src=a},status:function(){return this.status},percentLoaded:function(){var a=0; try{a=this.buffered.end(0)/this.duration}catch(b){}return a},pause:function(){this.pause() },play:function(){this.play()},paused:function(){return this.paused},ended:function(){return this.ended },timeScale:function(){return 2997},movieType:function(){return"Video"},getContainer:function(){return this.parentNode },setTrackTextSpan:function(a){this.trackTextSpan=a},setCaptionsAvailable:function(b,a){if((typeof Media.Spec.Video._captions!="undefined"&&Media.Spec.Video._captions!=null)||typeof this.webkitClosedCaptionsVisible!="undefined"){b(); return}var c;if(a.match(/\w+:\/\//i)){a=a.replace(/\w+:\/\/[^\/]+/i,"")}new Ajax.checkURL(a,b); c=document.createElement("text");c.setAttribute("type","application/ttaf+xml"); c.setAttribute("src",a);this.appendChild(c);new Ajax.Request(a,{method:"get",requestHeaders:{Accept:"application/ttaf+xml"},onSuccess:function(d){var e=d.responseXMLValue().documentElement; if(AC.Detector.isIEStrict()){e=e.ownerDocument}var f=e.getAttribute("xml:lang"); c.setAttribute("lang",f);Media.Spec.Video._captions=e.getElementsByTagNameNS(Media.CAPTIONS_NS,"body").item(0); Media.Spec.Video._captions.currentIndex=0}.bind(this),onFailure:function(){},onException:function(){},onCreate:function(d){d.request.overrideMimeType("application/ttaf+xml") }})},enableCaptions:function(){var a=this._videoClosedCaptionsEnabled;try{if(this._videoClosedCaptionsEnabled===true){this.webkitClosedCaptionsVisible=true }}catch(b){}this._captionsEnabled=true},disableCaptions:function(){try{if(this._videoClosedCaptionsEnabled===true){this.webkitClosedCaptionsVisible=false }}catch(a){}if(""!=this.currentCaption){this.currentCaption=this.trackTextSpan.innerHTML="" }this._captionsEnabled=false},_videoClosedCaptionsEnabled:false,videoClosedCaptionsEnabled:function(){this._videoClosedCaptionsEnabled=(typeof this.webkitClosedCaptionsVisible!="undefined")?true:false; return this._videoClosedCaptionsEnabled}},_configure:function(c,e,b){if(!b){return }var d,a;for(d in b){if(b.hasOwnProperty(d)){if(typeof b[d]==undefined){continue }a=d.toLowerCase();switch(a){case"type":case"src":case"data":case"classid":case"name":case"id":case"postdomevents":case"saveembedtags":case"factory":case"aggressiveCleanup":case"innerId":case"cache":case"aggressivecleanup":case"showlogo":break; case ("class"):Element.addClassName(c,b[d]);break;case ("controller"):if(b[d]||(Media.Detection.iPad()&&c.tagName==="VIDEO")){c.setAttribute("controls","controls") }break;case ("autoplay"):case ("autostart"):if(b[d]){c.setAttribute("autoplay","autoplay") }break;case ("posterframe"):if(b[d]){c.setAttribute("poster",b[d])}break;default:if(typeof b[d]!=="undefined"){c.setAttribute(a,b[d]) }break}}}},_createFallback:function(a,c,b){if(Media._isQuickTimeAvailable()){return Media.Spec.QuickTime.create(a,c,b) }if(Media._isSBVDPAvailable()){return Media.Spec.SBVDP.create(a,c,b)}if(Media._shouldShowDownloadPrompt()){return Media.createDownloadPrompt(a,c,b) }return false}},QuickTime:{create:function(b,d,c){var f=this._createObject(d,c),a=null,e=c.id||(b.id?b.id+"_video":""); f.setAttribute("id",e);if(!Media.Detection.IE()&&!Media.Detection.Mobile()){if(c.target==="quicktimeplayer"){a=this._innerObject=this._createInnerObject(d,c) }else{a=this._embed=this._createEmbed(d,c)}f.appendChild(a)}else{f.style.behavior="url(#qt_event_source)"; if(c.aggressiveCleanup!==false){Event.observe(window,"unload",function(){try{f.Stop() }catch(g){}f.style.display="none";f=null})}}this._configure(a,f,c);f.setAttribute("classid","clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"); Element.addClassName(f,(f.playerType="quicktime"));b.appendChild(f);return a||f },pollForChanges:["load","timeupdate","durationchange","progress","playing","play","pause","ended"],_captions:null,interfaceMethods:{setup:function(){},duration:function(){var b=0; try{b=this.GetDuration()/this.GetTimeScale()}catch(a){}return b||0},time:function(){var b=0; try{b=this.GetTime()/this.GetTimeScale()}catch(a){}return b||0},setTime:function(a){try{this.SetTime(a*this.GetTimeScale()) }catch(b){}},volume:function(){return this.GetVolume()/255},setVolume:function(a){this.SetVolume(a*255) },muted:function(){return this.GetMute()},setMuted:function(a){this.SetMute(a)},rate:function(){var a; try{a=this.GetRate()}catch(b){}return a||1},setRate:function(a){this.SetRate(a) },status:function(){this.GetPluginStatus()},percentLoaded:function(){var a=0;try{a=this.GetMaxBytesLoaded()/this.GetMovieSize() }catch(b){}return a},pause:function(){try{this.Stop()}catch(a){}},play:function(){try{this.Play() }catch(a){}},paused:function(){try{return this.GetRate()===0}catch(a){}},ended:function(){return this.ended },src:function(){var b;try{b=this.GetURL()}catch(a){}return b||""},setSrc:function(a){this.SetURL(a); this.SetControllerVisible(false);if(typeof this._embed!="undefined"){this._embed.SetControllerVisible(false) }},timeScale:function(){return this.GetTimeScale()},movieType:function(){return"QuickTime" },getContainer:function(){return this._container},setTrackTextSpan:function(a){},setCaptionsAvailable:function(d,b){try{var a=this.GetTrackCount(),c; for(c=1;c<=a;c++){if("Closed Caption"===this.GetTrackType(c)){Media.Spec.QuickTime._captions=c; if(typeof d!="undefined"){d()}}}}catch(f){}},enableCaptions:function(){try{if(Media.Spec.QuickTime._captions==="undefined"){this.setCaptionsAvailable() }this.SetTrackEnabled(Media.Spec.QuickTime._captions,true);this._captionsEnabled=true }catch(a){}},disableCaptions:function(){try{this.SetTrackEnabled(Media.Spec.QuickTime._captions,false); this._captionsEnabled=false}catch(a){}},videoClosedCaptionsEnabled:function(){return false }},_configure:function(a,e,c){if(!c){return}var d=null,b=null;for(d in c){if(c.hasOwnProperty(d)){if(typeof c[d]==undefined){continue }b=d.toLowerCase();switch(b){case ("type"):case ("src"):case ("data"):case ("classid"):case ("name"):case ("id"):case ("postdomevents"):case ("saveembedtags"):case ("factory"):case ("aggressiveCleanup"):break; case ("class"):Element.addClassName(e,c[d]);break;case ("innerId"):if(a){a.setAttribute("id",c[d]) }break;case ("autoplay"):this._addParameter(e,"autostart",c[d]);this._addParameter(a,"autostart",c[d]); break;case ("width"):case ("height"):e.setAttribute(b,c[d]);if(a){a.setAttribute(b,c[d]) }break;default:this._addParameter(e,b,c[d]);this._addParameter(a,b,c[d]);break}}}},_addParameter:function(b,a,c){if(!b){return }var d=document.createElement("param");d.setAttribute("value",c);d.setAttribute("name",a); b.appendChild(d);d=null},_createEmbed:function(b,a){var c=document.createElement("embed"); c.setAttribute("src",b);c.setAttribute("type","video/quicktime");if(!Media.Detection.Firefox()&&!Media.Detection.Opera()){c.setAttribute("wmode","transparent") }c.setAttribute("postdomevents",true);c.setAttribute("controller",false);c.setAttribute("showlogo",false); c.setAttribute("scale","tofit");if(a){if(!isNaN(parseInt(a.width,10))){c.setAttribute("width",a.width) }if(!isNaN(parseInt(a.height,10))){c.setAttribute("height",a.height)}if(typeof a.target!="undefined"){c.setAttribute("target",a.target) }}return c},_createInnerObject:function(c,b){var a=document.createElement("object"); a.setAttribute("type","video/quicktime");a.setAttribute("id",b.id+"Inner");a.setAttribute("name",b.id); a.setAttribute("width","1");a.setAttribute("height","1");a.setAttribute("data",c); this._addParameter(a,"target",b.target);this._addParameter(a,"postdomevents","true"); return a},_createObject:function(c,b){var a=document.createElement("object"),d="7,3,0,0"; if(Media.Detection.Mobile()&&b.posterFrame){this._addParameter(a,"src",b.posterFrame); this._addParameter(a,"href",c);this._addParameter(a,"target","myself")}else{this._addParameter(a,"src",c); if(!Media.Detection.Firefox()&&!Media.Detection.Opera()){this._addParameter(a,"wmode","transparent") }}a.setAttribute("id",name);if(!Media.Detection.Mobile()){this._addParameter(a,"showlogo",false); this._addParameter(a,"scale","tofit");this._addParameter(a,"saveembedtags",true); this._addParameter(a,"postdomevents",true)}if(null!==b&&(typeof b.codebase!=="undefined")&&""!==b.codebase){d=b.codeBase }a.setAttribute("codebase","http://www.apple.com/qtactivex/qtplugin.cab#version="+d); return a}}};if(AC.Detector.isiPad()){HTMLMediaElement.prototype.forcePlay=function(){var a=this,b=document.createElement("a"),d=function(e){e.preventDefault(); a.play()},c;b.addEventListener("click",d,false);document.body.appendChild(b);c=document.createEvent("MouseEvents"); if(c.initMouseEvent){c.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null); b.dispatchEvent(c)}document.body.removeChild(b)};HTMLMediaElement.prototype.forcePause=function(){var a=this,c=document.createElement("a"),b=function(e){e.preventDefault(); a.pause()},d;c.addEventListener("click",b,false);document.body.appendChild(c);d=document.createEvent("MouseEvents"); if(d.initMouseEvent){d.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null); c.dispatchEvent(d)}document.body.removeChild(c)}}Media.VideoInterface=function(h,f){var b=h,e=f,a,c,g,d,i; return{videoTitle:function(){return c},setVideoTitle:function(j){c=j},videoUrl:function(){return g },setVideoUrl:function(j){g=j},videoDescription:function(){return d},setVideoDescription:function(j){d=j },videoPosterFrame:function(){return i},setVideoPosterFrame:function(j){i=j},object:function(){return b },setObject:function(j){b=j},setDelegate:function(j){e=j},setup:function(){},override:function(k){var l; function j(m,n){return function(){return n.apply(b,arguments)}}for(l in k){this[l]=j(l,k[l]) }return this},registerEvent:function(l,j,k){if(!k&&typeof(j)=="function"){k=j;j=null }var m=j||l;Event.observe(b,m,function(n){if(k){k.apply(this)}this.messageDelegate(l) }.bind(this))},pollForChanges:function(j){if(a){window.clearInterval(a)}if(j){a=window.setInterval(function(){for(var k=0,l; l=j[k];k++){this.messageDelegate(l)}}.bind(this),480)}},messageDelegate:function(j){if(!e){return }j=j.charAt(0).toUpperCase()+j.substring(1);var k="videoReceived"+j+"Event";if(k in e){e[k](this) }}}};Media.Controller=function(d){var n=d,t,s,i,v,k,q,b,c=false,l,g=false,m=false,e=false,f=true,r=true,j=false,x=false,a=false,p=false; function u(z){if(!v||x||!g){return}v.show();window.clearTimeout(k);var y=v.element; mouseElement=z.target||z.srcElement;if(mouseElement==y){k=window.setTimeout(function(){if(v&&typeof v!="undefined"){v.hide() }},2500)}}function h(y){if(!v||!g){return}window.clearTimeout(k);k=window.setTimeout(function(){if(v){v.hide() }},50)}function w(y){if(!v||!g){return}window.clearTimeout(k);k=window.setTimeout(function(){if(v){v.hide() }},50)}function w(y){if(!v||x||!g){return}window.clearTimeout(k);v.show()}function o(y){if(!v){return }window.clearTimeout(k);v.show()}return{_send:function(z,y){if(t&&z in t){y=[this].concat(y); return t[z].apply(t,y)}},_fireEvent:function(y,z){Media.Controller.fireEvent(y,z) },reset:function(){c=false;g=false;m=false;e=false},setDelegate:function(y){t=y },setVideo:function(y){g=false;m=false;s=y;b=s.duration()||0;if(v&&v.videoObjectHasChanged){v.videoObjectHasChanged(s) }return this},setVideoSrc:function(y){i=y},video:function(){return s},translationDidLoad:function(){languageJsonComplete=true; this.processControlPanel()},_setControlPanel:function(){if(v){if(existingVideo!=false&&playExistingVideo===true){s.play() }v.delegate=this;Event.observe(d,"mousemove",u);Event.observe(d,"mouseout",h);Event.observe(d,"mouseover",w); if(v.settingsMenu){Event.observe(v.settingsMenu,"mouseover",o)}s.setTrackTextSpan(v.trackText); if(!v.settingsControlsAreSet&&(s.tagName==="VIDEO")){this.configureSettingsControls(i); v.settingsControlsAreSet=true}if(v.element){v.element.parentNode.parentNode.style.width=this.currentWidth+"px"; v.element.parentNode.parentNode.style.height=this.currentHeight+"px"}if(s.object().tagName.toLowerCase()==="video"){this.setSizeAnimation(true) }this.setVideoSizeForWidthAndHeight(this.currentWidth,this.currentHeight);v.setFocus() }else{Event.stopObserving(d,"mousemove",u);Event.stopObserving(d,"mouseout",h); Event.stopObserving(d,"mouseover",w)}return this},setControlPanel:function(y){v=(s.tagName==="VIDEO"&&Media.Detection.iPad())?false:y; if(v!=null){MediaLanguage.getTranslations(this)}},beginSeeking:function(){if(c){return }c=true;l=!s.paused()&&this.rate()==1;this.pause();var y=s.time();this._send("didStartJogging",y); this._fireEvent("QuickTime:didStartJogging",{controller:this,time:y})},endSeeking:function(){var z=s.time(),y=s.duration(); c=false;this._send("didStopJogging",z);this._fireEvent("QuickTime:didStopJogging",{controller:this,time:z}); if(l){if(z!=y){this.play()}else{m=false;this.videoReceivedEndedEvent(this)}}},time:function(){return s.time()||this._lastTime||0 },setTime:function(y){s.setTime(y);this.videoReceivedTimeupdateEvent()},duration:function(){if(!b){b=s.duration() }return b},volume:function(){return s.volume()},setVolume:function(y){s.setMuted(false); s.setVolume(y);if(typeof v!="undefined"&&v!=null){v.volumeControlSetting=y}},setMuted:function(y){s.setMuted(y); if(typeof v!="undefined"&&v!=null){v.volumeControlSetting=0}},toggleMute:function(){var y=s.muted(); if(y){this.setMuted(false)}else{this.setMuted(true)}return !y},playPause:function(){var y=s.paused(),z=this.rate(); if(y&&z===1){this.play()}else{if(z!==1){this.setRate(1)}else{this.pause()}}return s.paused() },playing:function(){return e},play:function(){s.play();e=true;f=false},playing:function(){return e },pause:function(){s.pause();e=false;r=false},stop:function(){s.pause();e=false; r=false;m=true},setRate:function(y){s.setRate(y);if(y!==1||y!==0){j=true}else{j=false }},rate:function(){return s.rate()},src:function(){return s.src()},setSrc:function(y){s.setSrc(y); this._currentSrc=y},setSizeAnimation:function(y){a=y},_currentSrc:false,setVideoSizeForSrc:function(A){var z=this.moviePath(),y=A.substring(A.lastIndexOf("/")+1,A.length); srcToSet=z+y,newWidth=y.substring(y.lastIndexOf("_")+1,y.lastIndexOf("x")),newHeight=y.substring(y.lastIndexOf("x")+1,y.lastIndexOf(".")); if((s.percentLoaded()<1||(s.percentLoaded()>=1&&(this._currentSrc!=false&&i!=this._currentSrc)))){if(a===true){this.setSizeAnimation(false) }this.setSrc(srcToSet)}this.setVideoSizeForWidthAndHeight(newWidth,newHeight)},setVideoSizeForWidthAndHeight:function(y,G){var z=s.object()||s.object().parentNode; if(typeof v!="undefined"&&typeof z!="undefined"){function C(){if(typeof v!="undefined"){v.setControllerType(); v.setTrackContainerWidth()}}if(AC.Detector.isIEStrict()){var E=parseInt(G/2);z.style.marginTop="-"+E+"px"; v.element.style.marginTop="-"+E+"px"}if(s.percentLoaded()<1||a===false||Media.Detection.Chrome()){z.width=y; z.height=G;if(s.movieType()!="Video"&&typeof z.parentNode!=null){z.parentNode.width=y; z.parentNode.height=G}v.container.style.width=y+"px";v.container.style.height=G+"px"; if(v.element){v.element.style.width=y+"px";v.element.style.height=G+"px"}if(AC.Detector.isIEStrict()){var E=parseInt(G/2); z.style.marginTop="-"+E+"px";v.element.style.marginTop="-"+E+"px";var A=parseInt(y/2,10); if(v.originalElementWidth!=0&&v.originalElementWidth!=z.width){z.style.left="50%"; z.style.marginLeft="-"+A+"px";v.element.style.left="50%";v.element.style.marginLeft="-"+A+"px" }else{z.style.left="";z.style.marginLeft="";v.element.style.left="";v.element.style.marginLeft="" }if(AC.Detector.getAgent().match(/msie 6/i)){document.body.style.display="none"; document.body.style.display="block"}}}else{if(Media.Detection.CSSTransitions()===true&&s.movieType()!=="QuickTime"){z.style.width=y+"px"; z.style.height=G+"px";if(v){v.container.style.width=y+"px";v.container.style.height=G+"px"; if(v.element){v.element.style.width=y+"px";v.element.style.height=G+"px"}}}else{var F=[]; if(v&&(v.controllerType==="slim"||v.controllerType==="short-slim")){v._hiding=true; v._showing=false;v.fadeElement.style.opacity="0";v.fadeElement.style.visibility="hidden"; if(v.settingsMenu){Element.removeClassName(v.settingsMenu,v.settingsMenu.baseClassName+"-hovered") }x=true}if(v){v.resetSettingsMenus()}F.push(new Effect.Morph(z,{sync:true,style:{width:y+"px",height:G+"px"}})); if(s.movieType!="Video"&&typeof z.parentNode!=null){F.push(new Effect.Morph(z.parentNode,{sync:true,style:{width:y+"px",height:G+"px"}})) }if(v){if(v.container){F.push(new Effect.Morph(v.container,{sync:true,style:{width:y+"px",height:G+"px"}})) }if(v.element){F.push(new Effect.Morph(v.element,{sync:true,style:{width:y+"px",height:G+"px"}})) }}var H=document.createElement("div");Element.addClassName(H,"ACMediaRedraw");var B=AC.Detector.getAgent(); var D=function(){z.style.outline="1px solid transparent";document.body.appendChild(H); v.mouseoverSettingsControl(v.sizesControl);z.style.outline="none";document.body.removeChild(H); v.hide();v.resetSettingsMenus()};new Effect.Parallel(F,{duration:0.4,beforeStart:function(){if(AC.Detector.isIEStrict()){var I=parseInt(z.offsetHeight/2); z.parentNode.style.top="50%";z.style.top="0";v.element.style.top="0";z.style.marginTop="-"+I+"px"; v.element.style.marginTop="-"+I+"px";D()}},afterUpdate:function(){x=true;if(AC.Detector.isIEStrict()){var I=parseInt(z.offsetHeight/2); z.parentNode.style.top="50%";z.style.top="0";v.element.style.top="0";z.style.marginTop="-"+I+"px"; v.element.style.marginTop="-"+I+"px";D()}},afterFinish:function(){if(AC.Detector.isIEStrict()){var I=parseInt(G/2); z.parentNode.style.top="50%";z.style.top="0";v.element.style.top="0";z.style.marginTop="-"+I+"px"; v.element.style.marginTop="-"+I+"px";v.mouseoutSettingsControl(v.sizesControl); v.hide()}C();window.clearTimeout(q);q=window.setTimeout(function(){if(v&&(v.controllerType==="slim"||v.controllerType==="short-slim")){v.fadeElement.style.visibility="visible"; v.fadeElement.style.opacity="1";v._hiding=false;v._showing=false}x=false},50)}}) }}C()}this.currentWidth=y;this.currentHeight=G},timeScale:function(){return s.timeScale() },movieType:function(){return s.movieType()},moviePath:function(){var y,z="";if(typeof i!="undefined"&&i.length>0){y=i.substring(0,i.lastIndexOf("_"))+".html" }else{return}if(y.match(/\w+:\/\//i)){if((window.location.href.match(/\w+:\/\/ic/i)||window.location.href.match(/\w+:\/\/17/i)||window.location.href.match(/\w+:\/\/192/i)||window.location.href.match(/\w+:\/\/www-dev/i))&&y.indexOf("/105")<0){y=y.replace(/\w+:\/\/[^\/]+/i,"/105") }else{y=y.replace(/\w+:\/\/[^\/]+/i,"")}}z=y.substring(0,(y.lastIndexOf("/")+1)); return z},setCaptionsAvailable:function(y){var z=this.enableCaptionsControl.bind(this); s.setCaptionsAvailable(z,y)},enableCaptionsControl:function(){if(v&&typeof v.enableCaptionsControl!=="undefined"){v.enableCaptionsControl(); return true}return false},enableCaptions:function(){s.enableCaptions();this._fireEvent("QuickTime:didSetClosedCaptions",{controller:this,enabled:true}) },disableCaptions:function(){s.disableCaptions();this._fireEvent("QuickTime:didSetClosedCaptions",{controller:this,enabled:false}) },enableCaptionsTextDisplay:function(){return s.videoClosedCaptionsEnabled()},resetCaptions:function(){s.disableCaptions() },setSizesAvailable:function(A){this.sizesMenuOptions=A;for(var y=0,z;z=this.sizesMenuOptions[y]; y++){this.sizesMenuOptions["size_"+z.type]=z}this.enableSizesControl()},enableSizesControl:function(){if(v&&typeof v.enableSizesControl!=="undefined"&&this.disableSizeSelector===false){if(this.sizesMenuOptions&&this.sizesMenuOptions.length>1){v.buildSizesMenu(this.sizesMenuOptions); v.setSizesAvailable();v.enableSizesControl();return true}}return false},setDownloadAvailable:function(A){this.downloadMenuOptions=A; for(var y=0,z;z=this.downloadMenuOptions[y];y++){this.downloadMenuOptions["download_"+z.type]=z }this.enableDownloadControl()},enableDownloadControl:function(){if(v&&typeof v.enableDownloadControl!=="undefined"){if(this.downloadMenuOptions.length>0){v.buildDownloadMenu(this.downloadMenuOptions); v.setDownloadAvailable();v.enableDownloadControl();return true}}return false},setShareAvailable:function(z){if(v&&typeof v.enableShareControl!=="undefined"&&ac_media_language.sharemenu){var E=document.getElementsByTagName("head").item(0),y=ac_media_language.sharemenu,C=this; for(var D=0,F;F=y[D];D++){var B=document.createElement("script"),A;B.setAttribute("type","text/javascript"); B.pluginName=F.id;A=function(){if(typeof window.event!="undefined"){var G=window.event.srcElement; if(!window.event||((G=window.event.srcElement)&&(G.isLoaded||((typeof G.isLoaded==="undefined")&&((G.readyState=="complete")||(G.readyState=="loaded")))))){if(G&&!G.isLoaded){G.onreadystatechange=null; G.isLoaded=true}Event._domReady()}}};if(B.addEventListener){B.addEventListener("load",A,false) }else{if(typeof B.onreadystatechange==="function"){B.onreadystatechange=function(){if(this.readyState=="complete"){A() }}}else{B.onreadystatechange=A}}B.setAttribute("src",F.plugin);E.appendChild(B); y[D].localScript=B}}},language:null,path:null,configureSettingsControls:function(z){if(existingVideo!=false&&p===true){return }var y,A=document.body.parentNode.getAttribute("lang");this.language=language=MediaLanguage.getLangFromAttr(A); this.path=path=this.moviePath();if(typeof z!="undefined"&&z.length>0){y=z.substring(0,z.lastIndexOf("_"))+".json" }else{return}if(y.match(/\w+:\/\//i)){if((window.location.href.match(/\w+:\/\/ic/i)||window.location.href.match(/\w+:\/\/17/i)||window.location.href.match(/\w+:\/\/192/i)||window.location.href.match(/\w+:\/\/www-dev/i))&&y.indexOf("/105")<0){y=y.replace(/\w+:\/\/[^\/]+/i,"/105") }else{y=y.replace(/\w+:\/\/[^\/]+/i,"")}}new Ajax.Request(y,{method:"get",requestHeaders:{Accept:"application/json"},onSuccess:function(B){this.configSettings=new Function("return "+B.responseText)(); this.setVideoId();movieJsonLoaded=true}.bind(this),onFailure:function(){if(typeof v!="undefined"){v.setTrackContainerWidth() }}.bind(this),onException:function(){},onComplete:function(){movieJsonComplete=true; this.processControlPanel()}.bind(this),evalJS:false})},processControlPanel:function(){if(movieJsonComplete===true&&languageJsonComplete===true){if(initializedCP===false){v._setupControls() }if(movieJsonLoaded===true){this.setSettingsControlsAvailableForLanguageAndPath(this.language,this.path) }this._setControlPanel()}},_videoId:null,setVideoId:function(){if(this.configSettings&&this.configSettings.version&&(this.configSettings.version>=2)){if(this.configSettings.vid){this._videoId=this.configSettings.vid }}else{this._videoId=null}},videoID:function(){return this._videoId},disableSizeSelector:false,setSettingsControlsAvailableForLanguageAndPath:function(E,K){if(this.configSettings){var H=this.configSettings.metadata.captions,y=this.configSettings.metadata.sizes,J=this.configSettings.metadata.downloads,I=this.configSettings.metadata.share||true,F=this.configSettings.metadata.lang,B=this.configSettings.metadata.title,z=this.configSettings.metadata.description,D=this.configSettings.src,G=this.configSettings.posterframe||"http://images.apple.com/global/elements/overlay/overlay_movie_endstate_640x400_20081014.jpg" }if(typeof B!="undefined"){s.setVideoTitle(B)}if(typeof D!="undefined"){s.setVideoUrl(D) }if(typeof z!="undefined"){s.setVideoDescription(z)}if(typeof G!="undefined"){s.setVideoPosterFrame(G) }if(typeof v!="undefined"){if(typeof H!="undefined"){var A=H.substring(H.lastIndexOf("/"),H.length),C=K+((A[0]==="/")?A.substring(1,A.length):A); v.captionsUrl=C;this.setCaptionsAvailable(v.captionsUrl)}}if(typeof y!="undefined"&&this.disableSizeSelector===false){this.setSizesAvailable(y) }if(typeof downloadsList!="undefined"){this.setDownloadAvailable(J)}if(I){this.setShareAvailable() }if(typeof C=="undefined"&&typeof y=="undefined"&&typeof downloadsList=="undefined"&&typeof v!="undefined"){v.setTrackContainerWidth() }p=true},videoReceivedPlayingEvent:function(y){if(!g&&(this.movieType()=="Video"||(this.time()>0&&this.duration!=0))){if(v&&typeof v.mediaDidBecomePlayable!=="undefined"){v.mediaDidBecomePlayable() }if(v&&typeof v.enableBasicControls!=="undefined"){v.enableBasicControls();v.setSettingsControls(); if(typeof v.captionsUrl!="undefined"&&(!!v.captionsControl&&!v.captionsControl.isEnabled)){this.setCaptionsAvailable(v.captionsUrl) }switch(true){case (typeof v.captionsControlSetting!="undefined"&&v.captionsControlSetting===true):s.enableCaptions(); break;default:break}}e=true;Element.removeClassName(this.container,this.movieLoadingPanelClass); g=true;this._send("didBecomePlayable");this._fireEvent("QuickTime:canplaythrough",{controller:this}); this._send("didBegin");this._fireEvent("QuickTime:begin",{controller:this});k=window.setTimeout(function(){if(v&&typeof v!="undefined"){v.hide() }},500)}},videoReceivedLoadEvent:function(z){if(v){var y=s.percentLoaded();v.updatePercentLoaded(y); if(y<=1&&typeof v.captionsUrl!="undefined"&&!v.captionsControl.isEnabled){this.setCaptionsAvailable(v.captionsUrl) }}},videoReceivedEndedEvent:function(y){var A=s.time();b=s.duration();if(m){return }if(g&&!c&&((A>=b&&b!=0)||(s.movieType()=="SBVDP"&&b!=0&&A>=(b-0.5)))){m=true;this.videoReceivedTimeupdateEvent(this); if(v){v.resetSettingsMenus();if(AC.Detector.isIEStrict()){var z=s.object();z.parentNode.style.width=""; z.parentNode.style.height="";z.parentNode.style.top="";z.style.top="";v.element.style.top=""; z.style.marginTop="";v.element.style.marginTop="";z.parentNode.style.left="";z.style.left=""; v.element.style.left="";z.style.marginLeft="";v.element.style.marginLeft=""}}this._send("onMovieFinished"); this._send("didEnd");this._fireEvent("QuickTime:end",{controller:this})}},videoReceivedPlayEvent:function(y){this._currentPlayState="playing"; if(f){return}f=true;this._send("didStart");this._fireEvent("QuickTime:start",{controller:this}) },videoReceivedPauseEvent:function(y){this._currentPlayState="paused";if(r){return }r=true;this._send("didStop");this._fireEvent("QuickTime:stop",{controller:this}) },videoReceivedTimeupdateEvent:function(y){var z=s.time()||0;if(v){v.updateTime(z) }if(this._lastTime!=z){this._fireEvent("QuickTime:didPlayProgress",{controller:this,currentTime:z,duration:this.duration()}) }this._lastTime=z},videoReceivedProgressEvent:function(y){if(v){v.updatePercentLoaded(s.percentLoaded()) }switch(true){case (!g&&Media.Detection.SnowLeopard()&&this.movieType()=="Video"&&s.autoplay()===true&&s.readystate()>=3&&s.percentLoaded()>0.4):this.play(); break;default:break}},videoReceivedDurationchangeEvent:function(y){if(v){v.updateRemainingTime(this.duration()-this.time()) }}}};Media.Controller.fireEvent=function(b,c){var a=$(document.body);if("fire" in a){a.fire(b,c) }};Media.ControlsWidget=function(g,a,c){this.settingsControlsAreSet=false;this.container=g; this.delegate=a;this.options=c;Event.observe(document.body,"PluginClass:Added",this.registerPluginClass.bind(this)); for(var d=0,f;f=Media.ControlsWidget.pluginTypes[d];d++){for(var b=0,e;e=f[b];b++){this.registerPluginClass(e) }}if(!Media.Detection.iPad()){this._createTemplate();initializedCP=false}};Media.ControlsWidget.registerPluginClass=function(a){var c=a.prototype.name(),d=a.prototype.pluginType(),b; this.pluginTypes(d);this.pluginClassesForType;if(!(b=Media.ControlsWidget._pluginTypes[d])||!Media.ControlsWidget._pluginTypes.hasOwnProperty(d)){b=[]; Media.ControlsWidget._pluginTypes[d]=b;Media.ControlsWidget._pluginTypes.push(d) }if(!b.hasOwnProperty(c)){b[c]=c;b.push(c)}Media.Controller.fireEvent("PluginClass:Added",{plugin:a,name:c,type:d}) };Media.ControlsWidget._pluginTypes=[];Media.ControlsWidget.pluginTypes=function(a){return this._pluginTypes };Media.ControlsWidget.pluginClassesForType=function(a){return this.pluginTypes[a] };Media.ControlsWidget.TEMPLATE='
00:00
-00:00
'; Media.ControlsWidget.show=function(a){if(a.fadeElement&&!a._showing){if(a._effect){try{a._effect.cancel() }catch(b){}delete a._effect}a._showing=true;a._hiding=false;if(a.fadeElement){if(Media.Detection.CSSTransitions()===true){a._effect=function(){Element.removeClassName(a.fadeElement,"fade") };a._effect()}else{a._effect=new Effect.Opacity(a.fadeElement,{to:1,duration:0.5,afterFinish:function(){a._showing=false }})}}}};Media.ControlsWidget.hide=function(a){if(a.fadeElement&&!a._hiding){if(a._effect){try{a._effect.cancel() }catch(b){}delete a._effect}a._hiding=true;a._showing=false;if(a.fadeElement){if(Media.Detection.CSSTransitions()===true){a._effect=function(){a.resetSettingsMenus(); Element.addClassName(a.fadeElement,"fade")};a._effect()}else{a._effect=new Effect.Opacity(a.fadeElement,{to:0,duration:0.5,beforeStart:function(){a.resetSettingsMenus() },afterFinish:function(){a._hiding=false}})}}}};Media.ControlsWidget.prototype={delegate:null,element:null,_plugins:[],_buildControlWithTitleOptions:function(d,c){var b=document.createElement("li"),a=document.createElement("a"); Element.addClassName(b,d);if(typeof c!="undefined"&&typeof c.url!="undefined"&&typeof c.name!="undefined"){a.setAttribute("href",c.url); a.innerHTML=c.name;b.appendChild(a)}else{return}b.baseClassName=b.baseClassName||b.className; Event.observe(b,"mousedown",function(e){Element.addClassName(this,this.baseClassName+"-active") });Event.observe(b,"mouseup",function(e){Element.removeClassName(this,this.baseClassName+"-active") });Event.observe(document.documentElement,"mouseup",function(e){Element.removeClassName(this,this.baseClassName+"-active") });Event.observe(b,"mouseover",function(e){Element.addClassName(this,this.baseClassName+"-hover") });Event.observe(b,"mouseout",function(e){Element.removeClassName(this,this.baseClassName+"-hover") });return b},_sizesMenuControls:[],selectSizeFromMenu:function(c){if(typeof c!="undefined"){this._unselectMenu(); this._unselectControl(this.sizesControl);for(var b=0,a;a=this._sizesMenuControls[b]; b++){((a.classNames().toString().split(" ")[0])===(c.classNames().toString().split(" ")[0]))?this._selectControl(a):this._unselectControl(a) }this._send("setVideoSizeForSrc",c.optionsUrl);this.sizesControlSetting=c}},_getSizesMenuControl:function(b,d,a){var c=this._buildControlWithTitleOptions("size"+d,{url:a.src,name:(ac_media_language[b]||d)+" "+a.width+"x"+a.height}); c.appendChild(document.createElement("span"));c.optionsUrl=a.src;Event.observe(c,"click",function(e){Event.stop(e); this.selectSizeFromMenu(c)}.bindAsEventListener(this));if(this.element.offsetWidth==a.width&&this.element.offsetHeight==a.height){this._selectControl(c) }return c},_firstLoad:false,originalElementWidth:0,buildSizesMenu:function(a){var b=this.sizesMenu; if(b.firstChild){while(b.firstChild){b.removeChild(b.firstChild)}}if(!this._firstLoad){this.originalElementWidth=this.element.offsetWidth; this.originalElementHeight=this.element.offsetHeight;this._firstLoad=true}if(Media.Detection.CSSTransitions()===true){this.element.style.width=this.originalElementWidth+"px"; this.element.style.height=this.originalElementHeight+"px"}if(typeof a.size_hd!="undefined"&&this.originalElementWidth>=a.size_hd.width&&this.originalElementHeight>=a.size_hd.height){this.sizesHDControl=this._getSizesMenuControl("hd","HD",a.size_hd); this._sizesMenuControls.push(this.sizesHDControl);b.appendChild(this.sizesHDControl) }if(typeof a.size_large!="undefined"&&this.originalElementWidth>=a.size_large.width&&this.originalElementHeight>=a.size_large.height){this.sizesLargeControl=this._getSizesMenuControl("large","Large",a.size_large); this._sizesMenuControls.push(this.sizesLargeControl);b.appendChild(this.sizesLargeControl) }if(typeof a.size_medium!="undefined"&&this.originalElementWidth>=a.size_medium.width&&this.originalElementHeight>=a.size_medium.height){this.sizesMediumControl=this._getSizesMenuControl("medium","Medium",a.size_medium); this._sizesMenuControls.push(this.sizesMediumControl);b.appendChild(this.sizesMediumControl) }if(typeof a.size_small!="undefined"&&this.originalElementWidth>=a.size_small.width&&this.originalElementHeight>=a.size_small.height){this.sizesSmallControl=this._getSizesMenuControl("small","Small",a.size_small); this._sizesMenuControls.push(this.sizesSmallControl);b.appendChild(this.sizesSmallControl) }return this._sizesMenuControls},_downloadMenuControls:[],_getDownloadMenuControl:function(c,f,b){var a=(f.match(/\//))?f.substring(0,f.indexOf("/")):f,d="mb"; var e=this._buildControlWithTitleOptions("download"+a,{url:b.src,name:(ac_media_language[c]||f)+" "+b.size+(ac_media_language[d]||"MB")}); Event.observe(e,"click",function(g){Event.stop(g);this._unselectMenu();this._unselectControl(this.downloadControl); document.location.href=b.src}.bindAsEventListener(this));return e},buildDownloadMenu:function(a){if(typeof a.download_hd!="undefined"){this.downloadHDControl=this._getDownloadMenuControl("hd","HD",a.download_hd); this._downloadMenuControls.push(this.downloadHDControl);this.downloadMenu.appendChild(this.downloadHDControl) }if(typeof a.download_large!="undefined"){this.downloadLargeControl=this._getDownloadMenuControl("large","Large",a.download_large); this._downloadMenuControls.push(this.downloadLargeControl);this.downloadMenu.appendChild(this.downloadLargeControl) }if(typeof a.download_ipod!="undefined"){this.downloadiPodControl=this._getDownloadMenuControl("ipod","iPod/iPhone",a.download_ipod); this._downloadMenuControls.push(this.downloadiPodControl);this.downloadMenu.appendChild(this.downloadiPodControl) }return this._downloadMenuControls},_shareMenuControls:[],buildShareMenu:function(b){var d=b.name(),a=b.url(); var e=this[d.toLowerCase()+"Control"]=this._buildControlWithTitleOptions(d,{url:a,name:d}); var c=this._send("video");Event.observe(e,"click",function(f){Event.stop(f);b.share(c) });this._shareMenuControls.push(e);this.shareMenu.appendChild(e);Element.addClassName(e,e.baseClassName+"-enabled"); return this._shareMenuControls},_registeredPlugins:[],registerPluginClass:function(b){var c=new b.memo.plugin(),d=c.name(),a=c.actionName(),e=c.pluginType(); this._registeredPlugins.push(c);this.buildShareMenu(c);if(!this.shareEnabled){this.setShareAvailable(); this.enableShareControl()}},_createTemplate:function(){function a(e){var c=document.createElement("div"),d; c.innerHTML=e;d=c.firstChild;return d}this.setControllerType();var b=new Date(); this.timestamp=b.getTime();this.container.appendChild(a(Media.ControlsWidget.TEMPLATE)); this.element=document.getElementById("ACMedia-controls");this.element.id="ACMedia-controls_"+this.timestamp; this.element.style.outline="none";Event.observe(this.element,"keydown",this.keyDownHandler.bindAsEventListener(this)) },_setRegularControllerType:function(){Element.removeClassName(this.container,"slim"); Element.removeClassName(this.container,"short-slim");this.controllerType="regular" },_setSlimControllerType:function(){Element.addClassName(this.container,"slim"); Element.removeClassName(this.container,"short-slim");this.controllerType="slim" },_setShortSlimControllerType:function(){Element.addClassName(this.container,"slim"); Element.addClassName(this.container,"short-slim");this.controllerType="short-slim" },setControllerType:function(){switch(true){case Media.Detection.Firefox():case Media.Detection.Opera():case (typeof this.options!="undefined"&&this.options.slimController===true):case (typeof this.options!="undefined"&&this.options.controllerType==="slim"):if(this.container.offsetWidth<450){this._setShortSlimControllerType() }else{this._setSlimControllerType()}break;case (this.container.offsetWidth<450&&!AC.Detector.isIEStrict()):this._setShortSlimControllerType(); break;default:this._setRegularControllerType()}if(!this.volumeScrubber){this.createVolumeScrubber() }},setFocus:function(){if(this.element){window.setTimeout(function(){try{this.element.focus() }catch(a){this.setFocus()}}.bind(this),50)}},_setupControls:function(){var g=this.timestamp; this.fadeElement=d("ACMedia-controls-panel");this.trackEndCap=d("ACMedia-track-end-cap"); function a(j){var i=j.id;j.id=i+"_"+g;return j.id}function f(i){i.baseClassName=i.baseClassName||i.className }function b(k){f(k);function i(l){Element.addClassName(this,this.baseClassName+"-active") }function j(l){Element.removeClassName(this,this.baseClassName+"-active")}Event.observe(k,"mousedown",i.bind(k)); Event.observe(k,"mouseup",j.bind(k));Event.observe(document.documentElement,"mouseup",j.bind(k)) }function e(j){if(!j.baseClassName){f(j)}function k(l){Element.addClassName(this,j.baseClassName+"-hover") }function i(l){Element.removeClassName(this,j.baseClassName+"-hover")}Event.observe(j,"mouseover",k.bind(j)); Event.observe(j,"mouseout",i.bind(j))}function d(k){var j=document.getElementById(k),i=a(j); return j}this.toggleControl=d("ACMedia-control-play-pause");this.playControl=document.createElement("div"); Element.addClassName(this.playControl,"play");b(this.playControl);this.playControl.id="ACMedia-play-control_"+this.timestamp; Event.observe(this.playControl,"click",this.play.bind(this));this.playControl.innerHTML=ac_media_language.play||"Play"; this.playControl.style.display="none";this.pauseControl=document.createElement("div"); Element.addClassName(this.pauseControl,"pause");b(this.pauseControl);this.pauseControl.id="ACMedia-pause-control_"+this.timestamp; Event.observe(this.pauseControl,"click",this.pause.bind(this));this.pauseControl.innerHTML=ac_media_language.pause||"Pause"; this.pauseControl.style.display="none";Element.show(this._send("playing")?this.pauseControl:this.playControl); var c=this.toggleControl;c.appendChild(this.playControl);c.appendChild(this.pauseControl); this.fastBackwardControl=d("ACMedia-control-fastbackward");this.fastBackwardControl.innerHTML=ac_media_language.fastreverse||"Fast Reverse"; Event.observe(this.fastBackwardControl,"click",this.fastBackward.bind(this));b(this.fastBackwardControl); this.fastForwardControl=d("ACMedia-control-fastforward");this.fastForwardControl.innerHTML=ac_media_language.fastforward||"Fast Forward"; Event.observe(this.fastForwardControl,"click",this.fastForward.bind(this));b(this.fastForwardControl); this.volumeMuteControl=d("ACMedia-volume-mute");this.volumeMuteControl.innerHTML=ac_media_language.mutevolume||"Mute Volume"; Event.observe(this.volumeMuteControl,"click",this.muteVolume.bind(this));b(this.volumeMuteControl); this.volumeFullControl=d("ACMedia-volume-full");this.volumeFullControl.innerHTML=ac_media_language.fullvolume||"Full Volume"; Event.observe(this.volumeFullControl,"click",this.fullVolume.bind(this));b(this.volumeFullControl); this.settingsControls=d("ACMedia-settings-controls");f(this.settingsControls);this.captionsControl=d("ACMedia-captions-control"); if(!AC.Detector.isIEStrict()){this.captionsControl.innerHTML=ac_media_language.captionscontrol||"Closed Captions" }Event.observe(this.captionsControl,"click",this.toggleCaptions.bind(this));b(this.captionsControl); this.sizesControl=d("ACMedia-sizes-control");if(!AC.Detector.isIEStrict()){this.sizesControl.innerHTML=ac_media_language.sizescontrol||"Video Size" }this.sizesControl.controlName="sizes";Event.observe(this.sizesControl,"click",this.toggleSizesMenu.bind(this)); b(this.sizesControl);Event.observe(this.sizesControl,"mouseover",this.mouseoverSettingsControl.bind(this,this.sizesControl)); Event.observe(this.sizesControl,"mouseout",this.mouseoutSettingsControl.bindAsEventListener(this,this.sizesControl)); this.downloadControl=d("ACMedia-download-control");if(!AC.Detector.isIEStrict()){this.downloadControl.innerHTML=ac_media_language.downloadcontrol||"Download Video" }this.downloadControl.controlName="download";Event.observe(this.downloadControl,"click",this.toggleDownloadMenu.bind(this)); b(this.downloadControl);Event.observe(this.downloadControl,"mouseover",this.mouseoverSettingsControl.bind(this,this.downloadControl)); Event.observe(this.downloadControl,"mouseout",this.mouseoutSettingsControl.bindAsEventListener(this,this.downloadControl)); this.shareControl=d("ACMedia-share-control");if(!AC.Detector.isIEStrict()){this.shareControl.innerHTML=ac_media_language.sharecontrol||"Share Video" }this.shareControl.controlName="share";Event.observe(this.shareControl,"click",this.toggleShareMenu.bind(this)); b(this.shareControl);Event.observe(this.shareControl,"mouseover",this.mouseoverSettingsControl.bind(this,this.shareControl)); Event.observe(this.shareControl,"mouseout",this.mouseoutSettingsControl.bindAsEventListener(this,this.shareControl)); this.settingsMenu=document.createElement("div");if(Media.Detection.CSSBorderRadius()===false){this.settingsMenuRoundRect=this.getRoundRectForArcAndOpacity(0.05,0.9); this.settingsMenu.appendChild(this.settingsMenuRoundRect)}this.settingsMenu.id="ACMedia-settings-menu_"+this.timestamp; Element.addClassName(this.settingsMenu,"ACMediaSettingsMenu");document.body.appendChild(this.settingsMenu); this.settingsMenu.baseClassName="ACMediaSettingsMenu";if(AC.Detector.isIEStrict()){Event.observe(this.settingsMenu,"click",function(i){if(i.target.tagName!="A"){Event.stop(i) }})}this.settingsMenuCarrot=document.createElement("div");Element.addClassName(this.settingsMenuCarrot,"ACMediaSettingsMenuCarrot"); this.settingsMenu.appendChild(this.settingsMenuCarrot);this.settingsMenuTitle=document.createElement("div"); Element.addClassName(this.settingsMenuTitle,"ACMediaSettingsMenuTitle");this.settingsMenu.appendChild(this.settingsMenuTitle); this.mediaController=d("ACMedia-media-controller");this.speedDisplayAlert=document.createElement("div"); this.captionsDisplayAlert=document.createElement("div");Element.addClassName(this.captionsDisplayAlert,"ACMediaCaptionsDisplay"); this.alertDisplayContainer=d("ACMedia-alert-display-container");this.trackText=d("ACMedia-track-text"); this.trackTextSpan=d("ACMedia-track-text-span");this.volumeThumb=d("ACMedia-volume-handle"); this.volumeTrack=d("ACMedia-volume-track");this.volumeProgress=d("ACMedia-control-volume-progress"); this.trackContainer=d("ACMedia-track-container");this.playhead=d("ACMedia-control-playhead"); this.track=d("ACMedia-control-track");this.trackProgress=d("ACMedia-control-track-progress"); this.controlLoadedProgress=d("ACMedia-control-loaded-progress");this.mediaTimeDisplay=d("ACMedia-control-time-display"); this.minutesPlayed=d("ACMedia-min-played");this.secondsPlayed=d("ACMedia-sec-played"); this.mediaDurationDisplay=d("ACMedia-control-duration-display");this.minutesRemaining=d("ACMedia-min-remain"); this.secondsRemaining=d("ACMedia-sec-remain");this.settingsMenuList=document.createElement("div"); this.settingsMenu.appendChild(this.settingsMenuList);this.sizesMenu=document.createElement("ul"); this.sizesMenu.menuName="sizes";this.sizesMenu.menuTitle=this.sizesControl.menuTitle=ac_media_language.sizescontrol||"Video Size"; this.downloadMenu=document.createElement("ul");this.downloadMenu.menuName="download"; this.downloadMenu.menuTitle=this.downloadControl.menuTitle=ac_media_language.downloadcontrol||"Download Video"; this.shareMenu=document.createElement("ul");this.shareMenu.menuName="share";this.shareMenu.menuTitle=this.shareControl.menuTitle=ac_media_language.sharecontrol||"Share Video"; f(this.alertDisplayContainer);f(this.trackText);f(this.mediaTimeDisplay);f(this.mediaDurationDisplay); switch(this.controllerType){case"slim":case"short-slim":var h=+(this.container.offsetWidth-235); if(AC.Detector.isWin()){h=h-10}this.trackContainer.style.width=h+"px";break;default:break }b(this.volumeThumb);if(!this.scrubber&&this.element!==null){b(this.playhead)}initializedCP=true },SPECIAL_KEYS:["ESC","COMMAND","CONTROL","OPTION","ALT","SHIFT"],KEYS:{KEY_TAB:9,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_0:48,KEY_1:49,KEY_2:50,KEY_C:67,KEY_F:70,KEY_R:82,KEY_T:84},_keyHandlerTimeout:null,keyDownHandler:function(b){var c=window.event?window.event:b; var h=(c.keyCode)?c.keyCode:((c.which)?c.which:0);window.clearTimeout(this._keyHandlerTimeout); var g="";switch(true){case ((h==this.KEYS.KEY_0)&&c.ctrlKey):Event.stop(b);this.selectSizeFromMenu(this.sizesSmallControl); break;case ((h==this.KEYS.KEY_1)&&c.ctrlKey):Event.stop(b);this.selectSizeFromMenu(this.sizesMediumControl); break;case ((h==this.KEYS.KEY_2)&&c.ctrlKey):Event.stop(b);this.selectSizeFromMenu(this.sizesLargeControl); break;case ((h==this.KEYS.KEY_3)&&c.ctrlKey):Event.stop(b);this.selectSizeFromMenu(this.sizesHDControl); break;case (!Media.Detection.Firefox()&&((h==this.KEYS.KEY_T)&&c.metaKey&&c.altKey)):case ((h==this.KEYS.KEY_C)&&c.ctrlKey&&c.shiftKey):Event.stop(b); this.toggleCaptions();this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_RIGHT_ARROW)&&c.metaKey):Event.stop(b);this.show(); this.fastForward();this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_LEFT_ARROW)&&c.metaKey):Event.stop(b);this.show(); this.fastBackward();this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_RIGHT_ARROW)&&c.altKey):Event.stop(b);this.show(); this.pause();var f=+(1);this.scrubber.setValue(f);if(!this._seeking){this._seeking=true; this._send("beginSeeking");this.resetRate()}this._send("setTime",+(f*this._send("duration")-0.1)); window.setTimeout(function(){this.trackProgress.style.width=+((this.scrubber.maximum*f)-4)+"px"; this.playhead.style.left=+((this.scrubber.maximum*f)-4)+"px"}.bind(this),50);this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_LEFT_ARROW)&&c.altKey):Event.stop(b);this.show(); this.pause();var f=+(0);this.scrubber.setValue(f);if(!this._seeking){this._seeking=true; this._send("beginSeeking");this.resetRate()}this._send("setTime",+(f*this._send("duration")+0.1)); window.setTimeout(function(){this.trackProgress.style.width=f+"px";this.playhead.style.left=f+"px" }.bind(this),50);this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_RIGHT_ARROW)):break;case ((h==this.KEYS.KEY_LEFT_ARROW)):break; case (h==this.KEYS.KEY_SPACE):Event.stop(b);this.show();this.togglePlaying();this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_UP_ARROW)&&c.altKey):Event.stop(b);this.show();this.fullVolume(); this.volumeControlSetting=1;this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_DOWN_ARROW)&&c.altKey):Event.stop(b);this.show(); this.muteVolume();this.volumeControlSetting=0;this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case (h==this.KEYS.KEY_UP_ARROW):Event.stop(b);this.show();var d=this._send("volume"),a=+(d+0.1),e=(a<1)?a:1; this._send("setVolume",e);this.volumeScrubber.setValue(e);this.volumeControlSetting=e; this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500);break;case (h==this.KEYS.KEY_DOWN_ARROW):Event.stop(b); this.show();var d=this._send("volume"),a=+(d-0.1),e=(a>0)?a:0;this._send("setVolume",e); this.volumeScrubber.setValue(e);this.volumeControlSetting=e;this._keyHandlerTimeout=window.setTimeout(this.hide.bind(this),2500); break;case ((h==this.KEYS.KEY_R)&&c.metaKey):Event.stop(b);window.location.reload(false); break;default:return true;break}},createTrackScrubber:function(){if(this.track){var a=this.track.offsetWidth; if(!this.scrubber&&this.element!==null){this.scrubber=new Control.Slider(this.playhead,this.track,{alignX:-5,increment:1,sliderValue:0,minimum:0,maximum:a,onSlide:function(b){if(!this._seeking){this._seeking=true; this._send("beginSeeking");this.resetRate()}this._send("setTime",b*this._send("duration")); this.trackProgress.style.width=this.playhead.style.left}.bind(this),onChange:function(b){if(this._seeking){this._seeking=false; this._send("endSeeking")}this.trackProgress.style.width=this.playhead.style.left }.bind(this)})}}},createVolumeScrubber:function(){if(!this.volumeScrubber&&this.element!==null){var a=this.volumeTrack.offsetWidth; this.volumeScrubber=new Control.Slider(this.volumeThumb,this.volumeTrack,{alignX:-3,increment:1,sliderValue:0,minimum:0,maximum:a,onSlide:function(b){this._volSeeking=true; this._send("setVolume",b);this.volumeProgress.style.width=this.volumeThumb.style.left }.bind(this),onChange:function(b){this._volSeeking=false;this.volumeProgress.style.width=this.volumeThumb.style.left }.bind(this)});if(typeof this.volumeControlSetting=="undefined"){this.volumeControlSetting=1 }this.volumeScrubber.setValue(this.volumeControlSetting)}},getRoundRectForArcAndOpacity:function(c,b){if(Media.Detection.CSSBorderRadius()!==false){return false }if(typeof this.hasVMLNameSpaceDefined=="undefined"||this.hasVMLNameSpaceDefined==false){this.setVML() }var a=document.createElement("v:roundrect"),d=document.createElement("v:fill"); a.setAttribute("arcsize",c);a.setAttribute("fill","true");a.setAttribute("fillcolor","#000000"); a.setAttribute("stroked","false");a.className="border-radius-box";d.setAttribute("type","background"); d.setAttribute("opacity",b);d.className="border-radius-fill";if(typeof a=="object"){a.appendChild(d); return a}else{return false}},setVML:function(){if(!document.namespaces){return}var c,a,d,b=document.getElementsByTagName("head")[0]; this.hasVMLNameSpaceDefined=false;for(c=0,a=document.namespaces.length;c0){this.settingsMenuList.removeChild(this.currentMenu) }this.currentMenu=false}this.positionSettingsMenuForControl(a);Element.addClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-hovered"); Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName);this._unselectControl(this.sizesControl); this._unselectControl(this.downloadControl);this._unselectControl(this.shareControl) },mouseoutSettingsControl:function(a,g){return;var a=a||window.event,d=Element.cumulativeOffset(this.settingsMenu).top,f=Element.cumulativeOffset(this.settingsMenu).left,e=this.settingsMenu.offsetWidth,h=this.settingsMenu.offsetHeight,c,b; if(a){c=a.pageX||(a.clientX+(document.documentElement.scrollLeft)?document.documentElement.scrollLeft:document.body.scrollLeft); b=a.pageY||(a.clientY+(document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop); if(!(c>f&&c<(f+e)&&b>d&&b<(d+h+14))){Element.addClassName(this.settingsMenu,this.settingsMenu.baseClassName); Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-hovered") }}},positionSettingsMenuForControl:function(j){this.positionCarrotForControl(j); if(typeof this.settingsMenuRoundRect!="undefined"&&this.settingsMenuRoundRect!==false){var p=this.settingsMenuList.getElementsByTagName("li"),r=j.menuListWidth,o=parseInt(((p.length>0)?22:0)+this.settingsMenuTitle.offsetHeight+(p.length*25)),i=Math.min((7/Math.min(o,r)),1).toFixed(2),n=this.settingsMenu.childNodes,s=this.settingsMenu.node; try{while(typeof this.settingsMenuRoundRect!="undefined"&&this.settingsMenuRoundRect.firstChild){this.settingsMenuRoundRect.removeChild(this.settingsMenuRoundRect.firstChild) }}catch(v){}this.settingsMenu.removeChild(this.settingsMenuRoundRect);this.settingsMenuRoundRect=this.getRoundRectForArcAndOpacity(i,0.9); this.settingsMenu.insertBefore(this.settingsMenuRoundRect,this.settingsMenu.firstChild); if(r&&o){this.settingsMenuList.style.display="block";this.settingsMenu.style.width=r+"px"; this.settingsMenu.style.height=o+"px"}else{this.settingsMenu.style.display="none" }}else{if(typeof j.menuListWidth!="undefined"){this.settingsMenuList.style.width=j.menuListWidth+"px" }}var u=parseInt(this.settingsMenuCarrot.style.top),h=parseInt(this.settingsMenuCarrot.style.left),q=this.settingsMenu.offsetHeight,a=this.settingsMenu.offsetWidth,b=Element.cumulativeOffset(this.mediaController).left,d=this.mediaController.offsetWidth,g=this.settingsMenuCarrot.offsetHeight,l=this.settingsMenuCarrot.offsetWidth,A=u-q+g,m=(b+d)-a,c=Element.cumulativeOffset(j).left,t=c+(j.offsetWidth/2),f,z,k,y,x; switch(this.controllerType){case"slim":case"short-slim":var w=(b+d+20)-a;this.settingsMenu.style.top=(u+g)+"px"; this.settingsMenu.style.left=((w0){this.settingsMenuList.removeChild(this.currentMenu) }}this.settingsMenuList.appendChild(c);this.currentMenu=c},_unselectMenu:function(){Element.addClassName(this.settingsMenu,this.settingsMenu.baseClassName); Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-selected"); Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-hovered") },_selectControl:function(a){Element.addClassName(a,a.baseClassName+"-selected"); if(a===this.sizesControl||a===this.downloadControl||a===this.shareControl){Element.addClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-selected"); Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName);Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-hovered"); this._currentSettingsControl=a}},_unselectControl:function(a){if(a){Element.removeClassName(a,a.baseClassName+"-selected") }},_enableControl:function(a){if(a){Element.addClassName(a,a.baseClassName+"-enabled") }},_disableControl:function(a){if(a){Element.removeClassName(a,a.baseClassName+"-enabled") }},reset:function(){if(typeof this.scrubber!="undefined"){this.playhead.style.left="0px"; this.trackProgress.style.width=this.playhead.style.left;this.show();if(this.playControl){Element.show(this.playControl) }if(this.pauseControl){Element.hide(this.pauseControl)}this._disableControl(this.volumeMuteControl); this._disableControl(this.volumeFullControl);this._disableControl(this.volumeThumb); this._disableControl(this.playControl);this._disableControl(this.pauseControl); this._disableControl(this.playhead);this._disableControl(this.fastBackwardControl); this._disableControl(this.fastForwardControl);this.removeAdvancedPlayDisplay()}},resetSettingsControls:function(){this.resetSettingsMenus() },resetSettingsMenus:function(){this.resettingMenus=true;if(this.alertDisplayContainer){Element.removeClassName(this.alertDisplayContainer,this.alertDisplayContainer.baseClassName+"-active") }if(this.settingsMenu){Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-hovered"); Element.removeClassName(this.settingsMenu,this.settingsMenu.baseClassName+"-selected") }this.toggleSizesMenu();this.toggleDownloadMenu();this.toggleShareMenu();this.resettingMenus=false },resetRate:function(){if(this._send("rate")!==1){this.removeAdvancedPlayDisplay(); this._send("setRate",1)}},removeAdvancedPlayDisplay:function(){this.removeAlertDisplay(); Element.removeClassName(this.fastBackwardControl,"fastBackward-active");Element.removeClassName(this.fastForwardControl,"fastForward-active") },removeAlertDisplay:function(){if(this.fastBackwardControl){this.setRateDisplay(this.fastBackwardControl,null) }if(this.fastForwardControl){this.setRateDisplay(this.fastForwardControl,null)}if(this.alertDisplayContainer){Element.removeClassName(this.alertDisplayContainer,this.alertDisplayContainer.baseClassName+"-active") }},setSettingsControlsClass:function(){var b=this.settingsControls.baseClassName,a=0; if(typeof this.captionsControl.isEnabled!="undefined"&&this.captionsControl.isEnabled===true){b+="-captions"; a++}if(typeof this.sizesControl.isEnabled!="undefined"&&this.sizesControl.isEnabled===true){b+="-sizes"; a++}if(typeof this.downloadControl.isEnabled!="undefined"&&this.downloadControl.isEnabled===true){b+="-download"; a++}if(typeof this.shareControl.isEnabled!="undefined"&&this.shareControl.isEnabled===true){b+="-share"; a++}this.settingsControls.className="";Element.addClassName(this.settingsControls,this.settingsControls.baseClassName); Element.addClassName(this.settingsControls,b);this.setTrackContainerWidth()},setTrackContainerWidth:function(){if(this.controllerType==="regular"||!this.settingsControls||!this.trackContainer){return }var e=(this.settingsControls.offsetWidth>0)?parseInt(this.settingsControls.offsetWidth+10):0,b=this.mediaController.offsetLeft,d=this.mediaController.offsetWidth,c=parseInt(b+d); newTrackWidth=parseInt(((c-this.trackContainer.offsetLeft)<=600)?(c-this.trackContainer.offsetLeft):600),newTrackContainerWidth=parseInt(newTrackWidth-(e+10)); if(this.controllerType==="slim"){var a=parseInt(this.trackContainer.offsetLeft+newTrackContainerWidth+20); if(c