=0){o[l]=o[l].substr(o[l].indexOf("1){g(m)}else{b("Invalid DFXP file: "+c)}}function k(o){var n={};try{var l=o.indexOf('begin="');o=o.substr(l+7);l=o.indexOf('" end="');n.begin=j(o.substr(0,l));o=o.substr(l+7);l=o.indexOf('">');n.end=j(o.substr(0,l));o=o.substr(l+2);n.text=o}catch(m){}return n}function e(){d=new XMLHttpRequest();d.onreadystatechange=function(){if(d.readyState===4){if(d.status===200){f(d.responseText)}else{h(d.status)}}}}e()}})(jwplayer.html5.parsers);(function(b){var a=b.html5.parsers;var d=a.jwparser=function(){};var c="jwplayer";d.parseEntry=function(h,j){for(var f=0;f0){q=g.parseGroup(n,q)}if(h(n,"url")){if(!q.sources){q.sources=[]}q.sources.push({file:h(n,"url"),type:h(n,"type"),width:h(n,"width"),label:h(n,"height")?h(n,"height")+"p":undefined})}break;case"title":q.title=a(n);break;case"description":q.description=a(n);break;case"guid":q.mediaid=a(n);break;case"thumbnail":q.image=h(n,"url");break;case"player":var k=n.url;break;case"group":g.parseGroup(n,q);break;case"subtitle":var m={};m.file=h(n,"url");if(h(n,"lang").length>0){m.label=p(h(n,"lang"))}j.push(m)}}}if(j.length>0){q.captions=j}return q}})(jwplayer.html5.parsers);(function(g){var b=jwplayer.utils,a=g.textContent,e=g.getChildNode,f=g.numChildren,d=g.localName;g.rssparser={};g.rssparser.parse=function(o){var h=[];for(var m=0;m1){h(o)}else{b("Invalid SRT file: "+d)}}function k(s){var r={};var t=s.split("\r\n");if(t.length==1){t=s.split("\n")}try{var n=1;if(t[0].indexOf(" --> ")>0){n=0}var p=t[n].indexOf(" --> ");if(p>0){r.begin=l(t[n].substr(0,p));r.end=l(t[n].substr(p+5))}if(t[n+1]){r.text=t[n+1];for(var q=n+2;q"+t[q]}}}catch(o){}return r}function c(n){if(n&&n.indexOf("://")>=0){if(n.split("/")[2]!=window.location.href.split("/")[2]){return true}}return false}function f(){e=new XMLHttpRequest();e.onreadystatechange=function(){if(e.readyState===4){if(e.status===200){g(e.responseText)}else{j(e.status)}}}}f()}})(jwplayer.html5.parsers);(function(e){var k=jwplayer.utils,l=jwplayer.events,m=l.state,h=k.css,g="playing",j=document,a=".jwcaptions",b="absolute",c="none",f="100%",d="hidden";e.captions=function(H,u){var N=H,v,w,K={back:true,color:"#FFFFFF",fontSize:15},J={fontFamily:"Arial,sans-serif",fontStyle:"normal",fontWeight:"normal",textDecoration:"none"},R,Q,y,s=[],r=0,S=false,F,B=new l.eventdispatcher();k.extend(this,B);function D(){v=j.createElement("div");v.id=N.id+"_caption";v.className="jwcaptions";N.jwAddEventListener(l.JWPLAYER_PLAYER_STATE,C);N.jwAddEventListener(l.JWPLAYER_PLAYLIST_ITEM,M);N.jwAddEventListener(l.JWPLAYER_MEDIA_ERROR,L);N.jwAddEventListener(l.JWPLAYER_ERROR,L);N.jwAddEventListener(l.JWPLAYER_READY,t);N.jwAddEventListener(l.JWPLAYER_MEDIA_TIME,n);N.jwAddEventListener(l.JWPLAYER_FULLSCREEN,x)}function L(U){k.log("CAPTIONS("+U+")")}function G(){Q="idle";q()}function C(U){switch(U.newstate){case m.IDLE:G();break;case m.PLAYING:A();break}}function x(U){S=U.fullscreen;if(U.fullscreen){I();setTimeout(I,500)}else{q()}}function I(){var U=v.offsetHeight,V=v.offsetWidth;if(U!=0&&V!=0){R.resize(V,Math.round(U*0.94))}}function M(Z){y=0;s=[];R.update(0);var Y=N.jwGetPlaylist()[N.jwGetPlaylistIndex()],U=Y.captions,X=0,V="",W="";if(U){for(X=0;X0){R.show();if(S){x({fullscreen:true});return}var U=N.jwGetWidth();if(N._model&&N._model.config&&N._model.config.listbar&&N._model.config.listbar.size){U=U-N._model.config.listbar.size}R.resize(U,Math.round(N.jwGetHeight()*0.94))}else{R.hide()}}}function t(){for(var U in K){if(u&&u[U.toLowerCase()]!=undefined){if(U=="color"){J.color="#"+String(u.color).substr(-6)}else{J[U]=u[U.toLowerCase()]}}else{J[U]=K[U]}}R=new jwplayer.html5.captions.renderer(J,v);q()}function o(U){if(U>0){y=U-1;r=U}else{r=0}if(s[y].data){R.populate(s[y].data)}else{T(s[y].file)}q()}function n(U){R.update(U.position)}function O(X,W,V){var U={type:X,tracks:W,track:V};B.sendEvent(X,U)}function p(){var V=new Array();V.push({label:"(Off)"});for(var U=0;U=0&&r!=U&&U<=s.length){o(U);O(l.JWPLAYER_CAPTIONS_CHANGED,p(),r)}};D()};h(a,{position:b,cursor:"pointer",width:f,height:f,overflow:d})})(jwplayer.html5);(function(a){a.captions.renderer=function(q,g){var j,p,f,k,o,l,b="visible",e;this.hide=function(){c({display:"none"})};this.populate=function(r){k=-1;p=r;d()};function m(r){c({left:"0px",top:"0px"});f.innerHTML=r;if(r==""){b="hidden"}else{b="visible"}setTimeout(n,20)}this.resize=function(s,r){e=s;j=r;n()};function n(){c({left:"0px",top:"0px"});var s=Math.round(q.fontSize*Math.pow(e/400,0.6)),r=Math.round(s*1.4),u,t;c({maxWidth:e+"px",fontSize:s+"px",lineHeight:r+"px",visibility:b});u=Math.round(e/2-f.clientWidth/2);t=Math.round(j-f.clientHeight);c({left:u+"px",top:t+"px"})}function d(){var s=-1;for(var r=0;r=l)){s=r;break}}if(s==-1){m("")}else{if(s!=k){k=s;m(p[r]["text"])}}}function h(){f=document.createElement("div");g.appendChild(f);c({color:"#"+q.color.substr(-6),display:"block",fontFamily:q.fontFamily,fontStyle:q.fontStyle,fontWeight:q.fontWeight,height:"auto",margin:"0 0 0 0",padding:"3px 9px",position:"absolute",textAlign:"center",textDecoration:q.textDecoration,wordWrap:"break-word",width:"auto"});if(q.back){c({background:"#000"})}else{c({textShadow:"-2px 0px 1px #000,2px 0px 1px #000,0px -2px 1px #000,0px 2px 1px #000,-1px 1px 1px #000,1px 1px 1px #000,1px -1px 1px #000,1px 1px 1px #000"})}}h();this.show=function(){c({display:"block"});n()};function c(r){for(var s in r){f.style[s]=r[s]}}this.update=function(r){l=r;if(p){d()}}}})(jwplayer.html5);(function(q){var m=q.html5,z=q.utils,c=q.events,g=c.state,t=z.css,C=z.transitionStyle,d="button",s="text",h="divider",v="slider",k="relative",l="absolute",b="none",r="block",A="inline",p="inline-block",n="hidden",e="left",F="right",o="100%",x="opacity .15s, background .15s, visibility .15s",w={display:b},a={display:E},D=".jwcontrolbar",u=false,j=true,B=null,E=undefined,y=window,f=document;m.controlbar=function(ai,aW){var a7,Y,N=ao("divider",h),J={margin:8,maxwidth:800,font:"Arial,sans-serif",fontsize:11,fontcolor:parseInt("eeeeee",16),fontweight:"bold",layout:{left:{position:"left",elements:[ao("play",d),N,ao("prev",d),ao("next",d),ao("divider",h,"nextdiv"),ao("elapsed",s)]},center:{position:"center",elements:[ao("time",v)]},right:{position:"right",elements:[ao("duration",s),N,ao("hd",d),ao("cc",d),N,ao("mute",d),ao("volume",v),N,ao("fullscreen",d)]}}},aH,ba,aw,R,bq,aM,bA,an,a5,ax,bm,ak,bt,bk,aL,aB,Z,bj,ap,by,U,aX,aC,M,a0,a6=u,aV=u,aY=0,W=0,bu={play:"pause",mute:"unmute",fullscreen:"normalscreen"},bF={play:u,mute:u,fullscreen:u},bf={play:al,mute:bB,fullscreen:aT,next:a8,prev:aK},bD={time:bE,volume:aS},O={},ah=this;function ao(bH,bJ,bI){return{name:bH,type:bJ,className:bI}}function be(){aw={};a7=ai;aM=a7.id+"_controlbar";bA=an=0;bq=aO();bq.id=aM;bq.className="jwcontrolbar";Y=a7.skin;ba=Y.getComponentLayout("controlbar");if(!ba){ba=J.layout}z.clearCss("#"+aM);bx();aZ();aa();setTimeout(function(){P();bz()},0);ah.visible=false}function aa(){a7.jwAddEventListener(c.JWPLAYER_MEDIA_TIME,bh);a7.jwAddEventListener(c.JWPLAYER_PLAYER_STATE,ad);a7.jwAddEventListener(c.JWPLAYER_MEDIA_MUTE,bz);a7.jwAddEventListener(c.JWPLAYER_MEDIA_VOLUME,P);a7.jwAddEventListener(c.JWPLAYER_MEDIA_BUFFER,ag);a7.jwAddEventListener(c.JWPLAYER_FULLSCREEN,ay);a7.jwAddEventListener(c.JWPLAYER_PLAYLIST_LOADED,ar);a7.jwAddEventListener(c.JWPLAYER_MEDIA_LEVELS,bC);a7.jwAddEventListener(c.JWPLAYER_MEDIA_LEVEL_CHANGED,bc);a7.jwAddEventListener(c.JWPLAYER_CAPTIONS_LIST,bs);a7.jwAddEventListener(c.JWPLAYER_CAPTIONS_CHANGED,am);bq.addEventListener("mouseover",function(){y.addEventListener("mousemove",T,u);y.addEventListener("mouseup",T,u);y.addEventListener("mousedown",aE,u)},false);bq.addEventListener("mouseout",function(){y.removeEventListener("mousemove",T);y.removeEventListener("mouseup",T);y.removeEventListener("mousedown",aE);f.onselectstart=null},false)}function bh(bI){var bH=u,bJ;if(aw.elapsed){bJ=z.timeFormat(bI.position);aw.elapsed.innerHTML=bJ;bH=(bJ.length!=z.timeFormat(an).length)}if(aw.duration){bJ=z.timeFormat(bI.duration);aw.duration.innerHTML=bJ;bH=(bH||(bJ.length!=z.timeFormat(bA).length))}if(bI.duration>0){au(bI.position/bI.duration)}else{au(0)}bA=bI.duration;an=bI.position;if(bH){aR()}}function ad(bH){switch(bH.newstate){case g.BUFFERING:case g.PLAYING:t(aU(".jwtimeSliderThumb"),{opacity:1});L("play",j);break;case g.PAUSED:if(!aV){L("play",u)}break;case g.IDLE:L("play",u);t(aU(".jwtimeSliderThumb"),{opacity:0});if(aw.timeRail){aw.timeRail.className="jwrail";setTimeout(function(){aw.timeRail.className+=" jwsmooth"},100)}at(0);bh({position:0,duration:0});break}}function bz(){var bH=a7.jwGetMute();L("mute",bH);H(bH?0:bt)}function P(){bt=a7.jwGetVolume()/100;H(bt)}function ag(bH){at(bH.bufferPercent/100)}function ay(bH){L("fullscreen",bH.fullscreen);bo()}function ar(bH){t(aU(".jwhd"),w);t(aU(".jwcc"),w);bo();aR()}function bC(bH){a5=bH.levels;if(a5&&a5.length>1&&U){t(aU(".jwhd"),{display:E});U.clearOptions();for(var bI=0;bI=0){U.setActive(bH.currentQuality)}}function bs(bH){bm=bH.tracks;if(bm&&bm.length>1&&aC){t(aU(".jwcc"),{display:E});aC.clearOptions();for(var bI=0;bI=0){aC.setActive(bH.track)}}function bn(){return(!!f.querySelector("#"+a7.id+" .jwplaylist")&&!a7.jwGetFullscreen())}function bx(){aH=z.extend({},J,Y.getComponentSettings("controlbar"),aW);R=aI("background").height;t("#"+aM,{height:R,bottom:a6?0:aH.margin});t(aU(".jwtext"),{font:aH.fontsize+"px/"+aI("background").height+"px "+aH.font,color:aH.fontcolor,"font-weight":aH.fontweight});t(aU(".jwoverlay"),{bottom:R});if(aH.maxwidth>0){t(aU(),{"max-width":aH.maxwidth})}}function aU(bH){return"#"+aM+(bH?" "+bH:"")}function aO(){return br("span")}function br(bH){return f.createElement(bH)}function aZ(){var bJ=aq("capLeft");var bI=aq("capRight");var bH=aq("background",{position:l,left:aI("capLeft").width,right:aI("capRight").width,"background-repeat":"repeat-x"},j);if(bH){a1(bq,bH)}if(bJ){a1(bq,bJ)}bg();if(bI){a1(bq,bI)}}function aQ(bH){switch(bH.type){case h:return aA(bH);break;case s:return bG(bH.name);break;case d:if(bH.name!="blank"){return X(bH.name)}break;case v:return av(bH.name);break}}function aq(bJ,bI,bK,bO,bL){var bN=aO();bN.className="jw"+bJ;var bH=bO?" left center":" center";var bP=aI(bJ);bN.innerHTML=" ";if(!bP||bP.src==""){return}var bM;if(bK){bM={background:"url('"+bP.src+"') repeat-x "+bH,height:bL?bP.height:E}}else{bM={background:"url('"+bP.src+"') no-repeat"+bH,width:bP.width,height:bL?bP.height:E}}bN.skin=bP;t(aU(".jw"+bJ),z.extend(bM,bI));aw[bJ]=bN;return bN}function X(bJ){if(!aI(bJ+"Button").src){return B}var bL=aO();bL.className="jw"+bJ+" jwbuttoncontainer";var bK=br("button");bK.addEventListener("click",aj(bJ),u);bK.innerHTML=" ";a1(bL,bK);var bM=aI(bJ+"Button");var bI=aI(bJ+"ButtonOver");bb(aU(".jw"+bJ+" button"),bM,bI);var bH=bu[bJ];if(bH){bb(aU(".jw"+bJ+".jwtoggle button"),aI(bH+"Button"),aI(bH+"ButtonOver"))}aw[bJ]=bL;return bL}function bb(bH,bI,bJ){if(!bI.src){return}t(bH,{width:bI.width,background:"url("+bI.src+") center no-repeat"});if(bJ.src){t(bH+":hover",{background:"url("+bJ.src+") center no-repeat"})}}function aj(bH){return function(){if(bf[bH]){bf[bH]()}}}function al(){if(bF.play){a7.jwPause()}else{a7.jwPlay()}}function bB(){a7.jwSetMute();bz({mute:bF.mute})}function aP(bI){for(var bH in O){if(bH!=bI&&O.hasOwnProperty(bH)){O[bH].hide()}}}function V(){if(a6){return}bk.show();aP("volume")}function aS(bH){H(bH);if(bH<0.1){bH=0}if(bH>0.9){bH=1}a7.jwSetVolume(bH*100)}function bp(){if(a6){return}M.show();aP("fullscreen")}function bE(bH){a7.jwSeek(bH*bA)}function aT(){a7.jwSetFullscreen()}function a8(){a7.jwPlaylistNext()}function aK(){a7.jwPlaylistPrev()}function L(bH,bI){if(!z.exists(bI)){bI=!bF[bH]}if(aw[bH]){aw[bH].className="jw"+bH+(bI?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){aw[bH].className=aw[bH].className.replace(" jwtoggling","")},100)}bF[bH]=bI}function az(bH){return aM+"_"+bH}function bG(bH,bL){var bJ={};var bK=aI(bH+"Background");if(bK.src){var bI=aO();bI.id=az(bH);bI.className="jwtext jw"+bH;bJ.background="url("+bK.src+") no-repeat center";bJ["background-size"]="100% "+aI("background").height+"px";t(aU(".jw"+bH),bJ);bI.innerHTML="00:00";aw[bH]=bI;return bI}return null}function aA(bI){var bH;if(bI.width){bH=aO();bH.className="jwblankDivider";t(bH,{width:parseInt(bI.width)})}else{if(bI.element){bH=aq(bI.element)}else{bH=aq(bI.name);if(!bH){bH=aO();bH.className="jwblankDivider"}}}if(bI.className){bH.className+=" "+bI.className}return bH}function aF(){if(a5&&a5.length>1){if(by){clearTimeout(by);by=undefined}U.show();aP("hd")}}function af(){if(bm&&bm.length>1){if(aX){clearTimeout(aX);aX=undefined}aC.show();aP("cc")}}function a3(bH){if(bH>=0&&bH=0&&bH50){aN(bH);W=bJ}if(!aV||bH.button!=0){return}var bL=aw[aV].getElementsByClassName("jwrail")[0],bM=z.bounds(bL),bI=aV,bK=aw[bI].vertical?(bM.bottom-bH.pageY)/bM.height:(bH.pageX-bM.left)/bM.width;if(bH.type=="mouseup"){if(bI=="time"){a7.jwSeekDrag(u)}aw[bI+"Rail"].className="jwrail jwsmooth";aV=B;bD[bI](bK)}else{if(aV=="time"){au(bK)}else{H(bK)}if(bJ-aY>500){aY=bJ;bD[aV](bK)}}return false}function bd(bH){if(bj&&bA&&!a6){bj.show()}}function ab(bH){if(bj){bj.hide()}}function aN(bI){Z=z.bounds(aB);if(!Z||Z.width==0){return}var bJ=bj.element(),bH=(bI.pageX-Z.left)-y.pageXOffset;if(bH>=0&&bH<=Z.width){bJ.style.left=Math.round(bH)+"px";Q(bA*bH/Z.width)}}function Q(bH){ap.innerHTML=z.timeFormat(bH)}function bv(bH){if(aw.timeSliderThumb){t(aU(".jwtimeSliderThumb"),{"margin-left":(aI("timeSliderThumb").width/-2)})}at(0);au(0)}function ac(bJ,bH,bL,bI){var bK="volume";t(aU(".jwvolume"),{width:aI(bK+"Rail").width+(bH?0:aI(bK+"Cap"+bL).width+aI(bK+"Cap"+bI).width),height:bH?(aI(bK+"Cap"+bL).height+aI(bK+"Rail").height+aI(bK+"RailCap"+bL).height+aI(bK+"RailCap"+bI).height+aI(bK+"Cap"+bI).height):E});if(bH){bJ.className+=" jwvertical"}}var S={};function bg(){G("left");G("center");G("right");a1(bq,S.left);a1(bq,S.center);a1(bq,S.right);bl();t(aU(".jwright"),{right:aI("capRight").width})}function bl(){if(aw.hd){U=new m.menu("hd",aM+"_hd",Y,a3);bw(U,aw.hd,aF,K);O.hd=U}if(aw.cc){aC=new m.menu("cc",aM+"_cc",Y,ae);bw(aC,aw.cc,af,bi);O.cc=aC}if(aw.mute&&aw.volume&&aw.volume.vertical){bk=new m.overlay(aM+"_volumeoverlay",Y);bk.setContents(aw.volume);bw(bk,aw.mute,V);O.volume=bk}if(aw.fullscreen){M=new m.overlay(aM+"_fullscreenoverlay",Y);var bH=br("div");bH.className="jwoverlaytext";bH.innerHTML="Fullscreen";M.setContents(bH);bw(M,aw.fullscreen,bp);O.fullscreen=M}}function bi(){aX=setTimeout(aC.hide,500)}function K(){by=setTimeout(U.hide,500)}function bw(bH,bJ,bK,bL){var bI=bH.element();a1(bJ,bI);bJ.addEventListener("mousemove",bK,u);if(bL){bJ.addEventListener("mouseout",bL,u)}else{bJ.addEventListener("mouseout",bH.hide,u)}t("#"+bI.id,{left:"50%"})}function G(bI){var bH=aO();bH.className="jwgroup jw"+bI;S[bI]=bH;if(ba[bI]){I(ba[bI],S[bI])}}function I(bK,bH){if(bK&&bK.elements.length>0){for(var bJ=0;bJaH.maxwidth),bK=a6?0:aH.margin;t(aU(),{left:bH?"50%":bK,right:bH?E:bK,"margin-left":bH?bq.clientWidth/-2:E,width:bH?o:E});aD()};function bo(){if(a7.jwGetPlaylist().length>1&&!bn()){t(aU(".jwnext"),a);t(aU(".jwprev"),a);t(aU(".nextdiv"),a)}else{t(aU(".jwnext"),w);t(aU(".jwprev"),w);t(aU(".nextdiv"),w)}}function aD(){var bJ,bI,bH;aL=z.bounds(bq);for(bI in O){bH=O[bI];bH.offsetX(0);bJ=z.bounds(bH.element());if(bJ.right>aL.right){bH.offsetX(aL.right-bJ.right)}else{if(bJ.left0?1:0}}function aG(bK,bO){var bI=aw[bK].vertical,bN=bK+(bK=="time"?"Slider":""),bM=100*Math.min(Math.max(0,bO),1)+"%",bJ=aw[bN+"Progress"],bH=aw[bN+"Thumb"],bL=u;if(bJ){if(bI){bJ.style.height=bM;bJ.style.bottom=0;if(bJ.clientHeight<=bJ.capSize){bL=j}}else{bJ.style.width=bM;if(bJ.clientWidth<=bJ.capSize){bL=j}}bJ.style.opacity=((!bL&&bO>0)||aV)?1:0}if(bH){if(bI){bH.style.top=0}else{bH.style.left=bM}}}function H(bH){aG("volume",bH)}function au(bH){aG("time",bH)}function aI(bH){var bI=Y.getSkinElement(bH.indexOf("volume")==0?"tooltip":"controlbar",bH);if(bI){return bI}else{return{width:0,height:0,src:"",image:E,ready:u}}}function a1(bH,bI){bH.appendChild(bI)}ah.show=function(){ah.visible=true;bq.style.opacity=1};ah.hide=function(){ah.visible=false;bq.style.opacity=0};be()};t(D,{position:l,opacity:0});t(D+" span",{height:o});z.dragStyle(D+" span",b);t(D+" .jwgroup",{display:A});t(D+" span, "+D+" .jwgroup button,"+D+" .jwleft",{position:k,"float":e});t(D+" .jwright",{position:l});t(D+" .jwcenter",{position:l});t(D+" buttoncontainer,"+D+" button",{display:p,height:o,border:b,cursor:"pointer"});t(D+" .jwcapRight,"+D+" .jwtimeSliderCapRight,"+D+" .jwvolumeCapRight",{right:0,position:l});t(D+" .jwcapBottom",{bottom:0,position:l});t(D+" .jwtime",{position:l,height:o,width:o,left:0});t(D+" .jwthumb",{position:l,height:o,cursor:"pointer"});t(D+" .jwrail",{position:l,cursor:"pointer"});t(D+" .jwrailgroup",{position:l,width:o});t(D+" .jwrailgroup span",{position:l});t(D+" .jwdivider+.jwdivider",{display:b});t(D+" .jwtext",{padding:"0 5px","text-align":"center"});t(D+" .jwoverlaytext",{padding:3});t(D+" .jwvertical *",{display:r});C(D,x);C(D+" button",x);C(D+" .jwtime .jwsmooth span",x+", width .15s linear, left .15s linear");C(D+" .jwtoggling",b)})(jwplayer);(function(d){var c=d.html5,a=d.utils,e=d.events,b=e.state;c.controller=function(j,k){var o=j,l=k,s=j.getVideo(),z=this,L=new e.eventdispatcher(o.id,o.config.debug),u=false,p=-1,D,M,g,B=[];a.extend(this,L);function Q(){o.addEventListener(e.JWPLAYER_MEDIA_BUFFER_FULL,t);o.addEventListener(e.JWPLAYER_MEDIA_COMPLETE,function(U){setTimeout(G,25)});o.addEventListener(e.JWPLAYER_MEDIA_ERROR,function(V){var U=a.extend({},V);U.type=e.JWPLAYER_ERROR;L.sendEvent(U.type,U)})}function v(U){if(!u){l.completeSetup();L.sendEvent(U.type,U);if(d.utils.exists(window.jwplayer.playerReady)){d.playerReady(U)}o.addGlobalListener(q);l.addGlobalListener(q);L.sendEvent(d.events.JWPLAYER_PLAYLIST_LOADED,{playlist:o.playlist});L.sendEvent(d.events.JWPLAYER_PLAYLIST_ITEM,{index:o.item});O();if(o.autostart&&!a.isMobile()){H()}u=true;while(B.length>0){var V=B.shift();F(V.method,V.arguments)}}}function q(U){L.sendEvent(U.type,U)}function t(U){s.play()}function O(U){A();switch(a.typeOf(U)){case"string":S(U);break;case"object":case"array":o.setPlaylist(new d.playlist(U));break;case"number":o.setItem(U);break}}function S(V){var U=new c.playlistloader();U.addEventListener(e.JWPLAYER_PLAYLIST_LOADED,function(W){O(W.playlist)});U.addEventListener(e.JWPLAYER_ERROR,function(W){O([]);W.message="Could not load playlist: "+W.message;q(W)});U.load(V)}function H(V){if(!a.exists(V)){V=true}if(!V){return h()}try{if(p>=0){O(p);p=-1}M=H;if(!D){D=true;L.sendEvent(e.JWPLAYER_MEDIA_BEFOREPLAY);D=false;if(g){g=false;M=null;return}}if(f()){if(o.playlist.length==0){return false}s.load(o.playlist[o.item])}else{if(o.state==b.PAUSED){s.play()}}return true}catch(U){L.sendEvent(e.JWPLAYER_ERROR,U);M=null}return false}function A(){M=null;try{if(!f()){s.stop()}if(D){g=true}return true}catch(U){L.sendEvent(e.JWPLAYER_ERROR,U)}return false}function h(V){if(!a.exists(V)){V=true}if(!V){return H()}try{switch(o.state){case b.PLAYING:case b.BUFFERING:s.pause();break;default:if(D){g=true}}return true}catch(U){L.sendEvent(e.JWPLAYER_ERROR,U)}return false;if(o.state==b.PLAYING||o.state==b.BUFFERING){s.pause()}}function f(){return(o.state==b.IDLE)}function C(U){if(o.state!=b.PLAYING){H(true)}s.seek(U)}function x(U){l.fullscreen(U)}function r(U){o.stretching=U;l.resize()}function I(U){O(U);H()}function J(){I(o.item-1)}function m(){I(o.item+1)}function G(){if(!f()){return}M=G;if(o.repeat){m()}else{if(o.item==o.playlist.length-1){p=0;A();setTimeout(function(){L.sendEvent(e.JWPLAYER_PLAYLIST_COMPLETE)},0)}else{m()}}}function y(U){s.setCurrentQuality(U)}function R(){if(s){return s.getCurrentQuality()}else{return -1}}function P(){if(s){return s.getQualityLevels()}else{return null}}function T(U){l.setCurrentCaptions(U)}function K(){return l.getCurrentCaptions()}function E(){return l.getCaptionsList()}function w(){try{return o.getVideo().detachMedia()}catch(U){return null}}function n(){try{var U=o.getVideo().attachMedia();if(typeof M=="function"){M()}}catch(V){return null}}function N(U){return function(){if(u){F(U,arguments)}else{B.push({method:U,arguments:arguments})}}}function F(W,V){var U=[];for(i=0;i';this.xml=a.utils.parseXML(this.text);return this}})(jwplayer);(function(g){var o=jwplayer.utils,p=jwplayer.events,q=p.state,m=o.css,n=document,a=".jwdisplay",j=".jwpreview",l=".jwerror",d=true,k=false,b="absolute",c="none",h="100%",e="hidden",f="opacity .25s, background-image .25s, color .25s";g.display=function(u,M){var t=u,F=u.skin,X,aa,J,w,H,S,V,r=k,ab={},Q=k,W=k,T={},s,K,Y=o.extend({showicons:d,bufferrotation:45,bufferinterval:100,fontcolor:"#ccc",overcolor:"#fff",fontsize:15,fontweight:""},F.getComponentSettings("display"),M),O=new p.eventdispatcher();o.extend(this,O);function U(){X=n.createElement("div");X.id=t.id+"_display";X.className="jwdisplay";aa=n.createElement("div");aa.className="jwpreview jw"+t.jwGetStretching();X.appendChild(aa);t.jwAddEventListener(p.JWPLAYER_PLAYER_STATE,z);t.jwAddEventListener(p.JWPLAYER_PLAYLIST_ITEM,x);t.jwAddEventListener(p.JWPLAYER_PLAYLIST_COMPLETE,P);t.jwAddEventListener(p.JWPLAYER_MEDIA_ERROR,y);t.jwAddEventListener(p.JWPLAYER_ERROR,y);X.addEventListener("click",Z,k);R();z({newstate:q.IDLE})}function Z(ac){switch(t.jwGetState()){case q.PLAYING:case q.BUFFERING:t.jwPause();break;default:t.jwPlay();break}O.sendEvent(p.JWPLAYER_DISPLAY_CLICK)}this.clickHandler=Z;function R(){var ac={font:Y.fontweight+" "+Y.fontsize+"px/"+(parseInt(Y.fontsize)+3)+"px Arial,Helvetica,sans-serif",color:Y.fontcolor},ad={color:Y.overcolor};K=new g.displayicon(X.id+"_button",t,ac,ad);X.appendChild(K.element())}function B(ac,ad){if(!Y.showicons){return}if(ac||ad){K.setRotation(ac=="buffer"?parseInt(Y.bufferrotation):0,parseInt(Y.bufferinterval));K.setIcon(ac);K.setText(ad)}else{K.hide()}}function x(){C();J=t.jwGetPlaylist()[t.jwGetPlaylistIndex()];var ac=J?J.image:"";v(ac)}function v(ac){if(w!=ac){if(w){L(j,k)}w=ac;I()}else{if(w){L(j,d)}}A(t.jwGetState())}function P(){W=d;B("replay");var ac=t.jwGetPlaylist()[0];v(ac.image)}var G;function z(ac){clearTimeout(G);G=setTimeout(function(){A(ac.newstate)},100)}function A(ac){if(K){K.setRotation(0)}switch(ac){case q.IDLE:if(!Q&&!W){if(w&&!r){L(j,d)}B("play",J?J.title:"")}break;case q.BUFFERING:C();W=k;B("buffer");break;case q.PLAYING:B();break;case q.PAUSED:B("play");break}}this.hidePreview=function(ac){r=ac;L(j,!ac)};this.element=function(){return X};function N(ac){return"#"+X.id+" "+ac}function I(){if(w){var ac=new Image();ac.addEventListener("load",E,k);ac.src=w}else{m(N(j),{"background-image":undefined});L(j,k);H=S=0}}function E(){H=this.width;S=this.height;A(t.jwGetState());D();if(w){m(N(j),{"background-image":"url("+w+")"})}}function y(ac){Q=d;B("error",ac.message)}function C(){Q=k;if(ab.error){ab.error.setText()}}function D(){if(X.clientWidth*X.clientHeight>0){o.stretch(t.jwGetStretching(),aa,X.clientWidth,X.clientHeight,H,S)}}this.redraw=D;function L(ac,ad){if(!o.exists(T[ac])){T[ac]=false}if(T[ac]!=ad){T[ac]=ad;m(N(ac),{opacity:ad?1:0,visibility:ad?"visible":"hidden"})}}this.show=function(){if(K&&t.jwGetState()!=q.PLAYING){K.show()}};this.hide=function(){if(K){K.hide()}};this.setAlternateClickHandler=function(ac){_alternateClickHandler=ac};this.revertAlternateClickHandler=function(){_alternateClickHandler=undefined};U()};m(a,{position:b,cursor:"pointer",width:h,height:h,overflow:e});m(a+" .jwpreview",{position:b,width:h,height:h,background:"no-repeat center",overflow:e,opacity:0});m(a+", "+a+" *",{"-webkit-transition":f,"-moz-transition":f,"-o-transition":f})})(jwplayer.html5);(function(d){var j=jwplayer.utils,l=jwplayer.events,m=l.state,g=j.css,c=".jwdisplayIcon",f=undefined,h=document,b="none",e="100%",k="center",a="absolute";d.displayicon=function(K,F,v,C){var L=F,y=L.skin,r=K,z,M,R,B,x,q,D,H,G=0;function A(){z=O("jwdisplayIcon");z.id=r;w();q=O("jwtext",z,v,C);D=O("icon",z);o();p()}function t(S,T){return"#"+r+(T?":hover":"")+" "+(S?S:"")}function O(T,V,U,S){var W=h.createElement("div");W.className=T;if(V){V.appendChild(W)}P(T,"."+T,U,S);return W}function w(){M=I("background");R=I("capLeft");B=I("capRight");x=(R.width*B.width>0);var S={"background-image":"url("+R.src+"), url("+M.src+"), url("+B.src+")","background-position":"left,center,right","background-repeat":"no-repeat",padding:"0 "+B.width+"px 0 "+R.width+"px",height:M.height,"margin-top":M.height/-2};g(t(),S);if(M.overSrc){S["background-image"]="url("+R.overSrc+"), url("+M.overSrc+"), url("+B.overSrc+")"}g("#"+L.id+" .jwdisplay:hover "+t(),S)}function P(U,S,W,T){var V=I(U);if(U=="replayIcon"&&!V.src){V=I("playIcon")}W=j.extend({},W);if(U.indexOf("Icon")>0){G=V.width}if(V.src){W["background-image"]="url("+V.src+")";W.width=V.width}g(t(S),W);T=j.extend({},T);if(V.overSrc){T["background-image"]="url("+V.overSrc+")"}H=V;g("#"+L.id+" .jwdisplay:hover "+(S?S:t()),T)}function I(T){var U=y.getSkinElement("display",T),S=y.getSkinElement("display",T+"Over");if(U){U.overSrc=(S&&S.src)?S.src:"";return U}return{src:"",overSrc:"",width:0,height:0}}function p(){var T=x||(G==0),U="px "+e,S;g(t(".jwtext"),{display:(q.innerHTML&&T)?f:b});setTimeout(function(){S=Math.max(H.width,j.bounds(z).width-B.width-R.width);if(j.isFF()||j.isIE()){S++}if(j.isChrome()&&z.parentNode.clientWidth%2==1){S++}g(t(),{"background-size":[R.width+U,S+U,B.width+U].join(",")},true)},0)}this.element=function(){return z};this.setText=function(T){var S=q.style;q.innerHTML=T?T.replace(":",":
"):"";S.height="0";S.display="block";if(T){while(n(q)>2){q.innerHTML=q.innerHTML.replace(/(.*) .*$/,"$1...")}}S.height="";S.display="";p()};this.setIcon=function(T){var S=O("icon");S.id=z.id+"_"+T;P(T+"Icon","#"+S.id);z.replaceChild(S,D);D=S};var u,s=0,Q;function J(T,S){clearInterval(u);Q=0;s=T;if(T==0){N()}else{u=setInterval(N,S)}}function N(){Q=(Q+s)%360;j.rotate(D,Q)}this.setRotation=J;function n(S){return Math.floor(S.scrollHeight/h.defaultView.getComputedStyle(S,null).lineHeight.replace("px",""))}var o=this.hide=function(){z.style.opacity=0};var E=this.show=function(){z.style.opacity=1};A()};g(c,{display:"table",cursor:"pointer",position:"relative","margin-left":"auto","margin-right":"auto",top:"50%"},true);g(c+" div",{position:"relative",display:"table-cell","vertical-align":"middle","background-repeat":"no-repeat","background-position":k});g(c+" div",{"vertical-align":"middle"},true);g(c+" .jwtext",{color:"#fff",padding:"0 1px","max-width":"300px","overflow-y":"hidden","text-align":k,"-webkit-user-select":b,"-moz-user-select":b,"-ms-user-select":b,"user-select":b})})(jwplayer.html5);(function(e){var l=jwplayer.utils,n=jwplayer.events,o=n.state,j=l.css,d=l.bounds,a=".jwdock",h=".jwdockbuttons",g=undefined,k=document,c="none",f="100%",m="center",b="absolute";e.dock=function(z,I){var C=z,B={iconalpha:0.75,iconalphaactive:0.5,iconalphaover:1,margin:8},u=l.extend({},B,I),p=C.id+"_dock",v=C.skin,K,E=0,s={},t={},w,F,J,D=this;function x(){D.visible=false;w=H("div","jwdock");F=H("div","jwdockbuttons");w.appendChild(F);w.id=p;y();setTimeout(function(){J=d(w)})}function y(){var M=A("button"),N=A("buttonOver"),O=A("buttonActive");if(!M){return}j(q(),{height:M.height,padding:u.margin});j(h,{height:M.height});j(q("button"),{width:M.width,cursor:"pointer",border:"none",background:M.src});if(N.src){j(q("button:hover"),{background:N.src})}if(O.src){j(q("button:active"),{background:O.src})}j(q("button>div"),{opacity:u.iconalpha});j(q("button:hover>div"),{opacity:u.iconalphaover});j(q("button:active>div"),{opacity:u.iconalphaactive});j(q(".jwoverlay"),{top:u.margin+M.height});G("capLeft",F);G("capRight",F);G("divider")}function G(O,N){var M=A(O);j(q("."+O),{width:M.width,background:M.src});return H("div",O,N)}function q(M,N){return"#"+p+" "+(M?M:"")}function H(O,M,N){var P=k.createElement(O);if(M){P.className=M}if(N){N.appendChild(P)}return P}function A(M){var N=v.getSkinElement("dock",M);return N?N:{width:0,height:0,src:""}}D.redraw=function(){J=d(w)};function L(N){var Q=t[N],M,P=s[N],R,O=d(P.icon);Q.offsetX(0);R=d(w);j("#"+Q.element().id,{left:O.left-R.left+O.width/2});M=d(Q.element());if(R.left>M.left){Q.offsetX(R.left-M.left+8)}}D.element=function(){return w};D.offset=function(M){j(q(),{"margin-left":M})};D.hide=function(){D.visible=false;w.style.opacity=0;w.style.visibility="hidden"};D.show=function(){D.visible=true;w.style.opacity=1;w.style.visibility="visible"};D.addButton=function(M,U,Q,N){if(s[N]){return}var O=H("div","divider",F),P=H("button",null,F),T=H("div",null,P);T.id=p+"_"+N;T.innerHTML=" ";j("#"+T.id,{"background-image":M});if(typeof Q=="string"){Q=new Function(Q)}P.addEventListener("click",Q);s[N]={element:P,label:U,divider:O,icon:T};if(U){var V=new e.overlay(T.id+"_tooltip",v,true),R=H("div");R.id=V.id+"_label";R.innerHTML=U;j("#"+R.id,{padding:3});V.setContents(R);var S;P.addEventListener("mouseover",function(){clearTimeout(S);L(N);V.show();for(var W in t){if(W!=N){t[W].hide()}}},false);P.addEventListener("mouseout",function(){S=setTimeout(V.hide,100)},false);w.appendChild(V.element());t[N]=V}E++;r()};D.removeButton=function(M){if(s[M]){F.removeChild(s[M].element);F.removeChild(s[M].divider);delete s[M];E--;r()}};D.numButtons=function(){return E};function r(){j(h+" .capLeft, "+h+" .capRight",{display:E?"block":"none"})}x()};j(a,{position:"absolute",width:f,opacity:0,});j(a+" > *",{height:f,"float":"left"});j(a+" > .jwoverlay",{height:"auto","float":"none","z-index":99});j(h,{position:"absolute"});j(h+" button",{position:"relative"});j(h+" > *",{height:f,"float":"left"});j(h+" .divider",{display:"none"});j(h+" button ~ .divider",{display:"block"});j(h+" .capLeft, "+h+" .capRight",{display:"none"});j(h+" .capRight",{"float":"right"});j(h+" button > div",{left:0,right:0,top:0,bottom:0,margin:5,position:"absolute","background-position":"center","background-repeat":"no-repeat"});l.transitionStyle(a,"background .15s, opacity .15s");l.transitionStyle(a+" .jwoverlay","opacity .15s");l.transitionStyle(h+" button div","opacity .15s")})(jwplayer.html5);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state,f=e.playlist;a.instream=function(C,q,B,D){var x={controlbarseekable:"always",controlbarpausable:true,controlbarstoppable:true,playlistclickable:true};var z,E,G=C,I=q,n=B,A=D,v,L,s,K,j,k,l,p,u,m=false,o,h,r=this;this.load=function(P,O){g();m=true;E=c.extend(x,O);z=new f.item(P);J();h=document.createElement("div");h.id=r.id+"_instream_container";A.detachMedia();v=l.getTag();k=I.playlist[I.item];j=G.jwGetState();if(j==b.BUFFERING||j==b.PLAYING){v.pause()}L=v.src?v.src:v.currentSrc;s=v.innerHTML;K=v.currentTime;u=new a.display(r);u.setAlternateClickHandler(function(Q){if(_fakemodel.state==b.PAUSED){r.jwInstreamPlay()}else{H(d.JWPLAYER_INSTREAM_CLICK,Q)}});h.appendChild(u.element());if(!c.isMobile()){p=new a.controlbar(r);h.appendChild(p.element())}n.setupInstream(h,v);t();l.load(z)};this.jwInstreamDestroy=function(O){if(!m){return}m=false;if(j!=b.IDLE){l.load(k,false)}else{l.stop(true)}l.detachMedia();n.destroyInstream();if(p){try{p.element().parentNode.removeChild(p.getDisplayElement())}catch(P){}}H(d.JWPLAYER_INSTREAM_DESTROYED,{reason:(O?"complete":"destroyed")},true);A.attachMedia();if(j==b.BUFFERING||j==b.PLAYING){v.play();if(I.playlist[I.item]==k){I.getVideo().seek(K)}}return};this.jwInstreamAddEventListener=function(O,P){o.addEventListener(O,P)};this.jwInstreamRemoveEventListener=function(O,P){o.removeEventListener(O,P)};this.jwInstreamPlay=function(){if(!m){return}l.play(true)};this.jwInstreamPause=function(){if(!m){return}l.pause(true)};this.jwInstreamSeek=function(O){if(!m){return}l.seek(O)};this.jwInstreamGetState=function(){if(!m){return undefined}return _fakemodel.state};this.jwInstreamGetPosition=function(){if(!m){return undefined}return _fakemodel.position};this.jwInstreamGetDuration=function(){if(!m){return undefined}return _fakemodel.duration};this.playlistClickable=function(){return(!m||E.playlistclickable.toString().toLowerCase()=="true")};function w(){_fakemodel=new a.model({});o=new d.eventdispatcher();G.jwAddEventListener(d.JWPLAYER_RESIZE,t);G.jwAddEventListener(d.JWPLAYER_FULLSCREEN,t)}function g(){A.setMute(I.mute);A.setVolume(I.volume)}function J(){if(!l){l=new a.video(I.getVideo().getTag());l.addGlobalListener(M);l.addEventListener(d.JWPLAYER_MEDIA_META,N);l.addEventListener(d.JWPLAYER_MEDIA_COMPLETE,y);l.addEventListener(d.JWPLAYER_MEDIA_BUFFER_FULL,F)}l.attachMedia()}function M(O){if(m){H(O.type,O)}}function F(O){if(m){l.play()}}function y(O){if(m){setTimeout(function(){r.jwInstreamDestroy(true)},10)}}function N(O){if(O.metadata.width&&O.metadata.height){n.resizeMedia()}}function H(O,P,Q){if(m||Q){o.sendEvent(O,P)}}function t(){if(p){p.redraw()}if(u){u.redraw()}}this.jwPlay=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPlay()}};this.jwPause=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPause()}};this.jwStop=function(){if(E.controlbarstoppable.toString().toLowerCase()=="true"){this.jwInstreamDestroy();G.jwStop()}};this.jwSeek=function(O){switch(E.controlbarseekable.toLowerCase()){case"always":this.jwInstreamSeek(O);break;case"backwards":if(_fakemodel.position>O){this.jwInstreamSeek(O)}break}};this.jwGetPosition=function(){};this.jwGetDuration=function(){};this.jwGetWidth=G.jwGetWidth;this.jwGetHeight=G.jwGetHeight;this.jwGetFullscreen=G.jwGetFullscreen;this.jwSetFullscreen=G.jwSetFullscreen;this.jwGetVolume=function(){return I.volume};this.jwSetVolume=function(O){l.volume(O);G.jwSetVolume(O)};this.jwGetMute=function(){return I.mute};this.jwSetMute=function(O){l.mute(O);G.jwSetMute(O)};this.jwGetState=function(){return _fakemodel.state};this.jwGetPlaylist=function(){return[z]};this.jwGetPlaylistIndex=function(){return 0};this.jwGetStretching=function(){return I.config.stretching};this.jwAddEventListener=function(P,O){o.addEventListener(P,O)};this.jwRemoveEventListener=function(P,O){o.removeEventListener(P,O)};this.skin=G.skin;this.id=G.id+"_instream";w();return this}})(jwplayer.html5);(function(c){var n=c.utils,h=c.html5,m=n.css,j=undefined,k="free",f="pro",g="premium",o="ads",e="open",p="http://www.longtailvideo.com/jwpabout/?a=l&v=",a="visible",d="hidden",l=".jwlogo";var b=h.logo=function(x,y){var D=x,E=D.id+"_logo",t,r,u=b.defaults,C=false;function v(){B();s()}function B(){if(u.prefix){var F=c.version.split(/\W/).splice(0,2).join("/");if(u.prefix.indexOf(F)<0){u.prefix+=F+"/"}}try{if(n.isHTTPS()){u.prefix=u.prefix.replace("http://","https://ssl.")}}catch(H){}var G=z(w());u.link=p+c.version+"&m=h&e="+G;t=n.extend({},u,y);t.hide=(t.hide.toString()=="true")}function s(){r=document.createElement("img");r.className="jwlogo";r.id=E;if(!t.file){r.style.display="none";return}var F=(/(\w+)-(\w+)/).exec(t.position),G={},H=t.margin;if(F.length==3){G[F[1]]=H;G[F[2]]=H}else{G.top=G.right=H}m(q(),G);r.src=(t.prefix?t.prefix:"")+t.file;r.onclick=A}this.resize=function(G,F){};this.element=function(){return r};this.offset=function(F){m(q(),{"margin-bottom":F})};this.position=function(){return t.position};this.margin=function(){return parseInt(t.margin)};function A(F){if(n.exists(F)){F.stopPropagation()}if(C&&t.link){D.jwPause();D.jwSetFullscreen(false);window.open(t.link,t.linktarget)}return}function w(){if(c().config.key){var F=new n.key(c().config.key);return F.edition()}else{return e}}function z(F){if(F==f){return"p"}else{if(F==g){return"r"}else{if(F==o){return"a"}else{if(F==e){return"o"}else{return"f"}}}}}function q(F){return"#"+E+" "+(F?F:"")}this.hide=function(F){if(t.hide||F){C=false;r.style.visibility="hidden";r.style.opacity=0}};this.show=function(){C=true;r.style.visibility="visible";r.style.opacity=1};v();return this};b.defaults={prefix:"http://p.jwpcdn.com/",file:"logo.png",link:p+c.version+"&m=h&e=f",linktarget:"_top",margin:8,hide:false,position:"top-right"};m(l,{cursor:"pointer",position:"absolute","z-index":100,opacity:0});n.transitionStyle(l,"visibility .15s, opacity .15s")})(jwplayer);(function(c){var f=c.html5,k=c.utils,j=k.css,h="jwmenu",d="jwoption",g=undefined,a="#ffffff",b="#cccccc";f.menu=function(m,n,B,t){var x=B,z=m,y=n,o=t,q=new f.overlay(y+"_overlay",B),r=k.extend({fontcase:g,fontcolor:b,fontsize:11,fontweight:g,activecolor:a,overcolor:a},B.getComponentSettings("tooltip")),p,A=[];function w(){p=u(h);p.id=y;var G=s("menuTop"+m),E=s("menuOption"),D=s("menuOptionOver"),F=s("menuOptionActive");if(G){p.appendChild(G.image)}if(E){var C="#"+n+" ."+d;j(C,{"background-image":E.src,height:E.height,color:r.fontcolor,"padding-left":E.width,font:r.fontweight+" "+r.fontsize+"px Arial,Helvetica,sans-serif","line-height":E.height,"text-transform":(r.fontcase=="upper")?"uppercase":g});j(C+":hover",{"background-image":D.src?D.src:g,color:r.overcolor});j(C+".active",{"background-image":F.src?F.src:g,color:r.activecolor})}q.setContents(p)}this.element=function(){return q.element()};this.addOption=function(C,E){var D=u(d,p);D.id=y+"_option_"+E;D.innerHTML=C;D.addEventListener("click",v(A.length,E));A.push(D)};function v(C,D){return function(){l(C);if(o){o(D)}}}this.clearOptions=function(){while(A.length>0){p.removeChild(A.pop())}};var l=this.setActive=function(C){for(var D=0;Dstate";m[d.JWPLAYER_MEDIA_BUFFER]="bufferPercent->buffer";m[d.JWPLAYER_MEDIA_TIME]="position,duration";function k(t){var A=(m[t.type]?m[t.type].split(","):[]),x,z;if(A.length>0){for(x=0;x"),y=w[0],u=w[1]?w[1]:y;if(p[u]!=t[y]){p[u]=t[y];z=true}}if(z){p.sendEvent(t.type,t)}}else{p.sendEvent(t.type,t)}}p.getVideo=function(){return l};p.seekDrag=function(t){l.seekDrag(t)};p.setFullscreen=function(t){if(t!=p.fullscreen){p.fullscreen=t;p.sendEvent(d.JWPLAYER_FULLSCREEN,{fullscreen:t})}};p.setPlaylist=function(t){p.playlist=h(t);if(p.playlist.length==0){p.sendEvent(d.JWPLAYER_ERROR,{message:"Error loading playlist: No playable sources found"})}else{p.sendEvent(d.JWPLAYER_PLAYLIST_LOADED,{playlist:t});p.item=-1;p.setItem(0)}};function h(w){var u=[];for(var t=0;t0){u.push(v)}}return u}p.setItem=function(t){var u;if(t==p.playlist.length||t<-1){u=0}else{if(t==-1||t>p.playlist.length){u=p.playlist.length-1}else{u=t}}if(u!=p.item){p.item=u;p.sendEvent(d.JWPLAYER_PLAYLIST_ITEM,{index:p.item})}};p.setVolume=function(t){if(p.mute&&t>0){p.setMute(f)}t=Math.round(t);if(!p.mute){a.saveCookie("volume",t)}l.volume(t)};p.setMute=function(t){if(!a.exists(t)){t=!p.mute}a.saveCookie("mute",t);l.mute(t)};p.componentConfig=function(t){return g[t]};q()}})(jwplayer.html5);(function(k){var e=k.html5,r=k.utils,n=r.css,s=r.transitionStyle,c="relative",d="absolute",g="hidden",j="100%",q="opacity .15s, visibility .15s, left .01s linear",l=".jwoverlay",a="jwcontents",p="top",f="bottom",h="right",m="left",t="#ffffff",u=undefined,b=document,o={fontcase:u,fontcolor:t,fontsize:12,fontweight:u,activecolor:t,overcolor:t};e.overlay=function(H,K,E){var B=K,x=H,C,Q,I=0,J,N,M=E,v=r.extend({},o,B.getComponentSettings("tooltip")),z={},L=this;function D(){C=O(l.replace(".",""));C.id=x;J=y("arrow","jwarrow")[1];N=J.height;n(A("jwarrow"),{position:d,bottom:M?u:0,top:M?0:u,width:J.width,height:N,left:"50%"});P(p,m);P(f,m);P(p,h);P(f,h);P(m);P(h);P(p);P(f);y("background","jwback");n(A("jwback"),{left:z.left,right:z.right,top:z.top,bottom:z.bottom});Q=O(a,C);n(A(a)+" *",{color:v.fontcolor,font:v.fontweight+" "+(v.fontsize)+"px Arial,Helvetica,sans-serif","text-transform":(v.fontcase=="upper")?"uppercase":u});if(M){r.transform(A("jwarrow"),"rotate(180deg)")}n(A(),{padding:(z.top+1)+"px "+z.right+"px "+(z.bottom+1)+"px "+z.left+"px"});L.showing=false}function A(R){return"#"+x+(R?" ."+R:"")}function O(S,R){var T=b.createElement("div");if(S){T.className=S}if(R){R.appendChild(T)}return T}function y(R,T){var S=G(R),U=O(T,C);n(A(T.replace(" ",".")),{"background-image":S.src});return[U,S]}function P(X,W){if(!W){W=""}var T=y("cap"+X+W,"jwborder jw"+X+(W?W:"")),R=T[0],U=T[1],S={"background-image":U.src,width:(X==m||W==m||X==h||W==h)?U.width:u,height:(X==p||W==p||X==f||W==f)?U.height:u};S[X]=((X==f&&!M)||(X==p&&M))?N:0;if(W){S[W]=0}n(A(R.className.replace(/ /g,".")),S);var V={},Z={},Y={left:U.width,right:U.width,top:(M?N:0)+U.height,bottom:(M?0:N)+U.height};if(W){V[W]=Y[W];V[X]=0;Z[X]=Y[X];Z[W]=0;n(A("jw"+X),V);n(A("jw"+W),Z);z[X]=Y[X];z[W]=Y[W]}}L.element=function(){return C};var F;L.setContents=function(R){r.empty(Q);Q.appendChild(R);clearTimeout(F);F=setTimeout(w,0)};L.offsetX=function(R){I=R;clearTimeout(F);w()};function w(){if(C.clientWidth==0){return}n(A(),{"margin-left":Math.round(I-C.clientWidth/2)});n(A("jwarrow"),{"margin-left":Math.round((J.width/-2)-I)})}L.borderWidth=function(){return z.left};function G(R){var S=B.getSkinElement("tooltip",R);if(S){return S}else{return{width:0,height:0,src:"",image:u,ready:false}}}L.show=function(){L.showing=true;C.style.opacity=1;C.style.visibility="visible"};L.hide=function(){L.showing=false;C.style.opacity=0;C.style.visibility=g};D()};n(l,{position:d,visibility:g,opacity:0});n(l+" .jwcontents",{position:c,"z-index":1});n(l+" .jwborder",{position:d,"background-size":j+" "+j},true);n(l+" .jwback",{position:d,"background-size":j+" "+j});s(l,q)})(jwplayer);(function(b){var a=jwplayer.utils;b.player=function(d){var n=this,l,h,j,c;function m(){l=new b.model(d);n.id=l.id;h=new b.view(n,l);j=new b.controller(l,h);n._model=l;jwplayer.utils.css.block();e();var o=new b.setup(l,h,j);o.addEventListener(jwplayer.events.JWPLAYER_READY,f);o.addEventListener(jwplayer.events.JWPLAYER_ERROR,k);o.start()}function f(o){j.playerReady(o);a.css.unblock()}function k(o){a.log("There was a problem setting up the player: ",o);a.css.unblock()}function e(){n.jwPlay=j.play;n.jwPause=j.pause;n.jwStop=j.stop;n.jwSeek=j.seek;n.jwSetVolume=j.setVolume;n.jwSetMute=j.setMute;n.jwLoad=j.load;n.jwPlaylistNext=j.next;n.jwPlaylistPrev=j.prev;n.jwPlaylistItem=j.item;n.jwSetFullscreen=j.setFullscreen;n.jwResize=h.resize;n.jwSeekDrag=l.seekDrag;n.jwSetStretching=j.setStretching;n.jwGetQualityLevels=j.getQualityLevels;n.jwGetCurrentQuality=j.getCurrentQuality;n.jwSetCurrentQuality=j.setCurrentQuality;n.jwGetCaptionsList=j.getCaptionsList;n.jwGetCurrentCaptions=j.getCurrentCaptions;n.jwSetCurrentCaptions=j.setCurrentCaptions;n.jwSetControls=h.setControls;n.jwGetSafeRegion=h.getSafeRegion;n.jwGetPlaylistIndex=g("item");n.jwGetPosition=g("position");n.jwGetDuration=g("duration");n.jwGetBuffer=g("buffer");n.jwGetWidth=g("width");n.jwGetHeight=g("height");n.jwGetFullscreen=g("fullscreen");n.jwGetVolume=g("volume");n.jwGetMute=g("mute");n.jwGetState=g("state");n.jwGetStretching=g("stretching");n.jwGetPlaylist=g("playlist");n.jwGetControls=g("controls");n.jwDetachMedia=j.detachMedia;n.jwAttachMedia=j.attachMedia;n.jwLoadInstream=function(p,o){if(!c){c=new b.instream(n,l,h,j)}setTimeout(function(){c.load(p,o)},10)};n.jwInstreamDestroy=function(){if(c){c.jwInstreamDestroy()}};n.jwPlayerDestroy=function(){if(h){h.destroy()}};n.jwAddEventListener=j.addEventListener;n.jwRemoveEventListener=j.removeEventListener;n.jwDockAddButton=h.addButton;n.jwDockRemoveButton=h.removeButton}function g(o){return function(){return l[o]}}m()}})(jwplayer.html5);(function(g){var b="#FFFFFF",d="#CCCCCC",l="#333333",h="#999999",k="normal",f={size:180,backgroundcolor:l,fontcolor:h,overcolor:d,activecolor:d,titlecolor:d,titleovercolor:b,titleactivecolor:b,fontweight:k,titleweight:k,fontsize:11,titlesize:13},q=jwplayer.events,o=jwplayer.utils,m=o.css,p=".jwplaylist",n=document,a="absolute",c="relative",e="hidden",j="100%";g.playlistcomponent=function(I,T){var N=I,B=N.skin,s=o.extend({},f,N.skin.getComponentSettings("playlist"),T),O,C,r,w,u,A=-1,D,t,v=60,x={background:undefined,divider:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.element=function(){return O};this.redraw=function(){if(t){t.redraw()}};this.show=function(){_show(O)};this.hide=function(){_hide(O)};function y(){O=R("div","jwplaylist");O.id=N.id+"_jwplayer_playlistcomponent";C=R("div","jwlistcontainer");S(O,C);Q();if(x.item){v=x.item.height}G();N.jwAddEventListener(q.JWPLAYER_PLAYLIST_LOADED,J);N.jwAddEventListener(q.JWPLAYER_PLAYLIST_ITEM,L)}function z(U){return"#"+O.id+(U?" ."+U:"")}function G(){var X=0,W=0,U=0;o.clearCss(z());m(z(),{"background-color":s.backgroundcolor});m(z("jwlist"),{"background-image":x.background?" url("+x.background.src+")":""});m(z("jwlist *"),{color:s.fontcolor,font:s.fontweight+" "+s.fontsize+"px Arial, Helvetica, sans-serif"});if(x.itemImage){X=(v-x.itemImage.height)/2+"px ";W=x.itemImage.width;U=x.itemImage.height}else{W=v*4/3;U=v}if(x.divider){m(z("jwplaylistdivider"),{"background-image":"url("+x.divider.src+")","background-size":j+" "+x.divider.height+"px",width:j,height:x.divider.height})}m(z("jwplaylistimg"),{height:U,width:W,margin:X?(X+X+X+X):"0 5px 0 0"});m(z("jwlist li"),{"background-image":x.item?"url("+x.item.src+")":"",height:v,"background-size":j+" "+v+"px",cursor:"pointer"});var V={overflow:"hidden"};if(s.activecolor!==""){V.color=s.activecolor}if(x.itemActive){V["background-image"]="url("+x.itemActive.src+")"}m(z("jwlist li.active"),V);m(z("jwlist li.active .jwtitle"),{color:s.titleactivecolor});var Y={overflow:"hidden"};if(s.overcolor!==""){Y.color=s.overcolor}if(x.itemOver){Y["background-image"]="url("+x.itemOver.src+")"}m(z("jwlist li:hover"),Y);m(z("jwlist li:hover .jwtitle"),{color:s.titleovercolor});m(z("jwtextwrapper"),{height:v-5,position:c});m(z("jwtitle"),{height:15,overflow:"hidden",display:"inline-block",width:j,color:s.titlecolor,"margin-top":X?X:7,"line-height":13,"font-size":s.titlesize,"font-weight":s.titleweight});m(z("jwdescription"),{display:"block","font-size":s.fontsize,"line-height":19,"margin-top":5,overflow:"hidden",height:v,position:c})}function F(){var U=R("ul","jwlist");U.id=O.id+"_ul"+Math.round(Math.random()*10000000);return U}function H(X){var ac=r[X],ab=R("li","jwitem"),V;ab.id=u.id+"_item_"+X;if(X>0){V=R("div","jwplaylistdivider");S(ab,V)}var Y=R("div","jwplaylistimg jwfill");if(M()&&(ac.image||ac["playlist.image"]||x.itemImage)){var Z;if(ac["playlist.image"]){Z=ac["playlist.image"]}else{if(ac.image){Z=ac.image}else{if(x.itemImage){Z=x.itemImage.src}}}m("#"+ab.id+" .jwplaylistimg",{"background-image":Z?"url("+Z+")":null});S(ab,Y)}var U=R("div","jwtextwrapper");var aa=R("span","jwtitle");aa.innerHTML=(ac&&ac.title)?ac.title:"";S(U,aa);if(ac.description){var W=R("span","jwdescription");W.innerHTML=ac.description;S(U,W)}S(ab,U);return ab}function R(V,U){var W=n.createElement(V);if(U){W.className=U}return W}function S(U,V){U.appendChild(V)}function J(V){C.innerHTML="";r=K();if(!r){return}items=[];u=F();for(var W=0;W=0){n.getElementById(u.id+"_item_"+A).className="jwitem";A=U.index}n.getElementById(u.id+"_item_"+U.index).className="jwitem active";E()}function Q(){for(var U in x){x[U]=B.getSkinElement("playlist",U)}}y();return this};m(p,{position:a,width:j,height:j});o.dragStyle(p,"none");m(p+" .jwplaylistimg",{position:c,width:j,"float":"left",margin:"0 5px 0 0",background:"#000",overflow:e});m(p+" .jwlist",{position:a,width:j,"list-style":"none",margin:0,padding:0});m(p+" .jwlistcontainer",{position:a,overflow:e,width:j,height:j});m(p+" .jwlist li",{width:j});m(p+" .jwtextwrapper",{overflow:e});m(p+" .jwplaylistdivider",{position:a})})(jwplayer.html5);(function(b){var d=jwplayer,a=d.utils,c=d.events;b.playlistloader=function(){var g=new c.eventdispatcher();a.extend(this,g);this.load=function(k){a.ajax(k,h,f)};function h(k){try{var n=k.responseXML.firstChild;if(b.parsers.localName(n)=="xml"){n=n.nextSibling}if(b.parsers.localName(n)!="rss"){e("Not a valid RSS feed");return}var m=new d.playlist(b.parsers.rssparser.parse(n));m=j(m);if(m&&m.length&&m[0].sources&&m[0].sources.length&&m[0].sources[0].file){g.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:m})}else{e("No playable sources found")}}catch(l){e()}}function j(o){if(!o){return}var m=[],l,n,k;for(l=0;l1){ai=false}else{ai=true;n(W(c),{height:Math.max(C.clientHeight*aj,E.height+O.height)})}n(W(),{visibility:ai?"visible":"hidden"});if(Y){Y.style.width=ai?Y.parentElement.clientWidth-ab.width+"px":""}}var L=this.thumbPosition=function(aj){if(isNaN(aj)){aj=0}ag=Math.max(0,Math.min(1,aj));n(W(c),{top:S+(C.clientHeight-ac.clientHeight)*ag});if(X){X.style.top=(af.clientHeight-X.scrollHeight)*ag+"px"}};function B(aj){if(aj.button==0){Q=true}e.onselectstart=function(){return false};s.addEventListener("mousemove",Z,false);s.addEventListener("mouseup",z,false)}function Z(aj){if(Q||aj.type=="click"){var ao=r.bounds(C),al=ac.clientHeight/2,ak=ao.height-al,an=aj.pageY-ao.top,am=(an-al)/(ak-al);L(am)}}function x(aj){return function(ak){if(ak.button>0){return}L(ag+(aj*0.05));U=setTimeout(function(){ad=setInterval(function(){L(ag+(aj*0.05))},50)},500)}}function z(){Q=false;s.removeEventListener("mousemove",Z);s.removeEventListener("mouseup",z);e.onselectstart=v;clearTimeout(U);clearInterval(ad)}G();return this};function d(){var w=[],x;for(x=0;x0&&!w){setTimeout(H,500)}}function P(U){if(!U){return true}var T=U.toString().split(",");for(var S=0;SparseFloat(jwplayer.version)){v("Incompatible player version")}if(M.length===0){n(j);return}for(var P=0;P0){var S=m(G,"setting");for(var X=0;X0){var U=m(T,"group");for(var D=0;D=ad&&ad>3&&!a.isAndroid(2.3)){V()}}}function ab(af){return Number(af.toFixed(1))}function r(af){A(af);if(!t){return}if(!ac){ac=true;q()}}function E(af){if(ac&&S>0){setTimeout(function(){B(S)},200)}}function q(){if(!L){L=true;s(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function W(af){if(!t||H){return}if(w.paused){if(w.currentTime==w.duration&&w.duration>3){V()}else{f()}}else{x(b.PLAYING)}}function v(af){if(!t){return}x(b.BUFFERING)}function n(af){if(!t){return}a.log("Error playing media: %o",w.error);O.sendEvent(d.JWPLAYER_MEDIA_ERROR,{message:"Error loading media: File could not be played"});x(b.IDLE)}function l(ai){var af;if(a.typeOf(ai)=="array"&&ai.length>0){af=[];for(var ah=0;ah=1){clearInterval(o)}}function P(){if(w.buffered.length==0||w.duration==0){return 0}else{return w.buffered.end(w.buffered.length-1)/w.duration}}function m(){if(a.isAndroid(2.3)){V()}}function V(){if(e!=b.IDLE){F=-1;x(b.IDLE);s(d.JWPLAYER_MEDIA_BEFORECOMPLETE);s(d.JWPLAYER_MEDIA_COMPLETE)}}g.detachMedia=function(){t=false;return w};g.attachMedia=function(){t=true};g.getTag=function(){return w};g.audioMode=function(){if(!J){return false}var af=J[0].type;return(af=="aac"||af=="mp3"||af=="vorbis")};g.setCurrentQuality=function(ag){if(F==ag){return}ag=parseInt(ag);if(ag>=0){if(J&&J.length>ag){F=ag;s(d.JWPLAYER_MEDIA_LEVEL_CHANGED,{currentQuality:ag,levels:l(J)});var af=w.currentTime;u();g.seek(af)}}};g.getCurrentQuality=function(){return F};g.getQualityLevels=function(){return l(J)};Z(X)}})(jwplayer);(function(l){var p=jwplayer,x=p.utils,a=jwplayer.events,f=a.state,r=x.css,t=x.bounds,w=x.isMobile(),d=x.isIPad(),A=x.isIPod(),h=x.isAndroid(),g=document,o="jwplayer",b="."+o+".jwfullscreen",q="jwmain",z="jwinstream",y="jwvideo",c="jwcontrols",e="jwplaylistcontainer",k=true,s=false,v="opacity .5s ease",n="100%",j="absolute",u=" !important",m="hidden";l.view=function(M,H){var L=M,J=H,am,Y,W,at,D=0,aF=2000,F,aO,R,aE,aP,aA,ap,aw=x.extend({},J.componentConfig("logo")),an,aJ,T,ag=(J.mobilecontrols),aG=s,ah,P,au,aB,aC=s,ax=new a.eventdispatcher();x.extend(this,ax);function aL(){am=aI("div",o);am.id=L.id;ai(J.width,J.height);var aS=document.getElementById(L.id);aS.parentNode.replaceChild(am,aS)}this.getCurrentCaptions=function(){return an.getCurrentCaptions()};this.setCurrentCaptions=function(aS){an.setCurrentCaptions(aS)};this.getCaptionsList=function(){return an.getCaptionsList()};this.setup=function(aT){if(aG){return}L.skin=aT;Y=aI("span",q);aO=aI("span",y);F=J.getVideo().getTag();aO.appendChild(F);W=aI("span",c);R=aI("span",z);at=aI("span",e);C();Y.appendChild(aO);Y.appendChild(W);Y.appendChild(R);var aS=aI("div");aS.style.position="absolute";aS.style.width="100%";aS.style.height="100%";aS.appendChild(Y);aS.appendChild(at);am.appendChild(aS);g.addEventListener("webkitfullscreenchange",aK,s);F.addEventListener("webkitbeginfullscreen",aK,s);F.addEventListener("webkitendfullscreen",aK,s);g.addEventListener("mozfullscreenchange",aK,s);g.addEventListener("keydown",ay,s);L.jwAddEventListener(a.JWPLAYER_PLAYER_READY,aH);L.jwAddEventListener(a.JWPLAYER_PLAYER_STATE,O);L.jwAddEventListener(a.JWPLAYER_PLAYLIST_COMPLETE,aD);O({newstate:f.IDLE});W.addEventListener("mouseout",av,s);W.addEventListener("mousemove",aQ,s);if(x.isIE()){aO.addEventListener("mousemove",aQ,s);aO.addEventListener("click",aP.clickHandler)}N(aE);N(aA);N(ap)};function N(aS){if(aS){aS.element().addEventListener("mousemove",ak,s);aS.element().addEventListener("mouseout",aN,s)}}function aI(aT,aS){var aU=g.createElement(aT);if(aS){aU.className=aS}return aU}function aQ(){clearTimeout(D);if(L.jwGetState()==f.PLAYING||L.jwGetState()==f.PAUSED){az();if(!aC){D=setTimeout(av,aF)}}}function ak(){clearTimeout(D);aC=k}function aN(){aC=s}function av(){if(L.jwGetState()!=f.BUFFERING){Q();ac();aa()}clearTimeout(D);D=0}function ao(aS){ax.sendEvent(aS.type,aS)}function C(){var aU=J.width,aS=J.height,aV=J.componentConfig("controlbar"),aT=J.componentConfig("display");G(aS);an=new l.captions(L,J.captions);an.addEventListener(a.JWPLAYER_CAPTIONS_LIST,ao);an.addEventListener(a.JWPLAYER_CAPTIONS_CHANGED,ao);W.appendChild(an.element());aP=new l.display(L,aT);aP.addEventListener(a.JWPLAYER_DISPLAY_CLICK,ao);if(T){aP.hidePreview(k)}W.appendChild(aP.element());ap=new l.logo(L,aw);W.appendChild(ap.element());aA=new l.dock(L,J.componentConfig("dock"));W.appendChild(aA.element());if(L.edition){au=new l.rightclick(L,{abouttext:J.abouttext,aboutlink:J.aboutlink})}else{au=new l.rightclick(L,{})}if(J.playlistsize&&J.playlistposition&&J.playlistposition!="none"){aJ=new l.playlistcomponent(L,{});at.appendChild(aJ.element())}if(!w||ag){aE=new l.controlbar(L,aV);W.appendChild(aE.element());if(ag){az()}}setTimeout(function(){ai(J.width,J.height)},0)}var ad=this.fullscreen=function(aS){if(!x.exists(aS)){aS=!J.fullscreen}if(aS){if(!J.fullscreen){if(!d){aj(k)}if(am.requestFullScreen){am.requestFullScreen()}else{if(am.mozRequestFullScreen){am.mozRequestFullScreen()}else{if(am.webkitRequestFullScreen){am.webkitRequestFullScreen()}}}J.setFullscreen(k)}}else{if(!d){aj(s)}if(J.fullscreen){J.setFullscreen(s);if(g.cancelFullScreen){g.cancelFullScreen()}else{if(g.mozCancelFullScreen){g.mozCancelFullScreen()}else{if(g.webkitCancelFullScreen){g.webkitCancelFullScreen()}else{if(F.webkitExitFullScreen){F.webkitExitFullScreen()}}}}}if(d&&L.jwGetState()==f.PAUSED){setTimeout(E,500)}}af(aE);af(aP);af(aA);K();if(J.fullscreen){aB=setInterval(K,200)}else{clearInterval(aB)}setTimeout(function(){var aT=x.bounds(Y);J.width=aT.width;J.height=aT.height;ax.sendEvent(a.JWPLAYER_RESIZE)},0)};function af(aS){if(aS){aS.redraw()}}function ai(aU,aS){if(x.exists(aU)&&x.exists(aS)){J.width=aU;J.height=aS}am.style.width=isNaN(aU)?aU:aU+"px";am.style.height=isNaN(aS)?aS:aS+"px";if(aP){aP.redraw()}if(aE){aE.redraw()}if(ap){setTimeout(function(){ap.offset(aE&&ap.position().indexOf("bottom")>=0?aE.element().clientHeight+aE.margin():0);if(aA){aA.offset(ap.position()=="top-left"?ap.element().clientWidth+ap.margin():0)}},500)}var aW=J.playlistsize,aX=J.playlistposition;if(aJ&&aW&&(aX=="right"||aX=="bottom")){aJ.redraw();var aT={display:"block"},aV={};aT[aX]=0;aV[aX]=aW;if(aX=="right"){aT.width=aW}else{aT.height=aW}r(ar(e),aT);r(ar(q),aV)}G(aS);K();ax.sendEvent(a.JWPLAYER_RESIZE);return}function G(aS){T=((!w||ag)&&aS<=40&&aS.toString().indexOf("%")<0);if(aE){if(T){aE.audioMode(k);az();aP.hidePreview(k);U();Z(s)}else{aE.audioMode(s);aM(L.jwGetState())}}if(ap&&T){aa()}am.style.backgroundColor=T?"transparent":"#000"}function K(){if(F){x.stretch(J.stretching,F,aO.clientWidth,aO.clientHeight,F.videoWidth,F.videoHeight)}}this.resize=ai;this.resizeMedia=K;var al=this.completeSetup=function(){r(ar(),{opacity:1})};function ay(aS){if(J.fullscreen){switch(aS.keyCode){case 27:ad(s);break}}}function aj(aS){if(aS){am.className+=" jwfullscreen";(g.getElementsByTagName("body")[0]).style["overflow-y"]="hidden"}else{am.className=am.className.replace(/\s+jwfullscreen/,"");(g.getElementsByTagName("body")[0]).style["overflow-y"]=""}}function aR(){var aS=[g.mozFullScreenElement,g.webkitCurrentFullScreenElement,F.webkitDisplayingFullscreen];for(var aT=0;aTaT.right){return aT}if(aS.bottomaT.bottom){return aT}var aU=(aS.y>aS.height/2),aV={x:aT.x,y:aU?aT.y:aS.bottom,width:aT.width}}function Z(aS){aS=aS&&!T;r(ar(y),{visibility:aS?"visible":"hidden",opacity:aS?1:0})}function aD(){ah=k;ad(false);if(J.controls){I()}}function aH(aS){P=k}var ab;function O(aS){ah=s;clearTimeout(ab);ab=setTimeout(function(){aM(aS.newstate)},100)}function aM(aS){switch(aS){case f.PLAYING:if(!J.getVideo().audioMode()||w){Z(k);K();aP.hidePreview(k);if(w){if(!(d&&ag)){U()}}}else{Z(s);aP.hidePreview(T)}aQ();break;case f.IDLE:if(!h){Z(s)}av();if(!T){aP.hidePreview(s);E();if(!aw.hide){B()}}break;case f.BUFFERING:E();if(w){Z(k)}else{az()}break;case f.PAUSED:E();if(!w||ag){az()}break}}function ar(aS){return"#"+L.id+(aS?" ."+aS:"")}this.setupInstream=function(aS,aT){aq(ar(z),k);aq(ar(c),s);R.appendChild(aS);_instreamVideo=aT;O({newstate:f.PLAYING});_instreamMode=k};var ae=this.destroyInstream=function(){aq(ar(z),s);aq(ar(c),k);R.innerHTML="";_instreamVideo=null;_instreamMode=s;ai(J.width,J.height)};this.setupError=function(aS){aG=true;jwplayer.embed.errorScreen(am,aS);al()};function aq(aS,aT){r(aS,{display:aT?"block":"none"})}this.addButton=function(aU,aS,aT,aV){if(aA){aA.addButton(aU,aS,aT,aV)}};this.removeButton=function(aS){if(aA){aA.removeButton(aS)}};this.setControls=function(aT){var aU=J.controls,aS=aT?k:s;J.controls=aS;if(aS!=aU){if(aS){E()}else{S();U()}ax.sendEvent(a.JWPLAYER_CONTROLS,{controls:aS})}};this.getSafeRegion=function(){var aZ=J.controls,a0=x.bounds(Y),aU=a0.top,aX=x.bounds(aE?aE.element():null),aT=(aA.numButtons()>0),aW=x.bounds(aA.element()),aV=x.bounds(ap.element()),aY=(ap.position().indexOf("top")==0),aS={};aS.x=0;aS.y=Math.max(aT?(aW.top+aW.height-aU):0,aY?(aV.top+aV.height-aU):0);aS.width=a0.width;if(aX.height){aS.height=(aY?aX.top:aV.top)-aS.y-aU}else{aS.height=a0.height-aS.y}return{x:0,y:aZ?aS.y:0,width:aZ?aS.width:0,height:aZ?aS.height:0}};this.destroy=function(){g.removeEventListener("webkitfullscreenchange",aK,s);g.removeEventListener("mozfullscreenchange",aK,s);F.removeEventListener("webkitbeginfullscreen",aK,s);F.removeEventListener("webkitendfullscreen",aK,s);g.removeEventListener("keydown",ay,s);if(au){au.destroy()}};aL()};r("."+o,{position:"relative",opacity:0,"min-height":x.isMobile()?200:0,"-webkit-transition":v,"-moz-transition":v,"-o-transition":v});r("."+q,{position:j,left:0,right:0,top:0,bottom:0,"-webkit-transition":v,"-moz-transition":v,"-o-transition":v});r("."+y+" ,."+c,{position:j,height:n,width:n,"-webkit-transition":v,"-moz-transition":v,"-o-transition":v});r("."+y,{visibility:"hidden",overflow:"hidden",cursor:"pointer"});r("."+y+" video",{background:"transparent",width:n,height:n});r("."+e,{position:j,height:n,width:n,display:"none"});r("."+z,{position:j,top:0,left:0,bottom:0,right:0,display:"none"});r(b,{width:n,height:n,left:0,right:0,top:0,bottom:0,"z-index":1000,position:"fixed"},k);r(b+" ."+q,{left:0,right:0,top:0,bottom:0},k);r(b+" ."+e,{display:"none"},k);r("."+o+" .jwuniform",{"background-size":"contain"+u});r("."+o+" .jwfill",{"background-size":"cover"+u,"background-position":"center"});r("."+o+" .jwexactfit",{"background-size":n+" "+n+u})})(jwplayer.html5);(function(b){var d=jwplayer.utils.extend,c=b.logo,a;a=function(f,e){if(f.edition()=="free"){e=null}else{c.defaults.file="";c.defaults.prefix=""}d(this,new c(f,e))};a.defaults={prefix:"",file:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG0AAAATCAYAAACa0IPnAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NUVGQjQ0N0ZEOThDMTFFMUFDMUZCMzY5RkYyQkY5NDUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NUVGQjQ0ODBEOThDMTFFMUFDMUZCMzY5RkYyQkY5NDUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1RUZCNDQ3REQ5OEMxMUUxQUMxRkIzNjlGRjJCRjk0NSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1RUZCNDQ3RUQ5OEMxMUUxQUMxRkIzNjlGRjJCRjk0NSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pr5HQqEAAArQSURBVHja3JkJUNT3Fcf3AARBQVFR8IjGCw1aT9R6UKVe0TgYOxNHG5tqD+o48ajVia21mdaJ49FoCloNKho0FkbjQRwRvAUVFUO8gCDKIbccciyw7Pbztr+1G2Sp0yKj/c28+f/3d733e993/f6r1TTSwsLCtDwcIbPq0kM6qErTeHOCau2MtVLPWpv9rE2n1pps+FQ3ssfPoR5QNHRN8+o3bSNn/Z/awoULn707NDZBr9d7ms3m3/FqqKurO8rv4Vqt1l+n031B35kG04OZ68f4Td4/bzAWxNjk+vr6Sw4ODpENgNXRP54956pDuog87JPCMxtKgO5Y0K6t/dDJyWlQSUlJbbt27V4H0PpB05UBOkOHoMfNtXmjoBUUFHTu0qXLcl5rsrOzEzw8PMagrPcNBoOHs7NzIv1P1dS2gPJXFN0KcB86OjoKqAarhzF/GfPHsV8B+2j8/f2f8bh69aq2b9++E9n3l/K7pqYmi32c2OM9+Q2gyRiLyHD26dOnJvapq6iocOzYseMrj1hhYeEPkHOz9XdZWVmau7v7ywWttLRUD2hVAGIsKioq43dKp06dzCaTaSSK80bR4g2aqqqqka1bt7aGv3bQaJR+Vn5UVlb2xbt64kk1t2/fTtq/f79x7Nix/2bs4KARENhXk5ubmxwREfE5wDjDtzvzJnp5eQ3CEDYCZgB71kMayCzPV72Vl5c7Ir8BoxMv07i4uLyH3HF2Qn/zgEYoMgth7Zpu3brpk5OTLxOiCtzc3LwBozcCWEDDM2aj/Hr6Cl1dXTvhEXMA0QIaAI/FuroQ0tLbtGmTcvjwYVODECx8TAqM/MTExHCV09q0b9/+CYf+LXsNKS4u9mBvC1gC9OsAWqtWrSznkjNawlHbtu9ifDsA79JLA00p0srU7dSpUwljxoxJx8O8UKQ/yj5FvxFQZgNc7fHjx0MXLFjwMZ4xmjEpLkwoeBjC6/HUxGvXruVMnz79+4wVAMzX4GD1J06cKFdDJVlZWRUc0BHgawBdC1+tzLPOVy0AWgR1U+Facu1nUB30J2UAYVCGDdvxas1B6KTq+wCaAXlCD6DdkFW5A6CV0FdQMfRTqAL6RKKgXaWqs8lTNWfeQ6EJcr6XApowE+WgNGHumJ+fX4anpdI3Bqv/IYp0wxPeYsiT0HY7Ly8vwmg0fshYV0DsQ38W7wNlD7wv/vr16xU2yn4ONHJmN57vKnn8evTo8QHjjjk5OUmZmZkV/fv3t8yjz6T2WUTo3iryIVcpAHtLwUN/R/ivRb5x7DkW626NQSxXLH34/WcMadyDBw8u9+rVy52+cNa9TUQph0yMTWDPQEL6CsYiOdsQwvXPONuP6NNAPRivevz4cXjXrl3tgmY9lw1o8tuPtf9gjyAFfPN7GgewgAZjS/n66NGjC3369HmH0OVPUeFOPpuBp2lQ7FkKjDxqjRsUFj8mns9AETGenp5+1dXV+Sjj7vnz5032DiZ8ePrS9YUKuc7SBw/Jc5/ideUzZszQSR+kleeuXbsyeO66efNmJgCVwstr7dq1wciznFC94+LFi1/PmTMngEgxDz5/FE9EvoEUB2Jwj44ePZq4YsWK1YzNio+PPxIeHh4LMPWTJk0aPHfu3F/z/jFjkZzRRfHtgfHE79y5M4xQryNNFC9evNiuUq3nsgVNtUB0c5ozLuA9tdlBE8aS06w55MKFC3Hjx4/Pw4IHECJ9EP5tBNMlJCREEdoMa9asOenn5zcZgUZw6GKs31Uqzxs3btybNWuW3RAifPDktEOHDn3VoUMHN3KY4datW/koNxVLP8P+dYRYq+VawuSxY8cSV61a5TRv3rwJyOCPnOJ+bdjP6eHDhx327dv3JTwlJ7ZHljms2YM8k0VejODC0KFDs8TipbDp169fdWhoaFsA1sHTgPwSFXwYe4v3GuEH4GkHDhwIEWNQOitbtmyZpqnw2NDTbNoogLvK3iG8/0VV2+b/CjSsVsdhTIqpWaxaPA3m4mkaCoUcrDiNfl9Cwx845JtUlVmExmTWmqKiohKZX4YnilA+zDOjhGunT58u2rBhg13QxCI5wOODBw9+qu40NaIUuZ6xr1EldgtJFSmKP3fu3Bq6l0nOI/xm4hEFeJtWGZoeb8/hSnGYPBpMhbqANccZn838ciLG11OnTu3MXu6ETm337t3Fot4RJ5eCh/U6gDYQAnszbhS+ACyFVizylL6IUpvwNGvzgD6CfgOFSpiGctXZ6/4jaHfu3JGd+yHsaN4jBw4cWMYBMdLWLuSAUooLy4WYsXrC3A0UHIiXTVVAxhEaq0RA7iIZHPTGgAEDJsrXCxRZInctWdeUN8tavMDIvLymlCCEodRKzuR9JQb0ZOPGjX+LjIxMwlAMVKefIZe77MteZjx/H6C9TygTj1lNBdeTXHZl8+bNsVTEXsOHD68W3qz7Eg9KByA9Stb7+Pi44+FFAJSEsU2UOejCGBgYaJD3F2lWY2wCNOtXE7kmiQGuwdCToGgMRO7BUp2Xqy9FAqTo59mXFgcO34lccBJFdEPJk9PS0jaQi4JRpAOhKoswdNOqOKrA2JEjR/6Kd1fp43Anly5davHOkJCQQgC/wJiApgHA7+R+NnPmzKYqLK0CRNewUGlQQksu06FYM4pvTxg2c7hKwuP19evX38ODpkFdbEMuIfVbDho3atQo8aLljBs5zzXOV0RuNuDZ1ymmek6bNq0rhc4ecnMF8g8BtJUZGRm/J3JkYSSOqmrVWUPei4LWRHi014YosjQAFCMuQ+4HqnK1fuar1M2fP7+cA0ThUUVY1E9QznXy1gI8JTcpKSn6yZMn+dYQtXfv3m8AOROhTDyzr1y5Em8NXSTqOiq5JKxaPM+M532ze/fuR9bxhqRKYpOyyHp786zjzDdC+ujo6Jz09PSrXMq7E86PoxzJD4sB0bIXipbQrrl06VLVmTNn9tIvHqUlTGbHxMQcVrJWbNq0KQQA4/HSsUSL80FBQRfJb3vg5U0LZI6JtWYb/pqmZLQlSSkYmO5F5zdGrO8M9QOTadB8RXOhRQ6pqamV69at28ahKkeMGDEM6+tAnio8cuRIHMXBEWuSFMuhv2rr1q2HsMxcFHdv8ODBRbbWxyX8W8DfL6fGyk8yv8aeWbHeTD66hVfHYOXnevfubdcE8fAYhP0OA7qHIeSmpKRsoHpbSG71Jv9Ub9++PdLX1/cNPND3/v37xRRMIqt5yZIll/G4NK4Qg8i/9ykmErds2WLZkwIpgfD5EZFkVkBAwDDCpysFR0lsbGwCUeME6zV3795NwyDiyIPnAbF2ypQpL/a1WKs1SSh3+JermZrx3m7Jt1qbDm+5y8gFXhUC6XYugl5QF+Wy2Q0qH0Gwu9ojw3Y9Cn9uI6y8A483JdIynmlPUub1kks+lMO8Yn5LwTJQ5QQpVm5B7kq2ZOZYvn8CkjPhORXL9QwLC1sRHBy8o5G95XL+hiqC5JL+kPV5asxdXbClSMik/4UA2LZt20iuF7/AO11QcrN97ccGngPtpTa8qiW/JA0SEMgHQYS41XjJXfLVRGTIbwnmFERuygH0zfwXjXxtqndoKS225DdDrDEKsDrC0wOgSgipuwwGQ35L8YdXhaoAm62R375XdraUIlsMtIiIiNCeNDysND4+/g6X57/Dv1DzGjfbSlSr+f9sfSUlqW98+U193H0d2z8FGACF4VIWnpOTrQAAAABJRU5ErkJggg%3D%3D",};d(a.defaults,c.defaults);b.logo=a})(jwplayer.html5);(function(a){var b=a.model,c;c=function(e){var f=new jwplayer.utils.key(e.key),g=new b(e),d=g.componentConfig;g.edition=function(){return f.edition()};g.componentConfig=function(h){if(h=="logo"){return g.logo}else{return d(h)}};return g};a.model=c})(jwplayer.html5);(function(a){a.player.prototype.edition=function(){return this._model.edition()}})(jwplayer.html5);(function(e){var g=jwplayer.utils.extend,h=e.rightclick,k,f="free",c="pro",d="premium",j="ads",b="open",a="About JW Player ",l="http://www.longtailvideo.com/jwpabout/?a=r&v=";k=function(n,m){if(n.edition()=="free"){m.aboutlink=l+e.version+"&m=h&e=f";delete m.abouttext}else{if(!m.aboutlink){m.aboutlink=l+e.version+"&m=h&e="+p(n.edition())}if(m.abouttext){m.abouttext="About "+m.abouttext+" ..."}else{var o=n.edition();o=o.charAt(0).toUpperCase()+o.substr(1);m.abouttext=a+e.version+" ("+o+" edition)"}}function p(q){if(q==c){return"p"}else{if(q==d){return"r"}else{if(q==j){return"a"}else{return"f"}}}}g(this,new h(n,m))};e.rightclick=k})(jwplayer.html5);(function(b){var a=b.view,c=function(f,d){var g=new a(f,d),e=d.edition();if(e=="invalid"){g.setupError("Error setting up player: Invalid license key")}return g};b.view=c})(jwplayer.html5);
\ No newline at end of file
diff --git a/trunk/players/jwplayer6/jwplayer.js b/trunk/players/jwplayer6/jwplayer.js
new file mode 100644
index 000000000..c9bc3fd4a
--- /dev/null
+++ b/trunk/players/jwplayer6/jwplayer.js
@@ -0,0 +1 @@
+if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};jwplayer.version="6.1.2972";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(d){var j=document,g=window,b=navigator,h="undefined",f="string",c="object";var k=d.utils=function(){};k.exists=function(m){switch(typeof(m)){case f:return(m.length>0);break;case c:return(m!==null);case h:return false}return true};k.styleDimension=function(m){return m+(m.toString().indexOf("%")>0?"":"px")};k.getAbsolutePath=function(s,r){if(!k.exists(r)){r=j.location.href}if(!k.exists(s)){return undefined}if(a(s)){return s}var t=r.substring(0,r.indexOf("://")+3);var q=r.substring(t.length,r.indexOf("/",t.length+1));var n;if(s.indexOf("/")===0){n=s.split("/")}else{var o=r.split("?")[0];o=o.substring(t.length+q.length+1,o.lastIndexOf("/"));n=o.split("/").concat(s.split("/"))}var m=[];for(var p=0;p0&&(m<0||(m>o)))}k.extend=function(){var m=k.extend["arguments"];if(m.length>1){for(var o=1;o=0){return p.substr(0,p.indexOf(o))}}return""};k.deepReplaceKeyName=function(t,o,m){switch(d.utils.typeOf(t)){case"array":for(var q=0;q0){return i.ABSOLUTE}var m=n.indexOf("/");var p=k.extension(n);if(o<0&&m<0&&(!p||!isNaN(p))){return i.CDN}return i.RELATIVE};k.getPluginName=function(m){return m.replace(/^(.*\/)?([^-]*)-?.*\.(swf|js)$/,"$2")};k.getPluginVersion=function(m){return m.replace(/[^-]*-?([^\.]*).*$/,"$1")};k.isYouTube=function(m){return(m.indexOf("youtube.com")>-1||m.indexOf("youtu.be")>-1)};k.isRtmp=function(m,n){return(m.indexOf("rtmp")==0||n=="rtmp")};k.foreach=function(o,n){for(var m in o){if(o.hasOwnProperty(m)){n(m)}}};k.isHTTPS=function(){return(g.location.href.indexOf("https")==0)}})(jwplayer);(function(o){var d="video/",i="audio/",g="image",j="mp4",c="webm",n="ogg",b="aac",k="mp3",l="vorbis",m={mp4:d+j,vorbis:i+n,ogg:d+n,webm:d+c,aac:i+j,mp3:i+"mpeg",hls:"application/vnd.apple.mpegurl"},h={mp4:m[j],f4v:m[j],m4v:m[j],mov:m[j],m4a:m[b],f4a:m[b],aac:m[b],mp3:m[k],ogv:m[n],ogg:m[l],oga:m[l],webm:m[c],m3u8:m.hls},d="video",f={flv:d,f4v:d,mov:d,m4a:d,m4v:d,mp4:d,aac:d,f4a:d,mp3:"sound",smil:"rtmp",m3u8:"hls"};var a=o.extensionmap={};for(var e in h){a[e]={html5:h[e]}}for(e in f){if(!a[e]){a[e]={}}a[e].flash=f[e]}a.types=m;a.mimeType=function(q){for(var p in m){if(m[p]==q){return p}}};a.extType=function(p){return a.mimeType(h[p])}})(jwplayer.utils);(function(b){var a=b.loaderstatus={NEW:0,LOADING:1,ERROR:2,COMPLETE:3},c=document;b.scriptloader=function(e){var f=a.NEW,h=jwplayer.events,d=new h.eventdispatcher();b.extend(this,d);this.load=function(){var k=b.scriptloader.loaders[e];if(k&&(k.getStatus()==a.NEW||k.getStatus()==a.LOADING)){k.addEventListener(h.ERROR,g);k.addEventListener(h.COMPLETE,i);return}b.scriptloader.loaders[e]=this;if(f==a.NEW){f=a.LOADING;var j=c.createElement("script");if(j.addEventListener){j.onload=i;j.onerror=g}else{if(j.readyState){j.onreadystatechange=function(){if(j.readyState=="loaded"||j.readyState=="complete"){i()}}}}c.getElementsByTagName("head")[0].appendChild(j);j.src=e}};function g(j){f=a.ERROR;d.sendEvent(h.ERROR)}function i(j){f=a.COMPLETE;d.sendEvent(h.COMPLETE)}this.getStatus=function(){return f}};b.scriptloader.loaders={}})(jwplayer.utils);(function(a){a.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.pad=function(c,d,b){if(!b){b="0"}while(c.length-1){return b.substr(b.lastIndexOf(".")+1,b.length).toLowerCase()}};a.stringToColor=function(b){b=b.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(b.length==3){b=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2)}return parseInt(b,16)}})(jwplayer.utils);(function(a){var c="invalid",b="36QXq4W@GSBV^teR";a.key=function(h){var g,i,e;function f(j){if(!a.exists(j)){j=""}try{j=d(j);var l=j.split("/");g=l[0];if(!g){g="free"}else{if(a.key.valid.indexOf(g)<0){g=c}}i=l[1];if(l[2]&&parseInt(l[2])>0){e=new Date();e.setTime(String(l[2]))}}catch(k){g=c}}function d(j){return a.tea.decrypt(j,b)}this.edition=function(){if(e&&e.getTime()<(new Date()).getTime()){return c}return g};this.token=function(){return i};f(h)};a.key.valid=["free","pro"]})(jwplayer.utils);(function(b){var c=b.tea={};c.encrypt=function(h,w){if(h.length==0){return("")}var x=c.strToLongs(a.encode(h));if(x.length<=1){x[1]=0}var l=c.strToLongs(a.encode(w).slice(0,16)),i=x.length,r=x[i-1],s=x[0],u=2654435769,t,o,f=Math.floor(6+52/i),m=0;while(f-->0){m+=u;o=m>>>2&3;for(var g=0;g>>5^s<<2)+(s>>>3^r<<4)^(m^s)+(l[g&3^o]^r);r=x[g]+=t}}var j=c.longsToStr(x);return d.encode(j)};c.decrypt=function(j,w){if(j.length==0){return("")}var x=c.strToLongs(d.decode(j)),l=c.strToLongs(a.encode(w).slice(0,16)),i=x.length,r=x[i-1],s=x[0],u=2654435769,t,o,f=Math.floor(6+52/i),m=f*u;while(m!=0){o=m>>>2&3;for(var h=i-1;h>=0;h--){r=x[h>0?h-1:i-1];t=(r>>>5^s<<2)+(s>>>3^r<<4)^(m^s)+(l[h&3^o]^r);s=x[h]-=t}m-=u}var g=c.longsToStr(x);g=g.replace(/\0+$/,"");return a.decode(g)};c.strToLongs=function(g){var e=new Array(Math.ceil(g.length/4));for(var f=0;f>>8&255,f[g]>>>16&255,f[g]>>>24&255)}return e.join("")};var d={};d.code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";d.encode=function(q,s){s=(typeof s=="undefined")?false:s;var j,g,f,u,r,n,m,k,l=[],i="",p,t,o;var h=d.code;t=s?a.encode(q):q;p=t.length%3;if(p>0){while(p++<3){i+="=";t+="\0"}}for(p=0;p>18&63;n=u>>12&63;m=u>>6&63;k=u&63;l[p/3]=h.charAt(r)+h.charAt(n)+h.charAt(m)+h.charAt(k)}o=l.join("");o=o.slice(0,o.length-i.length)+i;return o};d.decode=function(p,g){g=(typeof g=="undefined")?false:g;var i,f,e,q,m,k,j,s,l=[],r,o;var h=d.code;o=g?a.decode(p):p;for(var n=0;n>>16&255;f=s>>>8&255;e=s&255;l[n/4]=String.fromCharCode(i,f,e);if(j==64){l[n/4]=String.fromCharCode(i,f)}if(k==64){l[n/4]=String.fromCharCode(i)}}r=l.join("");return g?a.decode(r):r};var a={};a.encode=function(e){var f=e.replace(/[\u0080-\u07ff]/g,function(h){var g=h.charCodeAt(0);return String.fromCharCode(192|g>>6,128|g&63)});f=f.replace(/[\u0800-\uffff]/g,function(h){var g=h.charCodeAt(0);return String.fromCharCode(224|g>>12,128|g>>6&63,128|g&63)});return f};a.decode=function(f){var e=f.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(h){var g=((h.charCodeAt(0)&15)<<12)|((h.charCodeAt(1)&63)<<6)|(h.charCodeAt(2)&63);return String.fromCharCode(g)});e=e.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(h){var g=(h.charCodeAt(0)&31)<<6|h.charCodeAt(1)&63;return String.fromCharCode(g)});return e}})(jwplayer.utils);(function(a){a.events={COMPLETE:"COMPLETE",ERROR:"ERROR",API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_MEDIA_LEVELS:"jwplayerMediaLevels",JWPLAYER_MEDIA_LEVEL_CHANGED:"jwplayerMediaLevelChanged",JWPLAYER_CAPTIONS_CHANGED:"jwplayerCaptionsChanged",JWPLAYER_CAPTIONS_LIST:"jwplayerCaptionsList",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",state:{BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"},JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_PLAYLIST_COMPLETE:"jwplayerPlaylistComplete",JWPLAYER_DISPLAY_CLICK:"jwplayerViewClick",JWPLAYER_CONTROLS:"jwplayerViewControls",JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed"}})(jwplayer);(function(a){var b=jwplayer.utils;a.eventdispatcher=function(h,c){var e=h,g=c,f,d;this.resetEventListeners=function(){f={};d=[]};this.resetEventListeners();this.addEventListener=function(i,l,k){try{if(!b.exists(f[i])){f[i]=[]}if(b.typeOf(l)=="string"){l=(new Function("return "+l))()}f[i].push({listener:l,count:k})}catch(j){b.log("error",j)}return false};this.removeEventListener=function(j,l){if(!f[j]){return}try{for(var i=0;i0){f[k][j].count=f[k][j].count-1}}}}}var i;for(i=0;i0){d[i].count=d[i].count-1}}}}}}})(jwplayer.events);(function(a){var c={},b={};a.plugins=function(){};a.plugins.loadPlugins=function(e,d){b[e]=new a.plugins.pluginloader(new a.plugins.model(c),d);return b[e]};a.plugins.registerPlugin=function(h,g,f,e){var d=a.utils.getPluginName(h);if(!c[d]){c[d]=new a.plugins.plugin(h)}c[d].registerPlugin(h,g,f,e)}})(jwplayer);(function(a){a.plugins.model=function(b){this.addPlugin=function(c){var d=a.utils.getPluginName(c);if(!b[d]){b[d]=new a.plugins.plugin(c)}return b[d]};this.getPlugins=function(){return b}}})(jwplayer);(function(b){var a=jwplayer.utils,c=jwplayer.events,d="undefined";b.pluginmodes={FLASH:0,JAVASCRIPT:1,HYBRID:2};b.plugin=function(e){var l=a.loaderstatus.NEW,m,k,f,n;var g=new c.eventdispatcher();a.extend(this,g);function h(){switch(a.getPluginPathType(e)){case a.pluginPathType.ABSOLUTE:return e;case a.pluginPathType.RELATIVE:return a.getAbsolutePath(e,window.location.href)}}function j(o){n=setTimeout(function(){l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE)},1000)}function i(o){l=a.loaderstatus.ERROR;g.sendEvent(c.ERROR)}this.load=function(){if(l==a.loaderstatus.NEW){if(e.lastIndexOf(".swf")>0){m=e;l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE);return}else{if(a.getPluginPathType(e)==a.pluginPathType.CDN){l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE);return}}l=a.loaderstatus.LOADING;var o=new a.scriptloader(h());o.addEventListener(c.COMPLETE,j);o.addEventListener(c.ERROR,i);o.load()}};this.registerPlugin=function(r,q,p,o){if(n){clearTimeout(n);n=undefined}f=q;if(p&&o){m=o;k=p}else{if(typeof p=="string"){m=p}else{if(typeof p=="function"){k=p}else{if(!p&&!o){m=r}}}}l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE)};this.getStatus=function(){return l};this.getPluginName=function(){return a.getPluginName(e)};this.getFlashPath=function(){if(m){switch(a.getPluginPathType(m)){case a.pluginPathType.ABSOLUTE:return m;case a.pluginPathType.RELATIVE:if(e.lastIndexOf(".swf")>0){return a.getAbsolutePath(m,window.location.href)}return a.getAbsolutePath(m,h())}}return null};this.getJS=function(){return k};this.getTarget=function(){return f};this.getPluginmode=function(){if(typeof m!=d&&typeof k!=d){return b.pluginmodes.HYBRID}else{if(typeof m!=d){return b.pluginmodes.FLASH}else{if(typeof k!=d){return b.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(p,o,q){return new k(p,o,q)};this.getURL=function(){return e}}})(jwplayer.plugins);(function(b){var a=b.utils,c=b.events;b.plugins.pluginloader=function(i,h){var o=a.loaderstatus.NEW,g=false,d=false,k=false,l,m=h,e=new c.eventdispatcher();a.extend(this,e);function f(){if(k){e.sendEvent(c.ERROR,{message:l})}else{if(!d){d=true;o=a.loaderstatus.COMPLETE;e.sendEvent(c.COMPLETE)}}}function n(){if(!m){f()}if(!d&&!k){var r=0,q=i.getPlugins();for(var s in m){var t=a.getPluginName(s),w=q[t],v=w.getJS(),u=w.getTarget(),p=w.getStatus();if(p==a.loaderstatus.LOADING||p==a.loaderstatus.NEW){r++}else{if(v&&(!u||parseFloat(u)>parseFloat(b.version))){k=true;l="Incompatible player version";f()}}}if(r==0){f()}}}this.setupPlugins=function(x,s,A){var r={length:0,plugins:{}},v={length:0,plugins:{}},u=i.getPlugins();for(var w in s.plugins){var y=a.getPluginName(w),z=u[y],B=z.getFlashPath(),C=z.getJS(),p=z.getURL();if(B){r.plugins[B]=a.extend({},s.plugins[w]);r.plugins[B].pluginmode=z.getPluginmode();r.length++}try{if(C&&s.plugins&&s.plugins[p]){var q=document.createElement("div");q.id=x.id+"_"+y;q.style.position="absolute";q.style.top=0;q.style.zIndex=v.length+10;v.plugins[y]=z.getNewInstance(x,a.extend({},s.plugins[p]),q);v.length++;x.onReady(A(v.plugins[y],q,true));x.onResize(A(v.plugins[y],q))}}catch(t){console.log("ERROR: Failed to load "+y+".")}}x.plugins=v.plugins;return r};this.load=function(){if(a.exists(h)&&a.typeOf(h)!="object"){n();return}o=a.loaderstatus.LOADING;g=true;for(var q in h){if(a.exists(q)){var r=i.addPlugin(q);r.addEventListener(c.COMPLETE,n);r.addEventListener(c.ERROR,j)}}var p=i.getPlugins();for(q in p){p[q].load()}g=false;n()};var j=this.pluginFailed=function(p){if(!k){k=true;l="File not found";f()}};this.getStatus=function(){return o}}})(jwplayer);(function(a){a.playlist=function(c){var d=[];if(a.utils.typeOf(c)=="array"){for(var b=0;b0){e.type=a.extensionmap.mimeType(e.type)}return e}})(jwplayer.playlist);(function(b){var a=b.utils,c=b.events,d=document;var e=b.embed=function(u){var q=new e.config(u.config),j,l,h,k=q.width,m=q.height,o="Error loading player: ",i=b.plugins.loadPlugins(u.id,q.plugins);if(q.fallbackDiv){h=q.fallbackDiv;delete q.fallbackDiv}q.id=u.id;l=d.getElementById(u.id);j=d.createElement("div");j.id=l.id;j.style.width=k.toString().indexOf("%")>0?k:(k+"px");j.style.height=m.toString().indexOf("%")>0?m:(m+"px");l.parentNode.replaceChild(j,l);function n(x,w){for(var v in w){if(typeof x[v]=="function"){(x[v]).call(x,w[v])}}}function f(){if(a.typeOf(q.playlist)=="array"&&q.playlist.length<2){if(q.playlist.length==0||!q.playlist[0].sources||q.playlist[0].sources.length==0){s();return}}if(i.getStatus()==a.loaderstatus.COMPLETE){for(var x=0;x");v.innerHTML="";v.appendChild(z)}b.embed.errorScreen=t;i.addEventListener(c.COMPLETE,f);i.addEventListener(c.ERROR,p);i.load();return u}})(jwplayer);(function(d){var a=d.utils,h=d.embed,b=d.playlist.item,f=undefined;var c=h.config=function(j){var l={fallback:true,height:270,primary:"html5",width:480,base:j.base?j.base:a.getScriptPath("jwplayer.js")},k=a.extend(l,j),i={html5:{type:"html5",src:k.base+"jwplayer.html5.js"},flash:{type:"flash",src:k.base+"jwplayer.flash.swf"}};k.modes=(k.primary=="flash")?[i.flash,i.html5]:[i.html5,i.flash];if(k.listbar){k.playlistsize=k.listbar.size;k.playlistposition=k.listbar.position}e(k);return k};c.addConfig=function(i,j){e(j);return a.extend(i,j)};function e(l){if(!l.playlist){var n={};for(var k in b.defaults){g(l,n,k)}if(!n.sources){if(l.levels){n.sources=l.levels;delete l.levels}else{var j={};g(l,j,"file");g(l,j,"type");n.sources=j.file?[j]:[]}}l.playlist=[n]}else{for(var m=0;m0){b.extend(v,g(t.plugins))}else{delete v.plugins}if(typeof v["dock.position"]!="undefined"){if(v["dock.position"].toString().toLowerCase()=="false"){v.dock=v["dock.position"];delete v["dock.position"]}}var D="#000000",y,u=v.wmode?v.wmode:(v.height&&v.height<=40?"transparent":"opaque"),w=["height","width","modes","events","primary","base","fallback","volume"];for(var z=0;z';A+='';A+='';A+='';A+='';A+='';A+='';A+="";l.outerHTML=A;y=document.getElementById(l.id)}else{var x=document.createElement("object");x.setAttribute("type","application/x-shockwave-flash");x.setAttribute("data",m.src);x.setAttribute("width","100%");x.setAttribute("height","100%");x.setAttribute("bgcolor",D);x.setAttribute("id",l.id);x.setAttribute("name",l.id);x.setAttribute("tabindex",0);q(x,"allowfullscreen","true");q(x,"allowscriptaccess","always");q(x,"seamlesstabbing","true");q(x,"wmode",u);l.parentNode.replaceChild(x,l);y=x}n.container=y;n.setPlayer(y,"flash")};this.supportsConfig=function(){if(i){if(p){if(b.typeOf(p.playlist)=="string"){return true}try{var t=p.playlist[0],r=t.sources;if(typeof r=="undefined"){return true}else{for(var s=0;s0){w.apply(this,p.shift())}};x.getItemMeta=function(){return s};x.getCurrentItem=function(){return w("jwGetPlaylistIndex")};function u(H,J,I){var F=[];if(!J){J=0}if(!I){I=H.length-1}for(var G=J;G<=I;G++){F.push(H[G])}return F}return x};f.selectPlayer=function(i){var h;if(!a.exists(i)){i=0}if(i.nodeType){h=i}else{if(typeof i=="string"){h=g.getElementById(i)}}if(h){var j=f.playerById(h.id);if(j){return j}else{return f.addPlayer(new f(h))}}else{if(typeof i=="number"){return c[i]}}return null};f.playerById=function(i){for(var h=0;h=0){var n=k.id,h=g.getElementById(n+(k.renderingMode=="flash"?"_wrapper":""));if(a.clearCss){a.clearCss("#"+n)}if(h){if(k.renderingMode=="html5"){k.destroyPlayer()}var l=g.createElement("div");l.id=n;h.parentNode.replaceChild(l,h)}c.splice(i,1)}return null};d.playerReady=function(i){var h=d.api.playerById(i.id);if(h){h.playerReady(i)}else{d.api.selectPlayer(i.id).playerReady(i)}}})(jwplayer);(function(b){var c=b.events,a=c.state;b.api.instream=function(e,k,o,r){var j=e,d=k,i=o,l=r,g={},q={};function h(){j.callInternal("jwLoadInstream",o,r)}function n(s,t){d.jwInstreamAddEventListener(t,'function(dat) { jwplayer("'+j.id+'").dispatchInstreamEvent("'+t+'", dat); }')}function f(s,t){if(!g[s]){g[s]=[];n(d,s)}g[s].push(t);return this}function p(s,t){if(!q[s]){q[s]=[];f(c.JWPLAYER_PLAYER_STATE,m(s))}q[s].push(t);return this}function m(s){return function(u){var t=u.newstate,w=u.oldstate;if(t==s){var v=q[t];if(v){for(var x=0;x
+
+ OSMFPlayer
+
+
+
+
+
+
+
+
+
diff --git a/trunk/players/osmf/swfobject.js b/trunk/players/osmf/swfobject.js
new file mode 100644
index 000000000..8eafe9dd8
--- /dev/null
+++ b/trunk/players/osmf/swfobject.js
@@ -0,0 +1,4 @@
+/* SWFObject v2.2
+ is released under the MIT License
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab
+
+ RtmpPlayer
+
+
+
+
+
diff --git a/trunk/players/rtmp/rtmp.player.js b/trunk/players/rtmp/rtmp.player.js
new file mode 100644
index 000000000..df73851f7
--- /dev/null
+++ b/trunk/players/rtmp/rtmp.player.js
@@ -0,0 +1,909 @@
+// china cache RTMP player:
+// run() to run player.
+// server: the RTMP server, e.g. 192.168.1.5
+// port: the RTMP port, default is 1935.
+// adminPort: the admin port, default is 1111.
+// user: the admin login user name, default is admin.
+// password: the admin login user password, default is null.
+// app: the application of fms to play. e.g vod
+// stream: the stream of fms to play. e.g mp4:sample1_1500kbps.f4v
+// islive: if true, live mode.
+// autostart:Boolean a property which specify auto play.
+// loop:Boolean a property which specify auto loop.
+//
+// generate the release js version using GC:
+// java -jar google_closure_compiler/compiler.jar --js chinacache.src.js --js_output_file chinacache.js
+function RtmpPlayer(div_container, swf_url, width, height){
+ this.swf_url = swf_url;
+ this.div_container = div_container;
+ this.width = width;
+ this.height = height;
+
+ this.flashvars = {};
+ this.flashvars.width = width;
+ this.flashvars.height = height;
+
+ this.params = {};
+ this.params.quality = "high";
+ this.params.bgcolor = "#EEEEEE";
+ this.params.allowscriptaccess = "always";
+ this.params.allowfullscreen = "true";
+ this.params.wmode = "Window";
+
+ this.attributes = {};
+ var html_element_id = "RtmpPlayer";
+ this.attributes.id = html_element_id;
+ this.attributes.name = html_element_id;
+ this.attributes.align = "middle";
+
+ this.autostart = false;
+ this.appLevel = 1;
+ this.loop = false;
+ this.port = 1935;
+ this.adminPort = 1111;
+ this.server = null;
+ this.app = null;
+ this.stream = null;
+ this.islive = false;
+ this.cansave = true;
+ this.user = "admin";
+ this.password = null;
+}
+
+RtmpPlayer.prototype.setRtmpUrl = function(url) {
+ var s = this.trim(url.replace("rtmp://", ""), "/");
+
+ if(s.indexOf(":") < 0 || s.indexOf(":") > s.indexOf("/")){
+ this.server = s.substr(0, s.indexOf("/"));
+ s = this.trim(s.substr(this.server.length), "/");
+ }
+ else{
+ this.server = s.substr(0, s.indexOf(":"));
+ s = this.trim(s.substr(this.server.length), ":");
+
+ this.port = s.substr(0, s.indexOf("/"));
+ s = this.trim(s.substr(this.port.length), "/");
+ }
+
+ this.app = s.substr(0, s.indexOf("/"));
+ s = this.trim(s.substr(this.app.length), "/");
+
+ this.stream = s;
+}
+
+RtmpPlayer.prototype.trim = function(s, str) {
+ var r = s;
+
+ while(r.indexOf(str) == 0){
+ r = r.substr(str.length);
+ }
+ while(r.lastIndexOf(str) == r.length - str.length){
+ r = r.substr(0, r.length - str.length);
+ }
+
+ return r;
+}
+
+RtmpPlayer.prototype.ck = function(v, pro) {
+ if(v == null || v == undefined){
+ alert(pro + "不能为空!");
+ return true;
+ }
+ return false;
+}
+
+RtmpPlayer.prototype.run = function() {
+ // const values
+ swfVersionStr = "11.1";
+ xiSwfUrlStr = "AdobeFlashPlayerInstall.swf";
+
+ // check
+ if(this.ck(this.autostart, "autostart(是否自动播放)") || this.ck(this.port, "port(FMS服务器端口)")
+ || this.ck(this.adminPort, "adminPort(FMS服务器管理端口)") || this.ck(this.server, "server(FMS服务器地址)")
+ || this.ck(this.app, "app(FMS application)") || this.ck(this.stream, "stream(流名称)")
+ || this.ck(this.user, "user(FMS登录用户名)") || this.ck(this.password, "password(FMS登录用户密码)")){
+ return;
+ }
+
+ this.flashvars.autostart = this.autostart;
+ this.flashvars.appLevel = this.appLevel;
+ this.flashvars.loop = this.loop;
+ this.flashvars.port = this.port;
+ this.flashvars.adminPort = this.adminPort;
+ this.flashvars.server = this.server;
+ this.flashvars.app = this.app;
+ this.flashvars.stream = this.stream;
+ this.flashvars.islive = this.islive;
+ this.flashvars.cansave = this.cansave;
+ this.flashvars.user = this.user;
+ this.flashvars.password = this.password;
+
+ var chnvideoPlayerHost = this;
+ swfobject.embedSWF(
+ this.swf_url, this.div_container,
+ this.width, this.height,
+ swfVersionStr, xiSwfUrlStr,
+ this.flashvars, this.params, this.attributes,
+ function(callbackObj){
+ chnvideoPlayerHost.callbackObj = callbackObj;
+ }
+ );
+}
+
+/*! SWFObject v2.2
+ is released under the MIT License
+*/
+
+var swfobject = function() {
+
+ var UNDEF = "undefined",
+ OBJECT = "object",
+ SHOCKWAVE_FLASH = "Shockwave Flash",
+ SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+ FLASH_MIME_TYPE = "application/x-shockwave-flash",
+ EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+ ON_READY_STATE_CHANGE = "onreadystatechange",
+
+ win = window,
+ doc = document,
+ nav = navigator,
+
+ plugin = false,
+ domLoadFnArr = [main],
+ regObjArr = [],
+ objIdArr = [],
+ listenersArr = [],
+ storedAltContent,
+ storedAltContentId,
+ storedCallbackFn,
+ storedCallbackObj,
+ isDomLoaded = false,
+ isExpressInstallActive = false,
+ dynamicStylesheet,
+ dynamicStylesheetMedia,
+ autoHideShow = true,
+
+ /* Centralized function for browser feature detection
+ - User agent string detection is only used when no good alternative is possible
+ - Is executed directly for optimal performance
+ */
+ ua = function() {
+ var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+ u = nav.userAgent.toLowerCase(),
+ p = nav.platform.toLowerCase(),
+ windows = p ? /win/.test(p) : /win/.test(u),
+ mac = p ? /mac/.test(p) : /mac/.test(u),
+ webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+ ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+ playerVersion = [0,0,0],
+ d = null;
+ if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+ d = nav.plugins[SHOCKWAVE_FLASH].description;
+ if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+ plugin = true;
+ ie = false; // cascaded feature detection for Internet Explorer
+ d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+ playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+ playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+ playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+ }
+ }
+ else if (typeof win.ActiveXObject != UNDEF) {
+ try {
+ var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+ if (a) { // a will return null when ActiveX is disabled
+ d = a.GetVariable("$version");
+ if (d) {
+ ie = true; // cascaded feature detection for Internet Explorer
+ d = d.split(" ")[1].split(",");
+ playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+ }
+ }
+ }
+ catch(e) {}
+ }
+ return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+ }(),
+
+ /* Cross-browser onDomLoad
+ - Will fire an event as soon as the DOM of a web page is loaded
+ - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+ - Regular onload serves as fallback
+ */
+ onDomLoad = function() {
+ if (!ua.w3) { return; }
+ if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
+ callDomLoadFunctions();
+ }
+ if (!isDomLoaded) {
+ if (typeof doc.addEventListener != UNDEF) {
+ doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+ }
+ if (ua.ie && ua.win) {
+ doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+ if (doc.readyState == "complete") {
+ doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+ callDomLoadFunctions();
+ }
+ });
+ if (win == top) { // if not inside an iframe
+ (function(){
+ if (isDomLoaded) { return; }
+ try {
+ doc.documentElement.doScroll("left");
+ }
+ catch(e) {
+ setTimeout(arguments.callee, 0);
+ return;
+ }
+ callDomLoadFunctions();
+ })();
+ }
+ }
+ if (ua.wk) {
+ (function(){
+ if (isDomLoaded) { return; }
+ if (!/loaded|complete/.test(doc.readyState)) {
+ setTimeout(arguments.callee, 0);
+ return;
+ }
+ callDomLoadFunctions();
+ })();
+ }
+ addLoadEvent(callDomLoadFunctions);
+ }
+ }();
+
+ function callDomLoadFunctions() {
+ if (isDomLoaded) { return; }
+ try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+ var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+ t.parentNode.removeChild(t);
+ }
+ catch (e) { return; }
+ isDomLoaded = true;
+ var dl = domLoadFnArr.length;
+ for (var i = 0; i < dl; i++) {
+ domLoadFnArr[i]();
+ }
+ }
+
+ function addDomLoadEvent(fn) {
+ if (isDomLoaded) {
+ fn();
+ }
+ else {
+ domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+ }
+ }
+
+ /* Cross-browser onload
+ - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+ - Will fire an event as soon as a web page including all of its assets are loaded
+ */
+ function addLoadEvent(fn) {
+ if (typeof win.addEventListener != UNDEF) {
+ win.addEventListener("load", fn, false);
+ }
+ else if (typeof doc.addEventListener != UNDEF) {
+ doc.addEventListener("load", fn, false);
+ }
+ else if (typeof win.attachEvent != UNDEF) {
+ addListener(win, "onload", fn);
+ }
+ else if (typeof win.onload == "function") {
+ var fnOld = win.onload;
+ win.onload = function() {
+ fnOld();
+ fn();
+ };
+ }
+ else {
+ win.onload = fn;
+ }
+ }
+
+ /* Main function
+ - Will preferably execute onDomLoad, otherwise onload (as a fallback)
+ */
+ function main() {
+ if (plugin) {
+ testPlayerVersion();
+ }
+ else {
+ matchVersions();
+ }
+ }
+
+ /* Detect the Flash Player version for non-Internet Explorer browsers
+ - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+ a. Both release and build numbers can be detected
+ b. Avoid wrong descriptions by corrupt installers provided by Adobe
+ c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+ - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+ */
+ function testPlayerVersion() {
+ var b = doc.getElementsByTagName("body")[0];
+ var o = createElement(OBJECT);
+ o.setAttribute("type", FLASH_MIME_TYPE);
+ var t = b.appendChild(o);
+ if (t) {
+ var counter = 0;
+ (function(){
+ if (typeof t.GetVariable != UNDEF) {
+ var d = t.GetVariable("$version");
+ if (d) {
+ d = d.split(" ")[1].split(",");
+ ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+ }
+ }
+ else if (counter < 10) {
+ counter++;
+ setTimeout(arguments.callee, 10);
+ return;
+ }
+ b.removeChild(o);
+ t = null;
+ matchVersions();
+ })();
+ }
+ else {
+ matchVersions();
+ }
+ }
+
+ /* Perform Flash Player and SWF version matching; static publishing only
+ */
+ function matchVersions() {
+ var rl = regObjArr.length;
+ if (rl > 0) {
+ for (var i = 0; i < rl; i++) { // for each registered object element
+ var id = regObjArr[i].id;
+ var cb = regObjArr[i].callbackFn;
+ var cbObj = {success:false, id:id};
+ if (ua.pv[0] > 0) {
+ var obj = getElementById(id);
+ if (obj) {
+ if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+ setVisibility(id, true);
+ if (cb) {
+ cbObj.success = true;
+ cbObj.ref = getObjectById(id);
+ cb(cbObj);
+ }
+ }
+ else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+ var att = {};
+ att.data = regObjArr[i].expressInstall;
+ att.width = obj.getAttribute("width") || "0";
+ att.height = obj.getAttribute("height") || "0";
+ if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+ if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+ // parse HTML object param element's name-value pairs
+ var par = {};
+ var p = obj.getElementsByTagName("param");
+ var pl = p.length;
+ for (var j = 0; j < pl; j++) {
+ if (p[j].getAttribute("name").toLowerCase() != "movie") {
+ par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+ }
+ }
+ showExpressInstall(att, par, id, cb);
+ }
+ else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+ displayAltContent(obj);
+ if (cb) { cb(cbObj); }
+ }
+ }
+ }
+ else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+ setVisibility(id, true);
+ if (cb) {
+ var o = getObjectById(id); // test whether there is an HTML object element or not
+ if (o && typeof o.SetVariable != UNDEF) {
+ cbObj.success = true;
+ cbObj.ref = o;
+ }
+ cb(cbObj);
+ }
+ }
+ }
+ }
+ }
+
+ function getObjectById(objectIdStr) {
+ var r = null;
+ var o = getElementById(objectIdStr);
+ if (o && o.nodeName == "OBJECT") {
+ if (typeof o.SetVariable != UNDEF) {
+ r = o;
+ }
+ else {
+ var n = o.getElementsByTagName(OBJECT)[0];
+ if (n) {
+ r = n;
+ }
+ }
+ }
+ return r;
+ }
+
+ /* Requirements for Adobe Express Install
+ - only one instance can be active at a time
+ - fp 6.0.65 or higher
+ - Win/Mac OS only
+ - no Webkit engines older than version 312
+ */
+ function canExpressInstall() {
+ return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+ }
+
+ /* Show the Adobe Express Install dialog
+ - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+ */
+ function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+ isExpressInstallActive = true;
+ storedCallbackFn = callbackFn || null;
+ storedCallbackObj = {success:false, id:replaceElemIdStr};
+ var obj = getElementById(replaceElemIdStr);
+ if (obj) {
+ if (obj.nodeName == "OBJECT") { // static publishing
+ storedAltContent = abstractAltContent(obj);
+ storedAltContentId = null;
+ }
+ else { // dynamic publishing
+ storedAltContent = obj;
+ storedAltContentId = replaceElemIdStr;
+ }
+ att.id = EXPRESS_INSTALL_ID;
+ if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+ if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+ doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+ var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+ fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+ if (typeof par.flashvars != UNDEF) {
+ par.flashvars += "&" + fv;
+ }
+ else {
+ par.flashvars = fv;
+ }
+ // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+ // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+ if (ua.ie && ua.win && obj.readyState != 4) {
+ var newObj = createElement("div");
+ replaceElemIdStr += "SWFObjectNew";
+ newObj.setAttribute("id", replaceElemIdStr);
+ obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+ obj.style.display = "none";
+ (function(){
+ if (obj.readyState == 4) {
+ obj.parentNode.removeChild(obj);
+ }
+ else {
+ setTimeout(arguments.callee, 10);
+ }
+ })();
+ }
+ createSWF(att, par, replaceElemIdStr);
+ }
+ }
+
+ /* Functions to abstract and display alternative content
+ */
+ function displayAltContent(obj) {
+ if (ua.ie && ua.win && obj.readyState != 4) {
+ // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+ // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+ var el = createElement("div");
+ obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+ el.parentNode.replaceChild(abstractAltContent(obj), el);
+ obj.style.display = "none";
+ (function(){
+ if (obj.readyState == 4) {
+ obj.parentNode.removeChild(obj);
+ }
+ else {
+ setTimeout(arguments.callee, 10);
+ }
+ })();
+ }
+ else {
+ obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+ }
+ }
+
+ function abstractAltContent(obj) {
+ var ac = createElement("div");
+ if (ua.win && ua.ie) {
+ ac.innerHTML = obj.innerHTML;
+ }
+ else {
+ var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+ if (nestedObj) {
+ var c = nestedObj.childNodes;
+ if (c) {
+ var cl = c.length;
+ for (var i = 0; i < cl; i++) {
+ if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+ ac.appendChild(c[i].cloneNode(true));
+ }
+ }
+ }
+ }
+ }
+ return ac;
+ }
+
+ /* Cross-browser dynamic SWF creation
+ */
+ function createSWF(attObj, parObj, id) {
+ var r, el = getElementById(id);
+ if (ua.wk && ua.wk < 312) { return r; }
+ if (el) {
+ if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+ attObj.id = id;
+ }
+ if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+ var att = "";
+ for (var i in attObj) {
+ if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+ if (i.toLowerCase() == "data") {
+ parObj.movie = attObj[i];
+ }
+ else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+ att += ' class="' + attObj[i] + '"';
+ }
+ else if (i.toLowerCase() != "classid") {
+ att += ' ' + i + '="' + attObj[i] + '"';
+ }
+ }
+ }
+ var par = "";
+ for (var j in parObj) {
+ if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+ par += '';
+ }
+ }
+ el.outerHTML = '';
+ objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+ r = getElementById(attObj.id);
+ }
+ else { // well-behaving browsers
+ var o = createElement(OBJECT);
+ o.setAttribute("type", FLASH_MIME_TYPE);
+ for (var m in attObj) {
+ if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+ if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+ o.setAttribute("class", attObj[m]);
+ }
+ else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+ o.setAttribute(m, attObj[m]);
+ }
+ }
+ }
+ for (var n in parObj) {
+ if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+ createObjParam(o, n, parObj[n]);
+ }
+ }
+ el.parentNode.replaceChild(o, el);
+ r = o;
+ }
+ }
+ return r;
+ }
+
+ function createObjParam(el, pName, pValue) {
+ var p = createElement("param");
+ p.setAttribute("name", pName);
+ p.setAttribute("value", pValue);
+ el.appendChild(p);
+ }
+
+ /* Cross-browser SWF removal
+ - Especially needed to safely and completely remove a SWF in Internet Explorer
+ */
+ function removeSWF(id) {
+ var obj = getElementById(id);
+ if (obj && obj.nodeName == "OBJECT") {
+ if (ua.ie && ua.win) {
+ obj.style.display = "none";
+ (function(){
+ if (obj.readyState == 4) {
+ removeObjectInIE(id);
+ }
+ else {
+ setTimeout(arguments.callee, 10);
+ }
+ })();
+ }
+ else {
+ obj.parentNode.removeChild(obj);
+ }
+ }
+ }
+
+ function removeObjectInIE(id) {
+ var obj = getElementById(id);
+ if (obj) {
+ for (var i in obj) {
+ if (typeof obj[i] == "function") {
+ obj[i] = null;
+ }
+ }
+ obj.parentNode.removeChild(obj);
+ }
+ }
+
+ /* Functions to optimize JavaScript compression
+ */
+ function getElementById(id) {
+ var el = null;
+ try {
+ el = doc.getElementById(id);
+ }
+ catch (e) {}
+ return el;
+ }
+
+ function createElement(el) {
+ return doc.createElement(el);
+ }
+
+ /* Updated attachEvent function for Internet Explorer
+ - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+ */
+ function addListener(target, eventType, fn) {
+ target.attachEvent(eventType, fn);
+ listenersArr[listenersArr.length] = [target, eventType, fn];
+ }
+
+ /* Flash Player and SWF content version matching
+ */
+ function hasPlayerVersion(rv) {
+ var pv = ua.pv, v = rv.split(".");
+ v[0] = parseInt(v[0], 10);
+ v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+ v[2] = parseInt(v[2], 10) || 0;
+ return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+ }
+
+ /* Cross-browser dynamic CSS creation
+ - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+ */
+ function createCSS(sel, decl, media, newStyle) {
+ if (ua.ie && ua.mac) { return; }
+ var h = doc.getElementsByTagName("head")[0];
+ if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+ var m = (media && typeof media == "string") ? media : "screen";
+ if (newStyle) {
+ dynamicStylesheet = null;
+ dynamicStylesheetMedia = null;
+ }
+ if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
+ // create dynamic stylesheet + get a global reference to it
+ var s = createElement("style");
+ s.setAttribute("type", "text/css");
+ s.setAttribute("media", m);
+ dynamicStylesheet = h.appendChild(s);
+ if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+ dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+ }
+ dynamicStylesheetMedia = m;
+ }
+ // add style rule
+ if (ua.ie && ua.win) {
+ if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+ dynamicStylesheet.addRule(sel, decl);
+ }
+ }
+ else {
+ if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+ dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+ }
+ }
+ }
+
+ function setVisibility(id, isVisible) {
+ if (!autoHideShow) { return; }
+ var v = isVisible ? "visible" : "hidden";
+ if (isDomLoaded && getElementById(id)) {
+ getElementById(id).style.visibility = v;
+ }
+ else {
+ createCSS("#" + id, "visibility:" + v);
+ }
+ }
+
+ /* Filter to avoid XSS attacks
+ */
+ function urlEncodeIfNecessary(s) {
+ var regex = /[\\\"<>\.;]/;
+ var hasBadChars = regex.exec(s) != null;
+ return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+ }
+
+ /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+ */
+ var cleanup = function() {
+ if (ua.ie && ua.win) {
+ window.attachEvent("onunload", function() {
+ // remove listeners to avoid memory leaks
+ var ll = listenersArr.length;
+ for (var i = 0; i < ll; i++) {
+ listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+ }
+ // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+ var il = objIdArr.length;
+ for (var j = 0; j < il; j++) {
+ removeSWF(objIdArr[j]);
+ }
+ // cleanup library's main closures to avoid memory leaks
+ for (var k in ua) {
+ ua[k] = null;
+ }
+ ua = null;
+ for (var l in swfobject) {
+ swfobject[l] = null;
+ }
+ swfobject = null;
+ });
+ }
+ }();
+
+ return {
+ /* Public API
+ - Reference: http://code.google.com/p/swfobject/wiki/documentation
+ */
+ registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+ if (ua.w3 && objectIdStr && swfVersionStr) {
+ var regObj = {};
+ regObj.id = objectIdStr;
+ regObj.swfVersion = swfVersionStr;
+ regObj.expressInstall = xiSwfUrlStr;
+ regObj.callbackFn = callbackFn;
+ regObjArr[regObjArr.length] = regObj;
+ setVisibility(objectIdStr, false);
+ }
+ else if (callbackFn) {
+ callbackFn({success:false, id:objectIdStr});
+ }
+ },
+
+ getObjectById: function(objectIdStr) {
+ if (ua.w3) {
+ return getObjectById(objectIdStr);
+ }
+ },
+
+ embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+ var callbackObj = {success:false, id:replaceElemIdStr};
+ if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+ setVisibility(replaceElemIdStr, false);
+ addDomLoadEvent(function() {
+ widthStr += ""; // auto-convert to string
+ heightStr += "";
+ var att = {};
+ if (attObj && typeof attObj === OBJECT) {
+ for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+ att[i] = attObj[i];
+ }
+ }
+ att.data = swfUrlStr;
+ att.width = widthStr;
+ att.height = heightStr;
+ var par = {};
+ if (parObj && typeof parObj === OBJECT) {
+ for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+ par[j] = parObj[j];
+ }
+ }
+ if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+ for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+ if (typeof par.flashvars != UNDEF) {
+ par.flashvars += "&" + k + "=" + flashvarsObj[k];
+ }
+ else {
+ par.flashvars = k + "=" + flashvarsObj[k];
+ }
+ }
+ }
+ if (hasPlayerVersion(swfVersionStr)) { // create SWF
+ var obj = createSWF(att, par, replaceElemIdStr);
+ if (att.id == replaceElemIdStr) {
+ setVisibility(replaceElemIdStr, true);
+ }
+ callbackObj.success = true;
+ callbackObj.ref = obj;
+ }
+ else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+ att.data = xiSwfUrlStr;
+ showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+ return;
+ }
+ else { // show alternative content
+ setVisibility(replaceElemIdStr, true);
+ }
+ if (callbackFn) { callbackFn(callbackObj); }
+ });
+ }
+ else if (callbackFn) { callbackFn(callbackObj); }
+ },
+
+ switchOffAutoHideShow: function() {
+ autoHideShow = false;
+ },
+
+ ua: ua,
+
+ getFlashPlayerVersion: function() {
+ return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+ },
+
+ hasFlashPlayerVersion: hasPlayerVersion,
+
+ createSWF: function(attObj, parObj, replaceElemIdStr) {
+ if (ua.w3) {
+ return createSWF(attObj, parObj, replaceElemIdStr);
+ }
+ else {
+ return undefined;
+ }
+ },
+
+ showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+ if (ua.w3 && canExpressInstall()) {
+ showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+ }
+ },
+
+ removeSWF: function(objElemIdStr) {
+ if (ua.w3) {
+ removeSWF(objElemIdStr);
+ }
+ },
+
+ createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+ if (ua.w3) {
+ createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+ }
+ },
+
+ addDomLoadEvent: addDomLoadEvent,
+
+ addLoadEvent: addLoadEvent,
+
+ getQueryParamValue: function(param) {
+ var q = doc.location.search || doc.location.hash;
+ if (q) {
+ if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+ if (param == null) {
+ return urlEncodeIfNecessary(q);
+ }
+ var pairs = q.split("&");
+ for (var i = 0; i < pairs.length; i++) {
+ if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+ return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+ }
+ }
+ }
+ return "";
+ },
+
+ // For internal usage only
+ expressInstallCallback: function() {
+ if (isExpressInstallActive) {
+ var obj = getElementById(EXPRESS_INSTALL_ID);
+ if (obj && storedAltContent) {
+ obj.parentNode.replaceChild(storedAltContent, obj);
+ if (storedAltContentId) {
+ setVisibility(storedAltContentId, true);
+ if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+ }
+ if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+ }
+ isExpressInstallActive = false;
+ }
+ }
+ };
+}();