jQuery(function($){var projekktors=[];document.createElement("video").canPlayType&&function(){return;var t;var e}();function Iterator(t){this.length=t.length,this.each=function(e){$.each(t,e)},this.size=function(){return t.length}}$.fn.prop||($.fn.prop=function(t,e){return $(this).attr(t,e)}),projekktor=$p=function(){var arg=arguments[0],instances=[],plugins=[];if(!arguments.length)return projekktors[0]||null;if("number"==typeof arg)return projekktors[arg];if("string"==typeof arg){if("*"==arg)return new Iterator(projekktors);for(var i=0;projekktors.length>i;i++){try{if(projekktors[i].getId()==arg.id){instances.push(projekktors[i]);continue}}catch(e){}try{for(var j=0;$(arg).length>j;j++)projekktors[i].env.playerDom.get(0)!=$(arg).get(j)||instances.push(projekktors[i])}catch(e){}try{if(projekktors[i].getParent()==arg){instances.push(projekktors[i]);continue}}catch(e){}try{if(projekktors[i].getId()==arg){instances.push(projekktors[i]);continue}}catch(e){}}if(instances.length>0)return 1==instances.length?instances[0]:new Iterator(instances)}if(0===instances.length){var cfg=arguments[1]||{},callback=arguments[2]||{},count=0,playerA;if("string"==typeof arg)return $.each($(arg),function(){playerA=new PPlayer($(this),cfg,callback),projekktors.push(playerA),count++}),count>1?new Iterator(projekktors):playerA;if(arg)return projekktors.push(new PPlayer(arg,cfg,callback)),new Iterator(projekktors)}return null;function PPlayer(srcNode,cfg,onReady){return this.config=new projekktorConfig("1.3.07"),this.env={muted:!1,playerDom:null,mediaContainer:null,agent:"standard",mouseIsOver:!1,loading:!1,className:"",onReady:onReady},this.media=[],this._plugins=[],this._pluginCache={},this._queue=[],this._cuePoints={},this.listeners=[],this.playerModel={},this._isReady=!1,this._maxElapsed=0,this._currentItem=null,this._playlistServer="",this._id="",this._reelUpdate=function(obj){var ref=this,itemIdx=null,data=obj||[{}],files=data.playlist||data;this.env.loading=!0,this.media=[];try{for(var props in data.config)typeof data.config[props].indexOf("objectfunction")>-1||(this.config[props]=eval(data.config[props]));null!=data.config&&($p.utils.log("Updated config var: "+props+" to "+this.config[props]),this._promote("configModified"),delete data.config)}catch(e){}$.each(files,function(){itemIdx=ref._addItem(ref._prepareMedia({file:this,config:this.config||{},errorCode:this.errorCode||0})),$.each(this.cuepoints||[],function(){this.item=itemIdx,ref.setCuePoint(this)})}),null===itemIdx&&this._addItem(this._prepareMedia({file:"",config:{},errorCode:97})),this.env.loading=!1,this._promote("scheduled",this.getItemCount()),this._syncPlugins(function(){ref.setActiveItem(0)})},this._addItem=function(t,e,i){var s=0;return 1===this.media.length&&"NA"==this.media[0].mediaModel&&(this._detachplayerModel(),this.media=[]),void 0===e||0>e||e>this.media.length-1?(this.media.push(t),s=this.media.length-1):(this.media.splice(e,i===!0?1:0,t),s=e),this.env.loading===!1&&this._promote("scheduleModified",this.getItemCount()),s},this._removeItem=function(t){var e=0;return 1===this.media.length?"NA"==this.media[0].mediaModel?0:(this.media[0]=this._prepareMedia({file:""}),0):(void 0===t||0>t||t>this.media.length-1?(this.media.pop(),e=this.media.length):(this.media.splice(t,1),e=t),this.env.loading===!1&&this._promote("scheduleModified",this.getItemCount()),e)},this._canPlay=function(t,e,i){var s=this,n=[],a=[],r=i||"http",o="object"==typeof e?e:[e],l=t?t.replace(/x-/,""):void 0,h=s._testMediaSupport();if($.each(o,function(t,e){$.each($.extend(h[r],h["*"]||[])||[],function(t,i){return null!=e&&t!=e?!0:(n=$.merge(n,this),!0)})}),0===n.length)return!1;switch(typeof l){case"undefined":return n.length>0;case"string":if("*"==l)return n;a.push(l);break;case"array":a=l}for(var u in a)if($p.mmap.hasOwnProperty(u)){if("string"!=typeof a[u])break;if($.inArray(a[u],n)>-1)return!0}return!1},this._prepareMedia=function(t){var e=this,i=[],s=[],n=[],a={},r={},o=[],l={},h=[],u=0;for(var c in $p.mmap)$p.mmap.hasOwnProperty(c)&&(platforms="object"==typeof $p.mmap[c].platform?$p.mmap[c].platform:[$p.mmap[c].platform],$.each(platforms,function(i,s){var n=0,o="http";for(var l in t.file)if(t.file.hasOwnProperty(l)){if("config"===l)continue;if(o=t.file[l].streamType||e.getConfig("streamType")||"http",e._canPlay($p.mmap[c].type,s,o)&&n++,0===n)continue;if($p.mmap[c].level=$.inArray(s,e.config._platforms),$p.mmap[c].level=0>$p.mmap[c].level?100:$p.mmap[c].level,h.push("."+$p.mmap[c].ext),a[$p.mmap[c].ext]||(a[$p.mmap[c].ext]=[]),a[$p.mmap[c].ext].push($p.mmap[c]),null===$p.mmap[c].streamType||"*"==$p.mmap[c].streamType||$.inArray(o,$p.mmap[c].streamType)>-1){r[$p.mmap[c].type]||(r[$p.mmap[c].type]=[]),n=-1;for(var u=0,d=r[$p.mmap[c].type].length;d>u;u++)if(r[$p.mmap[c].type][u].model==$p.mmap[c].model){n=u;break}-1===n&&r[$p.mmap[c].type].push($p.mmap[c])}}else;return!0}));h="^.*.("+h.join("|")+")$","string"==typeof t.file&&(t.file=[{src:t.file}],"string"==typeof t.type&&(t.file=[{src:t.file,type:t.type}])),($.isEmptyObject(t)||t.file===!1||null===t.file)&&(t.file=[{src:null}]);for(var d in t.file)if(t.file.hasOwnProperty(d)){if("config"==d)continue;if("string"==typeof t.file[d]&&(t.file[d]={src:t.file[d]}),null==t.file[d].src)continue;if(null!=t.file[d].type&&""!==t.file[d].type)try{var p=t.file[d].type.split(" ").join("").split(/[\;]codecs=.([a-zA-Z0-9\,]*)[\'|\"]/i);null!=p[1]&&(t.file[d].codec=p[1]),t.file[d].type=p[0].replace(/x-/,""),t.file[d].originalType=p[0]}catch(m){}else t.file[d].type=this._getTypeFromFileExtension(t.file[d].src);r[t.file[d].type]&&r[t.file[d].type].length>0&&(r[t.file[d].type].sort(function(t,e){return t.level-e.level}),o.push(r[t.file[d].type][0]))}0===o.length?o=r["none/none"]:(o.sort(function(t,e){return t.level-e.level}),u=o[0].level,o=$.grep(o,function(t){return t.level==u})),i=[],$.each(o||[],function(){i.push(this.type)});var f=o&&o.length>0?o[0]:{type:"none/none",model:"NA",errorCode:11};i=$p.utils.unique(i);for(d in t.file)if(t.file.hasOwnProperty(d)){if(null==t.file[d].type)continue;if(0>$.inArray(t.file[d].type.replace(/x-/,""),i)&&"none/none"!=f.type)continue;($.isEmptyObject(t.config)||null==t.config.streamType||-1==t.config.streamType.indexOf("rtmp"))&&(t.file[d].src=$p.utils.toAbsoluteURL(t.file[d].src)),null==t.file[d].quality&&(t.file[d].quality="default"),n.push(t.file[d].quality),s.push(t.file[d])}0===s.length&&s.push({src:null,quality:"default"});var g=[];return $.each(this.getConfig("playbackQualities"),function(){g.push(this.key||"default")}),l={ID:t.config.id||$p.utils.randomId(8),cat:t.config.cat||"clip",file:s,platform:f.platform,platforms:platforms,qualities:$p.utils.intersect($p.utils.unique(g),$p.utils.unique(n)),mediaModel:f.model||"NA",errorCode:f.errorCode||t.errorCode||7,config:t.config||{}}},this._modelUpdateListener=function(t,e){var i=this;if(this.playerModel.init)switch("time"!=t&&"progress"!=t&&$p.utils.log("Update: '"+t,this.playerModel.getSrc(),this.playerModel.getModelName(),e),t){case"state":this._promote("state",e);var s=$.map(this.getDC().attr("class").split(" "),function(t){return-1===t.indexOf(i.getConfig("ns")+"state")?t:""});switch(s.push(this.getConfig("ns")+"state"+e.toLowerCase()),this.getDC().attr("class",s.join(" ")),e){case"AWAKENING":var n=this.playerModel;this._syncPlugins(function(){n.getState("AWAKENING")&&n.displayItem(!0)});break;case"ERROR":this._addGUIListeners();break;case"STOPPED":this._promote("stopped",{});break;case"PAUSED":this.getConfig("disablePause")===!0&&this.playerModel.applyCommand("play",0);break;case"COMPLETED":this._currentItem+1>=this.media.length&&!this.getConfig("loop")&&(this._promote("done",{}),this.getConfig("leaveFullscreen")&&this.reset()),this.setActiveItem("next")}break;case"modelReady":this._maxElapsed=0,this._promote("item",i._currentItem);break;case"displayReady":this._promote("displayReady",!0),n=this.playerModel,this._syncPlugins(function(){i._promote("ready"),i._addGUIListeners(),n.getState("IDLE")||n.start()});break;case"availableQualitiesChange":this.media[this._currentItem].qualities=e,this._promote("availableQualitiesChange",e);break;case"qualityChange":this.setConfig({playbackQuality:e}),this._promote("qualityChange",e);break;case"volume":this.setConfig({volume:e}),this._promote("volume",e),0>=e?(this.env.muted=!0,this._promote("mute",e)):this.env.muted===!0&&(this.env.muted=!1,this._promote("unmute",e));break;case"playlist":this.setFile(e.file,e.type);break;case"config":this.setConfig(e);break;case"time":if(e>this._maxElapsed){var a=Math.round(100*e/this.getDuration()),r=!1;25>a&&(a=25),a>25&&50>a&&(r="firstquartile",a=50),a>50&&75>a&&(r="midpoint",a=75),a>75&&100>a&&(r="thirdquartile",a=100),r!==!1&&this._promote(r,e),this._maxElapsed=this.getDuration()*a/100}this._promote(t,e);break;case"fullscreen":e===!0?(this.getDC().addClass("fullscreen"),this._enterFullViewport()):(this.getDC().removeClass("fullscreen"),this._exitFullViewport()),this._promote(t,e);break;case"error":this._promote(t,e),this.getConfig("skipTestcard")&&this.getItemCount()>1?this.setActiveItem("next"):(this.playerModel.applyCommand("error",e),this._addGUIListeners());break;case"streamTypeChange":"dvr"==e&&this.getDC().addClass(this.getNS()+"dvr"),this._promote(t,e);break;default:this._promote(t,e)}},this._syncPlugins=function(t){var e=this;this.env.loading=!0,function(){try{if(e._plugins.length>0)for(var i=0;e._plugins.length>i;i++)if(!e._plugins[i].isReady())return setTimeout(arguments.callee,50),void 0;e.env.loading=!1,e._promote("pluginsReady",{});try{t()}catch(s){}}catch(s){}}()},this._MD=function(t){projekktor("#"+t.currentTarget.id.replace(/_media$/,""))._playerFocusListener(t)},this._addGUIListeners=function(){var t=this;this._removeGUIListeners(),this.getDC().get(0).addEventListener?this.getDC().get(0).addEventListener("mousedown",this._MD,!0):this.getDC().mousedown(function(e){t._playerFocusListener(e)}),this.getDC().mousemove(function(e){t._playerFocusListener(e)}).mouseenter(function(e){t._playerFocusListener(e)}).mouseleave(function(e){t._playerFocusListener(e)}).focus(function(e){t._playerFocusListener(e)}).blur(function(e){t._playerFocusListener(e)}),$(window).bind("resize.projekktor"+this.getId(),function(){t.setSize()}).bind("touchstart",function(){t._windowTouchListener(event)}),this.config.enableKeyboard===!0&&($(document).unbind("keydown.pp"+this._id),$(document).bind("keydown.pp"+this._id,function(e){t._keyListener(e)}))},this._removeGUIListeners=function(){$("#"+this.getId()).unbind(),this.getDC().unbind(),this.getDC().get(0).removeEventListener?this.getDC().get(0).removeEventListener("mousedown",this._MD,!0):this.getDC().get(0).detachEvent("onmousedown",this._MD),$(window).unbind("resize.projekktor"+this.getId())},this._registerPlugins=function(){var plugins=$.merge($.merge([],this.config._plugins),this.config._addplugins),pluginName="",pluginObj=null;if(!(this._plugins.length>0||0===plugins.length))for(var i=0;plugins.length>i;i++){pluginName="projekktor"+plugins[i].charAt(0).toUpperCase()+plugins[i].slice(1);try{typeof eval(pluginName)}catch(e){alert("Projekktor Error: Plugin '"+plugins[i]+"' malicious or not available.");continue}pluginObj=$.extend(!0,{},new projekktorPluginInterface,eval(pluginName).prototype),pluginObj.name=plugins[i].toLowerCase(),pluginObj.pp=this,pluginObj.playerDom=this.env.playerDom,pluginObj._init(this.config["plugin_"+plugins[i].toLowerCase()]||{}),null==this.config["plugin_"+pluginObj.name]&&(this.config["plugin_"+pluginObj.name]={}),this.config["plugin_"+pluginObj.name]=$.extend(!0,{},pluginObj.config||{});for(var propName in pluginObj)propName.indexOf("Handler")>1&&(null==this._pluginCache[propName]&&(this._pluginCache[propName]=[]),this._pluginCache[propName].push(pluginObj));this._plugins.push(pluginObj)}},this.removePlugins=function(t){if(0!=this._plugins.length){var e=t||$.merge($.merge([],this.config._plugins),this.config._addplugins),i=this._plugins.length;for(var s=0;e.length>s;s++)for(var n=0;i>n;n++)if(void 0!=this._plugins[n]&&this._plugins[n].name==e[s].toLowerCase()){this._plugins[n].deconstruct(),this._plugins.splice(n,1);for(var a in this._pluginCache)for(var r=0;this._pluginCache[a].length>r;r++)this._pluginCache[a][r].name==e[s].toLowerCase()&&this._pluginCache[a].splice(r,1)}}},this.getPlugins=function(){var t=[];return $.each(this._plugins,function(){t.push({name:this.name,ver:this.version||"unknown"})}),t},this._promote=function(t,e){var i=this;this._enqueue(function(){try{i.__promote(t,e)}catch(s){}})},this.__promote=function(t,e){var i=t,s={};if("object"==typeof i){if(!i._plugin)return;i="plugin_"+i._plugin+$p.utils.capitalise(i._event.toUpperCase())}if("time"!=i&&"progress"!=i&&"mousemove"!=i&&$p.utils.log("Event: ["+i+"]",e,this.listeners),this._pluginCache[i+"Handler"]&&this._pluginCache[i+"Handler"].length>0)for(var n=0;this._pluginCache[i+"Handler"].length>n;n++)if(this.getConfig("debug"))try{this._pluginCache[i+"Handler"][n][i+"Handler"](e,this)}catch(a){$p.utils.log(a)}else this._pluginCache[i+"Handler"][n][i+"Handler"](e,this);if(this._pluginCache.eventHandler&&this._pluginCache.eventHandler.length>0)for(var n=0;this._pluginCache.eventHandler.length>n;n++)if(this.getConfig("debug"))try{this._pluginCache.eventHandler[n].eventHandler(i,e,this)}catch(a){$p.utils.log(a)}else this._pluginCache.eventHandler[n].eventHandler(i,e,this);if(this.listeners.length>0)for(var n=0;this.listeners.length>n;n++)if(this.listeners[n].event==i||"*"==this.listeners[n].event)if(this.getConfig("debug"))try{this.listeners[n].callback(e,this)}catch(a){$p.utils.log(a)}else this.listeners[n].callback(e,this)},this._detachplayerModel=function(){this._removeGUIListeners();try{this.playerModel.destroy(),this._promote("detach",{})}catch(t){}},this._windowTouchListener=function(t){t.touches&&t.touches.length>0&&(($(document.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY)).attr("id")||"").indexOf(this.getDC().attr("id"))>-1?(0==this.env.mouseIsOver&&this._promote("mouseenter",{}),this.env.mouseIsOver=!0,this._promote("mousemove",{}),t.stopPropagation()):this.env.mouseIsOver&&(this._promote("mouseleave",{}),this.env.mouseIsOver=!1))},this._playerFocusListener=function(t){var e=t.type.toLowerCase();switch(e){case"mousedown":if(0==this.env.mouseIsOver)break;if("|TEXTAREA|INPUT".indexOf("|"+t.target.tagName.toUpperCase())>-1)return;if(3==t.which){if($(t.target).hasClass("context"))break;$(document).bind("contextmenu",function(t){return $(document).unbind("contextmenu"),!1})}break;case"mousemove":if(this.env.mouseX!=t.clientX&&this.env.mouseY!=t.clientY&&(this.env.mouseIsOver=!0),this.env.clientX==t.clientX&&this.env.clientY==t.clientY)return;this.env.clientX=t.clientX,this.env.clientY=t.clientY;break;case"focus":case"mouseenter":this.env.mouseIsOver=!0;break;case"blur":case"mouseleave":this.env.mouseIsOver=!1}this._promote(e,t)},this._keyListener=function(t){if(this.env.mouseIsOver&&!("|TEXTAREA|INPUT".indexOf("|"+t.target.tagName.toUpperCase())>-1)){var e=this,i=this.getConfig("keys").length>0?this.getConfig("keys"):[{27:function(t){t.getInFullscreen()?t.setFullscreen(!1):t.setStop()},32:function(t,e){t.setPlayPause(),e.preventDefault()},70:function(t){t.setFullscreen()},39:function(t,e){t.setPlayhead("+5"),e.preventDefault()},37:function(t,e){t.setPlayhead("-5"),e.preventDefault()},38:function(t,e){t.setVolume("+0.05"),e.preventDefault()},40:function(t,e){t.setVolume("-0.05"),e.preventDefault()},68:function(t){t.setDebug()},67:function(t){$p.utils.log("Config Dump",t.config)},80:function(t){$p.utils.log("Schedule Dump",t.media)},84:function(t){$p.utils.log("Cuepoints Dump",t.getCuePoints())}}];this._promote("key",t),$.each(i||[],function(){try{this[t.keyCode](e,t)}catch(i){}try{this["*"](e)}catch(i){}})}},this._enterFullViewport=function(t){var e=this.getIframeParent()||$(window),i=this.getIframe()||this.getDC(),s=$(e[0].document.body).css("overflow");t&&(e=$(window),i=this.getDC()),i.data("fsdata",{scrollTop:e.scrollTop()||0,scrollLeft:e.scrollLeft()||0,targetStyle:i.attr("style")||"",targetWidth:i.width(),targetHeight:i.height(),bodyOverflow:"visible"==s?"auto":s,bodyOverflowX:$(e[0].document.body).css("overflow-x"),bodyOverflowY:$(e[0].document.body).css("overflow-y"),iframeWidth:i.attr("width")||0,iframeHeight:i.attr("height")||0}).css({position:"fixed",display:"block",top:0,left:0,width:"100%",height:"100%",zIndex:99999,margin:0,padding:0}),e.scrollTop(0).scrollLeft(0),$(e[0].document.body).css({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"})},this._exitFullViewport=function(t){var e=this.getIframeParent()||$(window),i=this.getIframe()||this.getDC(),s=i.data("fsdata")||null;t&&(e=$(window),i=this.getDC()),null!=s&&(e.scrollTop(s.scrollTop).scrollLeft(s.scrollLeft),$(e[0].document.body).css("overflow",s.bodyOverflow),$(e[0].document.body).css("overflow-x",s.bodyOverflowX),$(e[0].document.body).css("overflow-y",s.bodyOverflowY),s.iframeWidth>0&&!t?i.attr("width",s.iframeWidth+"px").attr("height",s.iframeHeight+"px"):i.width(s.targetWidth).height(s.targetHeight),i.attr("style",null==s.targetStyle?"":s.targetStyle).data("fsdata",null))},this.pluginAPI=function(){var t=Array.prototype.slice.call(arguments)||null,e=t.shift(),i=t.shift();if(null!=e&&null!=i)for(var s=0;this._plugins.length>s;s++)if(this._plugins[s].name==e)return this._plugins[s][i](t[0]),void 0},this.getPlayerVer=function(){return this.config._version},this.getIsLastItem=function(){return this._currentItem==this.media.length-1&&this.config._loop!==!0},this.getIsFirstItem=function(){return 0==this._currentItem&&this.config._loop!==!0},this.getItemConfig=function(t,e){return this.getConfig(t,e)},this.getConfig=function(t,e){var i=e||this._currentItem,s=this.config["_"+t]||this.config[t];if(null==t)return this.media[i].config;if(void 0==this.config["_"+t])try{void 0!==this.media[i].config[t]&&(s=this.media[i].config[t])}catch(n){}if(t.indexOf("plugin_")>-1)try{this.media[i].config[t]&&(s=$.extend(!0,{},this.config[t],this.media[i].config[t]))}catch(n){}if(null==s)return null;if("object"==typeof s&&null===s.length?s=$.extend(!0,{},s||{}):"object"==typeof s&&(s=$.extend(!0,[],s||[])),"string"==typeof s)switch(s){case"true":s=!0;break;case"false":s=!1;break;case"NaN":case"undefined":case"null":s=null}return s},this.getDC=function(){return this.env.playerDom},this.getState=function(t){var e="IDLE";try{e=this.playerModel.getState()}catch(i){}return null!=t?e==t.toUpperCase():e},this.getLoadProgress=function(){try{return this.playerModel.getLoadProgress()}catch(t){return 0}},this.getKbPerSec=function(){try{return this.playerModel.getKbPerSec()}catch(t){return 0}},this.getItemCount=function(){return 1==this.media.length&&"na"==this.media[0].mediaModel?0:this.media.length},this.getItemId=function(t){return this.media[t||this._currentItem].ID||null},this.getItemIdx=function(){return this._currentItem},this.getPlaylist=function(){return this.getItem("*")},this.getItem=function(){if(1==this.media.length&&"na"==this.media[0].mediaModel)return null;switch(arguments[0]||"current"){case"next":return $.extend(!0,{},this.media[this._currentItem+1]||{});case"prev":return $.extend(!0,{},this.media[this._currentItem-1]||{});case"current":return $.extend(!0,{},this.media[this._currentItem]||{});case"*":return $.extend(!0,[],this.media||[]);default:return $.extend(!0,{},this.media[arguments[0]||this._currentItem]||{})}},this.getVolume=function(){return this.getConfig("fixedVolume")===!0?this.config.volume:this.getConfig("volume")},this.getTrackId=function(){return this.getConfig("trackId")?this.config.trackId:null!=this._playlistServer?"pl"+this._currentItem:null},this.getLoadPlaybackProgress=function(){try{return this.playerModel.getLoadPlaybackProgress()}catch(t){return 0}},this.getSource=function(){try{return this.playerModel.getSource()[0].src}catch(t){return!1}},this.getDuration=function(){try{return this.playerModel.getDuration()}catch(t){return 0}},this.getPosition=function(){try{return this.playerModel.getPosition()||0}catch(t){return 0}},this.getMaxPosition=function(){try{return this.playerModel.getMaxPosition()||0}catch(t){return 0}},this.getFrame=function(){try{return this.playerModel.getFrame()}catch(t){return 0}},this.getTimeLeft=function(){try{return this.playerModel.getDuration()-this.playerModel.getPosition()}catch(t){return this.media[this._currentItem].duration}},this.getInFullscreen=function(){return this.getNativeFullscreenSupport().isFullScreen()},this.getMediaContainer=function(){return null==this.env.mediaContainer&&(this.env.mediaContainer=$("#"+this.getMediaId())),0==this.env.mediaContainer.length&&(this.env.mediaContainer=this.env.playerDom.find("."+this.getNS()+"display").length>0?$(document.createElement("div")).attr({id:this.getId()+"_media"}).css({overflow:"hidden",height:"100%",width:"100%",top:0,left:0,padding:0,margin:0,display:"block"}).appendTo(this.env.playerDom.find("."+this.getNS()+"display")):$(document.createElement("div")).attr({id:this.getMediaId()}).css({width:"1px",height:"1px"}).appendTo($(document.body))),this.env.mediaContainer},this.getMediaId=function(){return this.getId()+"_media"},this.getMediaType=function(){try{return this._getTypeFromFileExtension(this.playerModel.getSrc())||"na/na"}catch(t){return"na/na"}},this.getUsesFlash=function(){return this.playerModel.modelId.indexOf("FLASH")>-1},this.getModel=function(){try{return this.media[this._currentItem].mediaModel.toUpperCase()}catch(t){return"NA"}},this.getIframeParent=this.getIframeWindow=function(){try{var t=!1;return this.config._iframe&&(parent.location.host||!1),t===!1?!1:$(parent.window)}catch(e){return!1}},this.getIframe=function(){try{var t=[];return this.config._iframe&&(t=window.$(frameElement)||[]),0==t.length?!1:t}catch(e){return!1}},this.getIframeAllowFullscreen=function(){var t=null;try{t=window.frameElement.attributes.allowFullscreen||window.frameElement.attributes.mozallowFullscreen||window.frameElement.attributes.webkitallowFullscreen||null}catch(e){t=!0}return null!=t?!0:!1},this.getPlaybackQuality=function(){var t="default";try{t=this.playerModel.getPlaybackQuality()}catch(e){}return"default"==t&&(t=this.getConfig("playbackQuality")),("default"==t||-1==$.inArray(t,this.getPlaybackQualities()))&&(t=this.getAppropriateQuality()),-1==$.inArray(t,this.getPlaybackQualities())&&(t="default"),t},this.getPlaybackQualities=function(){try{return $.extend(!0,[],this.media[this._currentItem].qualities||[])}catch(t){}return[]},this.getIsMobileClient=function(t){var e=navigator.userAgent.toLowerCase();var i=["android","windows ce","blackberry","palm","mobile"];for(var s=0;i.length>s;s++)if(e.indexOf(i[s])>-1)return t?i[s].toUpperCase()==t.toUpperCase():!0;return!1},this.getCanPlay=function(t,e,i){return this._canPlay(t,e,i)},this.getCanPlayNatively=function(t){return this._canPlay(t,"native")},this.getPlatform=function(){return this.media[this._currentItem].platform||"error"},this.getPlatforms=function(){var t=this,e=this._testMediaSupport(!0),i=this.getConfig("platforms"),s=[],n=[];try{for(var a in this.media[this._currentItem].file)if(this.media[this._currentItem].file.hasOwnProperty(a))for(var r in e)this._canPlay(this.media[this._currentItem].file[a].type.replace(/x-/,""),e[r].toLowerCase(),this.getConfig("streamType"))&&-1==$.inArray(e[r].toLowerCase(),n)&&n.push(e[r].toLowerCase())}catch(o){}return n.sort(function(t,e){return $.inArray(t,i)-$.inArray(e,i)}),n},this.getNativeFullscreenSupport=function(){var t=this,e={supportsFullScreen:"viewport",isFullScreen:function(){try{return t.getDC().hasClass("fullscreen")}catch(e){return!1}},requestFullScreen:function(){t.playerModel.applyCommand("fullscreen",!0)},cancelFullScreen:function(){t.playerModel.applyCommand("fullscreen",!1)},prefix:"",ref:this},i="webkit moz o ms khtml".split(" ");if(document.cancelFullScreen!==void 0)e.supportsFullScreen=!0;else for(var s=0,n=i.length;n>s;s++)if(e.prefix=i[s],document.createElement("video")[e.prefix+"EnterFullscreen"]!==void 0&&(e.supportsFullScreen="mediaonly"),document[e.prefix+"CancelFullScreen"]!==void 0&&(e.supportsFullScreen="dom","moz"==e.prefix&&document[e.prefix+"FullScreenEnabled"]===void 0&&(e.supportsFullScreen="viewport")),e.supportsFullScreen!==!1&&"viewport"!==e.supportsFullScreen)break;return"viewport"==e.supportsFullScreen||"dom"==e.supportsFullScreen&&this.getConfig("forceFullViewport")?e:"mediaonly"==e.supportsFullScreen?(e.requestFullScreen=function(e){t.playerModel.getMediaElement().get(0)[this.prefix+"EnterFullscreen"]()},e.dest={},e.cancelFullScreen=function(){},e):(e.isFullScreen=function(e){var i=t.getIframe()?parent.window.document:document;switch(this.prefix){case"":return i.fullScreen;case"webkit":return i.webkitIsFullScreen;case"moz":return i[this.prefix+"FullScreen"]||t.getDC().hasClass("fullscreen")&&e!==!0;default:return i[this.prefix+"FullScreen"]}},e.requestFullScreen=function(){if(!this.isFullScreen()){var e=t.getIframeParent()||$(window),i=t.getIframe()?t.getIframe().get(0):null||t.getDC().get(0),s=this,n=t.getIframe()?parent.window.document:document,e=t.getIframeParent()||$(window);e.data("fsdata",{scrollTop:e.scrollTop(),scrollLeft:e.scrollLeft()}),$(n).unbind(this.prefix+"fullscreenchange.projekktor"),""===this.prefix?i.requestFullScreen():i[this.prefix+"RequestFullScreen"](),s.ref.playerModel.applyCommand("fullscreen",!0),$(n).bind(this.prefix+"fullscreenchange.projekktor",function(t){if(s.isFullScreen(!0))s.ref.playerModel.applyCommand("fullscreen",!0);else{s.ref.playerModel.applyCommand("fullscreen",!1);var e=s.ref.getIframeParent()||$(window),i=e.data("fsdata");null!=i&&(e.scrollTop(i.scrollTop),e.scrollLeft(i.scrollLeft))}})}},e.cancelFullScreen=function(){var e=t.getIframe()?parent.window.document:document,i=t.getIframeParent()||$(window),s=i.data("fsdata");$(t.getIframe()?parent.window.document:document).unbind(this.prefix+"fullscreenchange.projekktor"),e.exitFullScreen?e.exitFullScreen():""==this.prefix?e.cancelFullScreen():e[this.prefix+"CancelFullScreen"](),null!=s&&(i.scrollTop(s.scrollTop),i.scrollLeft(s.scrollLeft)),t.playerModel.applyCommand("fullscreen",!1)},e)},this.getId=function(){return this._id},this.getHasGUI=function(){try{return this.playerModel.getHasGUI()}catch(t){return!1}},this.getCssPrefix=this.getNS=function(){return this.config._cssClassPrefix||this.config._ns||"pp"},this.getPlayerDimensions=function(){return{width:this.getDC().width(),height:this.getDC().height()}},this.getMediaDimensions=function(){return this.playerModel.getMediaDimensions()||{width:0,height:0}},this.getAppropriateQuality=function(t){var e=t||this.getPlaybackQualities()||[];if(0==e.length)return[];var i=this.env.playerDom.width(),s=this.env.playerDom.height(),n=$p.utils.roundNumber(i/s,2),a={};return $.each(this.getConfig("playbackQualities")||[],function(){if(0>$.inArray(this.key,e))return!0;if((this.minHeight||0)>s&&s>=a.minHeight)return!0;if((a.minHeight||0)>this.minHeight)return!0;if("number"==typeof this.minWidth){if(0===this.minWidth&&this.minHeight>s)return!0;if(this.minWidth>i)return!0;a=this}else if("object"==typeof this.minWidth){var t=this;$.each(this.minWidth,function(){return(this.ratio||100)>n?!0:this.minWidth>i?!0:(a=t,!0)})}return!0}),$.inArray("auto",this.getPlaybackQualities())>-1?"auto":a.key||"default"},this.getFromUrl=function(t,e,i,s,n){var a=null,r=this,o=!this.getIsMobileClient();if(e==r&&"_reelUpdate"==i&&this._promote("scheduleLoading",1+this.getItemCount()),"_"!=i.substr(0,1)?window[i]=function(t){try{delete window[i]}catch(s){}e[i](t)}:n.indexOf("jsonp")>-1&&(this["_jsonp"+i]=function(t){e[i](t)}),n){if(void 0==$.parseJSON&&n.indexOf("json")>-1)return this._raiseError("Projekktor requires at least jQuery 1.4.2 in order to handle JSON playlists."),this;n=n.indexOf("/")>-1?n.split("/")[1]:n}var l={url:t,complete:function(t,r){if(void 0==n)try{t.getResponseHeader("Content-Type").indexOf("xml")>-1&&(n="xml"),t.getResponseHeader("Content-Type").indexOf("json")>-1&&(n="json"),t.getResponseHeader("Content-Type").indexOf("html")>-1&&(n="html")}catch(o){}a=$p.utils.cleanResponse(t.responseText,n);try{a=s(a,t.responseText,e)}catch(o){}if("error"!=r&&"jsonp"!=n)try{e[i](a)}catch(o){}},error:function(t){e[i]&&"jsonp"!=n&&e[i](!1)},cache:!0,async:o,dataType:n,jsonpCallback:"_"!=i.substr(0,1)?!1:"projekktor('"+this.getId()+"')._jsonp"+i,jsonp:"_"!=i.substr(0,1)?!1:"callback"};return l.xhrFields={withCredentials:!0},l.beforeSend=function(t){t.withCredentials=!0},$.support.cors=!0,$.ajax(l),this},this.setActiveItem=function(t){var e=0,i=this._currentItem,s=this,n=!1;if("string"==typeof t)switch(t){case"same":e=this._currentItem;break;case"previous":e=this._currentItem-1;break;case"next":e=this._currentItem+1}else e="number"==typeof t?parseInt(t):0;if(e!=this._currentItem&&1==this.getConfig("disallowSkip")&&!this.getState("COMPLETED")&&!this.getState("IDLE"))return this;this._detachplayerModel(),this.env.loading=!1,0!==e||null!=i&&i!=e||!(this.config._autoplay===!0||"DESTROYING|AWAKENING".indexOf(this.getState())>-1)?this.getItemCount()>1&&e!=i&&null!=i&&this.config._continuous===!0&&this.getItemCount()>e&&(n=!0):n=!0,(e>=this.getItemCount()||0>e)&&(n=this.config._loop,e=0),this._currentItem=e;var a=this.getDC().hasClass("fullscreen");this.getDC().attr("class",this.env.className),a&&this.getDC().addClass("fullscreen");var r=this.media[this._currentItem].mediaModel.toUpperCase();return $p.models[r]?(null!=this.getConfig("className",null)&&this.getDC().addClass(this.getNS()+this.getConfig("className")),this.getDC().addClass(this.getNS()+(this.getConfig("streamType")||"http")),$p.utils.cssTransitions()||this.getDC().addClass("notransitions"),this.getIsMobileClient()&&this.getDC().addClass("mobile")):(r="NA",this.media[this._currentItem].mediaModel=r,this.media[this._currentItem].errorCode=8),this.playerModel=new playerModel,$.extend(this.playerModel,$p.models[r].prototype),this._promote("syncing","display"),this._enqueue(function(){try{s._applyCuePoints()}catch(t){}}),this.playerModel._init({media:$.extend(!0,{},this.media[this._currentItem]),model:r,pp:this,environment:$.extend(!0,{},this.env),autoplay:n,quality:this.getPlaybackQuality(),fullscreen:this.getInFullscreen()}),this},this.setPlay=function(){var t=this;return this.getConfig("thereCanBeOnlyOne")&&projekktor("*").each(function(){this.getId()!==t.getId()&&this.setStop()}),this._enqueue("play",!1),this},this.setPause=function(){return this._enqueue("pause",!1),this},this.setStop=function(t){var e=this;return this.getState("IDLE")?this:(t?this._enqueue(function(){e._currentItem=0,e.setActiveItem(0)}):this._enqueue("stop",!1),this)},this.setPlayPause=function(){return this.getState("PLAYING")?this.setPause():this.setPlay(),this},this.setVolume=function(t,e){var i=this.getVolume();if(1==this.getConfig("fixedVolume"))return this;switch(typeof t){case"string":var s=t.substr(0,1);switch(t=parseFloat(t.substr(1)),s){case"+":t=this.getVolume()+t;break;case"-":t=this.getVolume()-t;break;default:t=this.getVolume()}case"number":t=parseFloat(t),t=t>1?1:t,t=0>t?0:t;break;default:return this}if(t>i&&e){if(t-i>.03){for(var n=i;t>=n;n+=.03)this._enqueue("volume",n,e);return this._enqueue("volume",t,e),this}}else if(i>t&&e&&i-t>.03){for(var n=i;n>=t;n-=.03)this._enqueue("volume",n,e);return this._enqueue("volume",t,e),this}return this._enqueue("volume",t),this},this.setPlayhead=this.setSeek=function(t){if(1==this.getConfig("disallowSkip"))return this;if("string"==typeof t){var e=t.substr(0,1);t=parseFloat(t.substr(1)),t="+"==e?this.getPosition()+t:"-"==e?this.getPosition()-t:this.getPosition()}return"number"==typeof t&&this._enqueue("seek",Math.round(100*t)/100),this},this.setFrame=function(t){if(null==this.getConfig("fps"))return this;if(1==this.getConfig("disallowSkip"))return this;if("string"==typeof t){var e=t.substr(0,1);t=parseFloat(t.substr(1)),t="+"==e?this.getFrame()+t:"-"==e?this.getFrame()-t:this.getFrame()}return"number"==typeof t&&this._enqueue("frame",t),this
},this.setPlayerPoster=function(t){var e=this;return this._enqueue(function(){e.setConfig({poster:t},0)}),this._enqueue(function(){e.playerModel.setPosterLive()}),this},this.setConfig=function(){var t=this,e=arguments;return this._enqueue(function(){t._setConfig(e[0]||null,e[1]||null)}),this},this._setConfig=function(){if(!arguments.length)return result;var confObj=arguments[0],dest="*",value=!1;if("object"!=typeof confObj)return this;dest="string"==arguments[1]||"number"==arguments[1]?arguments[1]:this._currentItem;for(var i in confObj)if(null==this.config["_"+i]){try{value=eval(confObj[i])}catch(e){value=confObj[i]}if("*"!=dest){if(void 0==this.media[dest])return this;null==this.media[dest].config&&(this.media[dest].config={}),this.media[dest].config[i]=value}else $.each(this.media,function(){null==this.config&&(this.config={}),this.config[i]=value})}return this},this.setFullscreen=function(t){var e=this.getNativeFullscreenSupport();return t=null==t?!e.isFullScreen():t,t===!0?e.requestFullScreen():e.cancelFullScreen(),this},this.setSize=function(t){var e=this.getIframe()||this.getDC(),i=e.data("fsdata")||null,s=t&&null!=t.width?t.width:null!=this.getConfig("width")?this.getConfig("width"):!1,n=t&&null!=t.height?t.height:null==this.getConfig("height")&&this.getConfig("ratio")?Math.round((s||this.getDC().width())/this.getConfig("ratio")):null!=this.getConfig("height")?this.getConfig("height"):!1;this.getInFullscreen()&&null!=i?(i.targetWidth=s,i.targetHeight=n,e.data("fsdata",i)):(s&&e.css({width:s+"px"}),n&&e.css({height:n+"px"}));try{this.playerModel.applyCommand("resize")}catch(a){}},this.setLoop=function(t){this.config._loop=t||!this.config._loop},this.setDebug=function(t){$p.utils.logging=t||!$p.utils.logging,$p.utils.logging&&$p.utils.log("DEBUG MODE for player #"+this.getId())},this.addListener=function(t,e){var i=this;return this._enqueue(function(){i._addListener(t,e)}),this},this._addListener=function(t,e){var i=t.indexOf(".")>-1?t.split("."):[t,"default"];return this.listeners.push({event:i[0],ns:i[1],callback:e}),this},this.removeListener=function(t,e){var i=this.listeners.length,s=t.indexOf(".")>-1?t.split("."):[t,"*"];for(var n=0;i>n;n++)void 0!=this.listeners[n]&&(this.listeners[n].event==s[0]||"*"===s[0])&&(this.listeners[n].ns!=s[1]&&"*"!==s[1]||this.listeners[n].callback!=e&&null!=e||this.listeners.splice(n,1));return this},this.setItem=function(){var t=arguments[0];var e=0;return this._clearqueue(),null==t?(e=this._removeItem(arguments[1]),e===this._currentItem&&this.setActiveItem("previous")):(e=this._addItem(this._prepareMedia({file:t,config:t.config||{}}),arguments[1],arguments[2]),e===this._currentItem&&this.setActiveItem(this._currentItem)),this},this.setFile=function(){var t=arguments[0]||"",e=arguments[1]||this._getTypeFromFileExtension(t),i=[];return this.env.loading===!0?this:(this._clearqueue(),this.env.loading=!0,this._detachplayerModel(),"object"==typeof t?($p.utils.log("Applying incoming JS Object",t),this._reelUpdate(t),this):(i[0]={},i[0].file={},i[0].file.src=t||"",i[0].file.type=e||this._getTypeFromFileExtension(splt[0]),i[0].file.type.indexOf("/xml")>-1||i[0].file.type.indexOf("/json")>-1?($p.utils.log("Loading external data from "+i[0].file.src+" supposed to be "+i[0].file.type),this._playlistServer=i[0].file.src,this.getFromUrl(i[0].file.src,this,"_reelUpdate",this.getConfig("reelParser"),i[0].file.type),this):($p.utils.log("Applying incoming single file:"+i[0].file.src,i),this._reelUpdate(i),this)))},this.setPlaybackQuality=function(t){var e=t||this.getAppropriateQuality();return $.inArray(e,this.media[this._currentItem].qualities||[])>-1&&(this.playerModel.applyCommand("quality",e),this.setConfig({playbackQuality:e})),this},this.openUrl=function(t){return t=t||{url:"",target:"",pause:!1},""==t.url?this:(t.pause===!0&&this.setPause(),window.open(t.url,t.target).focus(),this)},this.selfDestruct=this.destroy=function(){var t=this;return this._enqueue(function(){t._destroy()}),this},this._destroy=function(){var t=this;return $(this).unbind(),this.removePlugins(),this.playerModel.destroy(),this._removeGUIListeners(),$.each(projekktors,function(e){try{if(this.getId()==t.getId()||this.getId()==t.getId()||this.getParent()==t.getId())return projekktors.splice(e,1),void 0}catch(i){}}),this.env.playerDom.replaceWith(this.env.srcNode),this._promote("destroyed"),this.removeListener("*"),this},this.reset=function(){var t=this;return this.setFullscreen(!1),this._clearqueue(),this._enqueue(function(){t._reset()}),this},this._reset=function(){var t={},e=this;this.setFullscreen(!1),$(this).unbind(),$(this.getIframe()?parent.window.document:document).unbind(".projekktor"),$(window).unbind(".projekktor"+this.getId()),this.playerModel.destroy(),this.playerModel={},this.removePlugins(),this._removeGUIListeners(),this.env.mediaContainer=null,this._currentItem=null;for(var i in this.config)t["_"==i.substr(0,1)?i.substr(1):i]=this.config[i];return"function"==typeof this.env.onReady&&this._enqueue(e.env.onReady(e)),this._init(this.env.playerDom,t),this},this.setCuePoint=function(t,e){var i=void 0!==t.item?t.item:this.getItemIdx(),s=$.extend(!0,{offset:0},e),n=this,a={id:t.id||$p.utils.randomId(8),group:t.group||$p.utils.randomId(8),item:i,on:($p.utils.toSeconds(t.on)||0)+s.offset,off:($p.utils.toSeconds(t.off)||$p.utils.toSeconds(t.on)||0)+s.offset,value:t.value||null,callback:t.callback||function(){},precision:null==t.precision?1:t.precision,title:null==t.title?"":t.title,_listeners:[],_unlocked:!1,_active:!1,_lastTime:0,isAvailable:function(){return this._unlocked},_stateListener:function(t,e){if("STOPPED|COMPLETED|DESTROYING".indexOf(t)>-1){if(this._active)try{this.callback(!1,this,e)}catch(i){}this._active=!1,this._lastTime=-1}},_timeListener:function(t,e){if(e.getItemIdx()===this.item||"*"==this.item){var i=0==this.precision?Math.round(t):$p.utils.roundNumber(t,this.precision),s=this;if(this._unlocked===!1){var n=e.getDuration()*e.getLoadProgress()/100;if(!(n>=this.on||i>=this.on))return;$.each(this._listeners.unlock||[],function(){this(s,e)}),this._unlocked=!0}if(this._lastTime!=i){var a=1>=i-this._lastTime&&i-this._lastTime>0;if((i>=this.on&&this.off>=i||i>=this.on&&this.on==this.off&&this.on+1>=i)&&this._active!==!0){this._active=!0,$p.utils.log("Cue Point: [ON "+this.on+"] at "+i,this);try{this.callback({id:this.id,enabled:!0,value:this.value,seeked:!a,player:e})}catch(r){}}else if((this.on>i||i>this.off)&&this.off!=this.on&&1==this._active){this._active=!1,$p.utils.log("Cue Point: [OFF] at "+this.off,this);try{this.callback({id:this.id,enabled:!1,value:this.value,seeked:!a,player:e})}catch(r){}}this.off==this.on&&this._active&&new Number(i-this.on).toPrecision(this.precision)>=1&&(this._active=!1),this._lastTime=i}}},addListener:function(t,e){null==this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e||function(){})}};return null!=t.unlockCallback&&a.addListener("unlock",t.unlockCallback),null==this._cuePoints[i]&&(this._cuePoints[i]=[]),this._cuePoints[i].push(a),this.getState("IDLE")||this._promote("cuepointAdded"),this},this.setGotoCuePoint=function(t,e){var i=this.getCuePoints(e);return this.setPlayhead(i[t].on),this},this.getCuePoints=function(t){return this._cuePoints[t||this.getItemIdx()]||this._cuePoints||{}},this.getCuePointById=function(t,e){var i=!1,s=this.getCuePoints(e);for(var n=0;s.length>n;n++)if(s.id==t){i=this;break}return i},this.removeCuePoints=function(t,e){var i=this.getCuePoints(t||0)||{},s=[];for(var n=0;i.length>n;n++)i[n].group==e&&(this.removeListener("time",i[n].timeEventHandler),this.removeListener("state",i[n].stateEventHandler),s.push(n));for(var a=0;s.length>a;a++)i.splice(s[a]-a,1);return this},this.syncCuePoints=function(){var t=this;return this._enqueue(function(){try{t._applyCuePoints()}catch(e){}}),this},this._applyCuePoints=function(t){var e=this;(null!=this._cuePoints[this._currentItem]||null!=this._cuePoints["*"])&&$.each($.merge(this._cuePoints[this._currentItem]||[],this._cuePoints["*"]||[]),function(t,i){try{e.removeListener("time",i.timeEventHandler),e.removeListener("state",i.stateEventHandler)}catch(s){}i.timeEventHandler=function(t,e){try{i._timeListener(t,e)}catch(s){}},i.stateEventHandler=function(t,e){try{i._stateListener(t,e)}catch(s){}},e.addListener("time",i.timeEventHandler),e.addListener("state",i.stateEventHandler),e.addListener("item",function(){e.removeListener("time",i.timeEventHandler),e.removeListener("state",i.stateEventHandler)})})},this._enqueue=function(t,e,i){null!=t&&(this._queue.push({command:t,params:e,delay:i}),this._processQueue())},this._clearqueue=function(t,e){this._isReady===!0&&(this._queue=[])},this._processQueue=function(){var t=this,e=!1;this._processing!==!0&&this.env.loading!==!0&&(this._processing=!0,function(){try{e=t.playerModel.getIsReady()}catch(i){}if(t.env.loading!==!0&&e){try{var s=t._queue.shift();null!=s&&("string"==typeof s.command?s.delay>0?setTimeout(function(){t.playerModel.applyCommand(s.command,s.params)},s.delay):t.playerModel.applyCommand(s.command,s.params):s.command(t))}catch(i){$p.utils.log("ERROR:",i)}return 0==t._queue.length?(t._isReady===!1&&(t._isReady=!0),t._processing=!1,void 0):(arguments.callee(),void 0)}setTimeout(arguments.callee,100)}())},this._getTypeFromFileExtension=function(t){var e="",i=[],s={},i=[],n=null,a=!0;for(var r in $p.mmap)if($p.mmap.hasOwnProperty(r)){n=$p.mmap[r].platform,"object"!=typeof n&&(n=[n]),a=!0;for(var o=0;n.length>o;o++)null!=n[o]&&(this.getConfig("enable"+n[o].toUpperCase()+"Platform")===!1||-1===$.inArray(n[o],this.getConfig("platforms")))&&(a=!1);if(a===!1)continue;i.push("\\."+$p.mmap[r].ext),s[$p.mmap[r].ext]=$p.mmap[r]}i="^.*.("+i.join("|")+")";try{e=t.match(RegExp(i))[1],e=e?e.replace(".",""):"NaN"}catch(l){e="NaN"}return s[e].type},this._testMediaSupport=function(t){var e={},i=[],s="",n=this;if(t){if(null!=$p._platformTableCache)return $p._platformTableCache}else if(null!=$p._compTableCache)return $p._compTableCache;for(var a=0;$p.mmap.length>a;a++)$p.mmap.hasOwnProperty(a)&&(platforms="object"==typeof $p.mmap[a].platform?$p.mmap[a].platform:[$p.mmap[a].platform],$.each(platforms,function(t,r){return null==r?!0:(s=$p.mmap[a].streamType||["http"],$.each(s,function(t,s){if(null==e[s]&&(e[s]={}),null==e[s][r]&&(e[s][r]=[]),$.inArray($p.mmap[a].type,e[s][r])>-1)return!0;var o=""+($p.models[$p.mmap[a].model.toUpperCase()].prototype[r.toLowerCase()+"Version"]||"1");try{if($p.utils.versionCompare($p.platforms[r.toUpperCase()]($p.mmap[a].type),o))return 0!=n.getConfig("enable"+r.toUpperCase()+"Platform")&&$.inArray(r.toLowerCase(),n.getConfig("platforms"))>-1&&(e[s][r].push($p.mmap[a].type),-1==$.inArray(r.toUpperCase(),i)&&i.push(r.toUpperCase())),!0}catch(l){$p.utils.log("ERROR","platform "+r+" not defined")}return!0}),!0)}));return $p._compTableCache=e,$p._platformTableCache=i,t?$p._platformTableCache:$p._compTableCache},this._readMediaTag=function(t){var e={},i="",s=[],n=this;if(-1=="VIDEOAUDIO".indexOf(t[0].tagName.toUpperCase()))return!1;this.getConfig("ignoreAttributes")||(e={autoplay:void 0===t.attr("autoplay")&&void 0===t.prop("autoplay")||t.prop("autoplay")===!1?!1:!0,controls:void 0===t.attr("controls")&&void 0===t.prop("controls")||t.prop("controls")===!1?!1:!0,loop:void 0===t.attr("autoplay")&&void 0===t.prop("loop")||t.prop("loop")===!1?!1:!0,title:void 0!==t.attr("title")&&t.attr("title")!==!1?t.attr("title"):"",poster:void 0!==t.attr("poster")&&t.attr("poster")!==!1?t.attr("poster"):"",width:void 0!==t.attr("width")&&t.attr("width")!==!1?t.attr("width"):null,height:void 0!==t.attr("height")&&t.attr("height")!==!1?t.attr("height"):null}),i=$($("
").html($(t).clone())).html(),s=["autoplay","controls","loop"];for(var a=0;s.length>a;a++)-1!=i.indexOf(s[a])&&(e[s[a]]=!0);if(e.playlist=[],e.playlist[0]=[],e.playlist[0].config={tracks:[]},t.attr("src")&&e.playlist[0].push({src:t.attr("src"),type:t.attr("type")||this._getTypeFromFileExtension(t.attr("src"))}),!$("").get(0).canPlayType){var r=t;do if(r=r.next("source,track"),r.attr("src"))switch(r.get(0).tagName.toUpperCase()){case"SOURCE":e.playlist[0].push({src:r.attr("src"),type:r.attr("type")||this._getTypeFromFileExtension(r.attr("src")),quality:r.attr("data-quality")||""});break;case"TRACK":$(this).attr("src")&&e.playlist[0].config.tracks.push({src:r.attr("src"),kind:r.attr("kind")||"subtitle",lang:r.attr("srclang")||null,label:r.attr("label")||null})}while(r.attr("src"))}return 0==e.playlist[0].length&&t.children("source,track").each(function(){if($(this).attr("src"))switch($(this).get(0).tagName.toUpperCase()){case"SOURCE":e.playlist[0].push({src:$(this).attr("src"),type:$(this).attr("type")||n._getTypeFromFileExtension($(this).attr("src")),quality:$(this).attr("data-quality")||""});break;case"TRACK":e.playlist[0].config.tracks.push({src:$(this).attr("src"),kind:$(this).attr("kind")||"subtitle",lang:$(this).attr("srclang")||null,label:$(this).attr("label")||null})}}),e},this._raiseError=function(t){this.env.playerDom.html(t).css({color:"#fdfdfd",backgroundColor:"#333",lineHeight:this.config.height+"px",textAlign:"center",display:"block"}),this._promote("error")},this._init=function(t,e){var i=t||srcNode,s=e||cfg,n=this._readMediaTag(i);if(this.env.srcNode=i.wrap("").parent().html(),i.unwrap(),this.env.className=i.attr("class")||"",this._id=i[0].id||$p.utils.randomId(8),n!==!1){this.env.playerDom=$("").attr({"class":i[0].className,style:i.attr("style")}),i.replaceWith(this.env.playerDom),i.empty().removeAttr("type").removeAttr("src");try{i.get(0).pause(),i.get(0).load()}catch(a){}$("").append(i).get(0).innerHTML="",i=null}else this.env.playerDom=i;s=$.extend(!0,{},n,s);for(var r in s)null!=this.config["_"+r]?this.config["_"+r]=s[r]:this.config[r]=r.indexOf("plugin_")>-1?$.extend(this.config[r],s[r]):s[r];if($p.utils.logging=this.config._debug,this.setSize(),this.getIsMobileClient()&&(this.config._autoplay=!1,this.config.fixedVolume=!0),this.env.playerDom.attr("id",this._id),this.config._theme)switch(typeof this.config._theme){case"string":break;case"object":this._applyTheme(this.config._theme)}else this._start(!1);return this},this._start=function(t){var e=this,i=[];this._registerPlugins(),this.config._iframe===!0&&(this.getIframeParent()?this.getIframeParent().ready(function(){e._enterFullViewport(!0)}):e._enterFullViewport(!0)),this.getIframeParent()===!1&&(this.config._isCrossDomain=!0),this.getIframeAllowFullscreen()||(this.config.enableFullscreen=!1),"function"==typeof onReady&&this._enqueue(function(){onReady(e)});for(var s in this.config._playlist[0])if(this.config._playlist[0][s].type&&(this.config._playlist[0][s].type.indexOf("/json")>-1||this.config._playlist[0][s].type.indexOf("/xml")>-1))return this.setFile(this.config._playlist[0][s].src,this.config._playlist[0][s].type),this;return this.setFile(this.config._playlist),this},this._applyTheme=function(data){var ref=this;if(data===!1)return this._raiseError("The Projekktor theme-set specified could not be loaded."),!1;if("string"==typeof data.css&&$("head").append('"),"string"==typeof data.html&&this.env.playerDom.html($p.utils.parseTemplate(data.html,{p:this.getNS()})),this.env.playerDom.addClass(data.id).addClass(data.variation),this.env.className=this.env.className&&0!==this.env.className.length?this.env.className+" "+data.id:data.id,data.variation&&0!==data.variation.length&&(this.env.className+=" "+data.variation),"object"==typeof data.config){for(var i in data.config)null!=this.config["_"+i]?this.config["_"+i]=data.config[i]:this.config[i]=i.indexOf("plugin_")>-1?$.extend(!0,{},this.config[i],data.config[i]):data.config[i];if("object"==typeof data.config.plugins)for(var i=0;data.config.plugins.length>i;i++)try{typeof eval("projekktor"+data.config.plugins[i])}catch(e){return this._raiseError("The applied theme requires the following Projekktor plugin(s): "+data.config.plugins.join(", ")+""),!1}}return data.onReady&&this._enqueue(function(player){eval(data.onReady)}),this._start()},this._init()}},$p.mmap=[],$p.models={},$p.newModel=function(t,e){if("object"!=typeof t)return i;if(!t.modelId)return i;var i=!1,s=$p.models[e]&&void 0!=e?$p.models[e].prototype:{};if($p.models[t.modelId])return i;$p.models[t.modelId]=function(){},$p.models[t.modelId].prototype=$.extend({},s,t),t.setiLove&&t.setiLove(),$p.mmap=$.grep($p.mmap,function(e){var i=e.model!=(t.replace?t.replace.toLowerCase():""),s=e.replaces!=t.modelId;return i&&s});for(var n=0;t.iLove.length>n;n++)t.iLove[n].model=t.modelId.toLowerCase(),t.iLove[n].replaces=t.replace?t.replace.toLowerCase():"",$p.mmap.push(t.iLove[n]);return!0}});var projekktorConfig=function(t){this._version=t};projekktorConfig.prototype={_playerName:"Projekktor",_playerHome:"http://www.projekktor.com?via=context",_cookieName:"projekktor",_cookieExpiry:356,_plugins:["display","controlbar","contextmenu"],_addplugins:[],_reelParser:null,_ns:"pp",_platforms:["browser","android","ios","native","vlc","flash"],_iframe:!1,_ignoreAttributes:!1,_loop:!1,_autoplay:!1,_continuous:!0,_thereCanBeOnlyOne:!0,_leaveFullscreen:!0,_playlist:[],_theme:!1,_themeRepo:!1,_messages:{0:"#0 An (unknown) error occurred.",1:"#1 You aborted the media playback. ",2:"#2 A network error caused the media download to fail part-way. ",3:"#3 The media playback was aborted due to a corruption problem. ",4:"#4 The media (%{title}) could not be loaded because the server or network failed.",5:"#5 Sorry, your browser does not support the media format of the requested file.",6:"#6 Your client is in lack of the Flash Plugin V%{flashver} or higher.",7:"#7 No media scheduled.",8:"#8 ! Invalid media model configured !",9:"#9 File (%{file}) not found.",10:"#10 Invalid or missing quality settings for %{title}.",11:"#11 Invalid streamType and/or streamServer settings for %{title}.",12:"#12 Invalid or inconsistent quality setup for %{title}.",80:"#80 The requested file does not exist or is delivered with an invalid content-type.",97:"No media scheduled.",98:"Invalid or malformed playlist data!",99:"Click display to proceed. ",100:"Keyboard Shortcuts",500:"This Youtube video has been removed or set to private",501:"The Youtube user owning this video disabled embedding.",502:"Invalid Youtube Video-Id specified."},_debug:!1,_width:null,_height:null,_ratio:!1,_keys:[],_isCrossDomain:!1,_forceFullViewport:!1,id:0,title:null,cat:"clip",poster:null,controls:!0,start:!1,stop:!1,volume:.5,cover:"",disablePause:!1,disallowSkip:!1,fixedVolume:!1,imageScaling:"aspectratio",videoScaling:"aspectratio",playerFlashMP4:"",playerFlashMP3:"",streamType:"http",streamServer:"",startParameter:"start",useYTIframeAPI:!0,enableKeyboard:!0,enableFullscreen:!0,playbackQuality:"default",_playbackQualities:[{key:"small",minHeight:240,minWidth:240},{key:"medium",minHeight:360,minWidth:[{ratio:1.77,minWidth:640},{ratio:1.33,minWidth:480}]},{key:"large",minHeight:480,minWidth:[{ratio:1.77,minWidth:853},{ratio:1.33,minWidth:640}]},{key:"hd1080",minHeight:1080,minWidth:[{ratio:1.77,minWidth:1920},{ratio:1.33,minWidth:1440}]},{key:"hd720",minHeight:720,minWidth:[{ratio:1.77,minWidth:1280},{ratio:1.33,minWidth:960}]},{key:"highres",minHeight:1081,minWidth:0}],enableTestcard:!0,skipTestcard:!1,duration:0,className:""},jQuery(function(t){$p.utils={imageDummy:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi/v//PwNAgAEACQsDAUdpTjcAAAAASUVORK5CYII="},capitalise:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},blockSelection:function(t){return t&&t.css({"-khtml-user-select":"none","-webkit-user-select":"none",MozUserSelect:"none","user-select":"none"}).attr("unselectable","on").bind("selectstart",function(){return!1}),t},unique:function(e){var i=[];for(var s=e.length;s--;){var n=e[s];-1===t.inArray(n,i)&&i.unshift(n)}return i},intersect:function(e,i){var s=[];return t.each(e,function(n){try{t.inArray(i,e[n])>-1&&s.push(e[n])}catch(a){}try{t.inArray(e[n],i)>-1&&s.push(e[n])}catch(a){}}),s},roundNumber:function(t,e){return 0>=t||isNaN(t)?0:Math.round(t*Math.pow(10,e))/Math.pow(10,e)},randomId:function(t){var e="abcdefghiklmnopqrstuvwxyz",i="";for(var s=0;t>s;s++){var n=Math.floor(Math.random()*e.length);i+=e.substring(n,n+1)}return i},toAbsoluteURL:function(t){var e=location,i,s,n,a;if(null==t||""==t)return"";if(/^\w+:/.test(t))return t;if(i=e.protocol+"//"+e.host,0===t.indexOf("/"))return i+t;if(s=e.pathname.replace(/\/[^\/]*$/,""),n=t.match(/\.\.\//g))for(t=t.substring(3*n.length),a=n.length;a--;)s=s.substring(0,s.lastIndexOf("/"));return i+s+"/"+t},strip:function(t){return t.replace(/^\s+|\s+$/g,"")},toSeconds:function(t){var e=0;if("string"!=typeof t)return t;if(t){var s=t.split(":");for(s.length>3&&(s=s.slice(0,3)),i=0;s.length>i;i++)e=60*e+parseFloat(s[i].replace(",","."))}return parseFloat(e)},toTimeString:function(t,e){var i=Math.floor(t/3600),s=t%3600,n=Math.floor(s/60),a=s%60,r=Math.floor(a);return 10>i&&(i="0"+i),10>n&&(n="0"+n),10>r&&(r="0"+r),e===!0?i+":"+n:i+":"+n+":"+r},embeddFlash:function(e,i,s,n){var a=i.FlashVars||{},r="",o="",l="",h="",u=e,c="";i.src+=-1==i.src.indexOf("?")?"?":"&";for(var d in a)"function"!=typeof a[d]&&(h=a[d],i.src+=d+"="+encodeURIComponent(h)+"&");i.src.replace(/&$/,""),o='",(!document.all||window.opera)&&(r=l),null===u?r:(u.get(0).innerHTML=r,s!==!1&&u.append(t("").attr("id",i.id+"_cc").css({width:n?"1px":"100%",height:n?"1px":"100%",backgroundColor:9>$p.utils.ieVersion()?"#000":"transparent",filter:"alpha(opacity = 0.1)",position:"absolute",top:0,left:0})),t("#"+i.id))},ieVersion:function(){var t=3,e=document.createElement("div"),i=e.getElementsByTagName("i");while(e.innerHTML="",i[0]);return t>4?t:void 0},parseTemplate:function(t,e,i){if(void 0===e||0==e.length||"object"!=typeof e)return t;for(var s in e)t=t.replace(RegExp("%{"+s+"}","gi"),i===!0?window.encodeURIComponent(e[s]):e[s]);return t=t.replace(/%{(.*?)}/gi,"")},stretch:function(e,i,s,n,a,r){if(null==i)return!1;i instanceof t==!1&&(i=t(i)),i.data("od")||i.data("od",{width:i.width(),height:i.height()});var o=void 0!==a?a:i.data("od").width,l=void 0!==r?r:i.data("od").height,h=s/o,u=n/l,c=s,d=n;switch(e){case"none":c=o,d=l;break;case"fill":h>u?(c=o*h,d=l*h):u>h&&(c=o*u,d=l*u);break;case"aspectratio":default:h>u?(c=o*u,d=l*u):u>h&&(c=o*h,d=l*h)}return s=$p.utils.roundNumber(100*(c/s),0),n=$p.utils.roundNumber(100*(d/n),0),0===s||0===n?!1:(i.css({margin:0,padding:0,width:s+"%",height:n+"%",left:(100-s)/2+"%",top:(100-n)/2+"%"}),i.data("od").width!=i.width()||i.data("od").height!=i.height()?!0:!1)},parseUri:function(t){var e={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=e.parser[e.strictMode?"strict":"loose"].exec(t),s={},n=14;while(n--)s[e.key[n]]=i[n]||"";return s[e.q.name]={},s[e.key[12]].replace(e.q.parser,function(t,i,n){i&&(s[e.q.name][i]=n)}),s},log:function(){this.logging!==!1&&(this.history=this.history||[],this.history.push(arguments),window.console&&console.log(Array.prototype.slice.call(arguments)))},cleanResponse:function(e,i){var s=!1;switch(i){case"html":case"xml":window.DOMParser?(s=new DOMParser,s=s.parseFromString(e,"text/xml")):(s=new ActiveXObject("Microsoft.XMLDOM"),s.async="false",s.loadXML(e));break;case"json":s=e,"string"==typeof s&&(s=t.parseJSON(s));break;case"jsonp":break;default:s=e}return s},cssTransitions:function(){var t=document.createElement("z"),e=t.style;function i(t){for(var i in t)if(null!=e[t[i]])return!0;return!1}function s(t){var e="Webkit Moz O ms Khtml".split(" "),s=t.charAt(0).toUpperCase()+t.substr(1),n=(t+" "+e.join(s+" ")+s).split(" ");return i(n)}return s("animationName")},versionCompare:function(t,e){var i=t.split("."),s=e.split("."),n=0;for(n=0;i.length>n;++n)i[n]=Number(i[n]);for(n=0;s.length>n;++n)s[n]=Number(s[n]);return 2==i.length&&(i[2]=0),i[0]>s[0]?!0:i[0]s[1]?!0:i[1]s[2]?!0:i[2]0){for(var t=0;navigator.plugins.length>t;++t)if(-1!=navigator.plugins[t].name.indexOf("VLC")){if(null!=navigator.plugins[t].version)return navigator.plugins[t].version||"0";if(null!=navigator.plugins[t].description&&navigator.plugins[t].description.match(/\d{1,}\.\d{1,}\.\d{1,}/i)[0])return navigator.plugins[t].description.match(/\d{1,}\.\d{1,}\.\d{1,}/i)[0]}}else try{return new ActiveXObject("VideoLAN.VLCPlugin.2"),"0"}catch(e){}return"0"},FLASH:function(t){try{try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{e.AllowScriptAccess="always"}catch(i){return"6.0.0"}}catch(i){}return""+new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1].match(/\d+/g)[0]}catch(i){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return""+(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1].match(/\d+/g)[0]}catch(i){}}return"0"},FLASHNA:function(t){try{try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{e.AllowScriptAccess="always"}catch(i){return"6.0.0"}}catch(i){}return""+new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1].match(/\d+/g)[0]}catch(i){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return""+(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1].match(/\d+/g)[0]}catch(i){}}return"0"},ANDROID:function(t){try{return""+navigator.userAgent.toLowerCase().match(/android\s+(([\d\.]+))?/)[1]}catch(e){}return"0"},IOS:function(t){var e=navigator.userAgent.toLowerCase(),i=e.indexOf("os ");return(e.indexOf("iphone")>-1||e.indexOf("ipad")>-1)&&i>-1?""+e.substr(i+3,3).replace("_","."):"0"},NATIVE:function(e){try{var i=t(e.indexOf("video")>-1?"":"").get(0);if(null!=i.canPlayType){if("*"===e)return"1";switch(i.canPlayType(e)){case"no":case"":return"0";default:return"1"}}}catch(s){}return"0"},BROWSER:function(t){return"1"}}});var projekktorPluginInterface=function(){};jQuery(function($){projekktorPluginInterface.prototype={pluginReady:!1,reqVer:null,name:"",pp:{},config:{},playerDom:null,_appliedDOMObj:[],_pageDOMContainer:{},_childDOMContainer:{},_init:function(t){return this.config=$.extend(!0,this.config,t),null==this.reqVer||$p.utils.versionCompare(this.pp.getPlayerVer(),this.reqVer)?(this.initialize(),void 0):(alert("Plugin '"+this.name+"' requires Projekktor v"+this.reqVer+" or later! Please visit http://www.projekktor.com and get the most recent version."),this.pluginReady=!0,void 0)},getConfig:function(t,e){var i=null,s=e||null;return null!=this.pp.getConfig("plugin_"+this.name)&&(i=this.pp.getConfig("plugin_"+this.name)[t]),null==i&&(i=this.pp.getConfig(t)),null==i&&(i=this.config[t]),"object"==typeof i&&null===i.length?i=$.extend(!0,{},i,this.config[t]):"object"==typeof i&&(i=$.extend(!0,[],this.config[t]||[],i||[])),null==i?s:i},getDA:function(t){return"data-"+this.pp.getNS()+"-"+this.name+"-"+t},getCN:function(t){return this.pp.getNS()+t},sendEvent:function(t,e){this.pp._promote({_plugin:this.name,_event:t},e)},deconstruct:function(){this.pluginReady=!1,$.each(this._appliedDOMObj,function(){$(this).unbind()})},applyToPlayer:function(t,e,i){if(!t)return null;var s=e||"container",n="",a=this;try{n=t.attr("class")||this.name}catch(r){n=this.name}return this._pageDOMContainer[s]=$("["+this.getDA("host")+"='"+this.pp.getId()+"']["+this.getDA("func")+"='"+s+"']"),this._childDOMContainer[s]=this.playerDom.find("["+this.getDA("func")+"='"+s+"'],."+this.getCN(n)+":not(["+this.getDA("func")+"=''])"),this._pageDOMContainer[s].length>0?(this._pageDOMContainer[s].removeClass("active").addClass("inactive"),$.each(this._pageDOMContainer[s],function(){a._appliedDOMObj.push($(this))}),this._pageDOMContainer[s]):0==this._childDOMContainer[s].length?(t.removeClass(n).addClass(this.pp.getNS()+n).removeClass("active").addClass("inactive").attr(this.getDA("func"),s).appendTo(this.playerDom),this._childDOMContainer[s]=t,this._appliedDOMObj.push(t),i===!0&&t.addClass("active").removeClass("inactive"),t):($.each(this._childDOMContainer[s],function(){$(this).attr(a.getDA("func"),s),a._appliedDOMObj.push($(this))}),i===!0&&this._childDOMContainer[s].addClass("active").removeClass("inactive"),$(this._childDOMContainer[s][0]))},getElement:function(t){return this.pp.env.playerDom.find("."+this.pp.getNS()+t)},setInactive:function(){$(this._pageDOMContainer.container).removeClass("active").addClass("inactive"),$(this._childDOMContainer.container).removeClass("active").addClass("inactive"),this.sendEvent("inactive",$.extend(!0,{},this._pageDOMContainer.container,this._childDOMContainer.container))},setActive:function(t,e){var i="object"==typeof t?t:this.getElement(t);return null==t?(this._pageDOMContainer.container.removeClass("inactive").addClass("active"),this._childDOMContainer.container.removeClass("inactive").addClass("active"),this.sendEvent("active",$.extend(!0,{},this._pageDOMContainer.container,this._childDOMContainer.container)),i):(0!=e?i.addClass("active").removeClass("inactive"):i.addClass("inactive").removeClass("active"),i.css("display",""),i)},getActive:function(t){return $(t).hasClass("active")},initialize:function(){},isReady:function(){return this.pluginReady},clickHandler:function(t){try{this.pp[this.getConfig(t+"Click").callback](this.getConfig(t+"Click").value)}catch(e){try{this.getConfig(t+"Click")(this.getConfig(t+"Click").value)}catch(e){}}return!1},cookie:function(key,value,ttl){if(void 0===document.cookie||document.cookie===!1)return null;if(null==key&&null!=value)return null;if(0==this.pp.getConfig("cookieExpiry"))return null;var t=new Date,result=null,cookieString="",tmp=storedData=jQuery.parseJSON(eval(result=RegExp("(?:^|; )"+encodeURIComponent(this.getConfig("cookieName")+"_"+this.name)+"=([^;]*)").exec(document.cookie))?decodeURIComponent(result[1]):null);return("object"!=typeof storedData||null==storedData)&&(storedData={},null!=key&&(storedData[key]=tmp)),null==key?storedData:1==arguments.length?storedData[key]:(null!=value?storedData[key]=value:delete storedData[key],$.isEmptyObject(storedData)?(ttl=0,storedData=""):storedData=$p.utils.stringify(storedData),t.setDate(t.getDate()+(ttl||this.getConfig("cookieExpiry",0))),cookieString=encodeURIComponent(this.getConfig("cookieName","projekktor")+"_"+this.name)+"="+encodeURIComponent(storedData)+"; expires="+(0==ttl?"Thu, 01 Jan 1970 00:00:01 GMT":t.toUTCString()),this.getConfig("cookieDomain",!1)&&(cookieString+="; domain="+options.domain),document.cookie=cookieString,value)
},eventHandler:function(){}}});var playerModel=function(){};jQuery(function(t){playerModel.prototype={modelId:"player",iLove:[],_currentState:null,_currentBufferState:null,_currentSeekState:null,_ap:!1,_volume:0,_quality:"default",_displayReady:!1,_isPlaying:!1,_id:null,_KbPerSec:0,_bandWidthTimer:null,_isPoster:!1,_isFullscreen:!1,hasGUI:!1,allowRandomSeek:!1,flashVerifyMethod:"api_get",mediaElement:null,pp:{},media:{duration:0,position:0,maxpos:0,offset:0,file:!1,poster:"",ended:!1,loadProgress:0,errorCode:0},_init:function(e){this.pp=e.pp||null,this.media=t.extend(!0,{},this.media,e.media),this._ap=e.autoplay,this._isFullscreen=e.fullscreen,this._id=$p.utils.randomId(8),this._quality=e.quality||this._quality,this._volume=this.pp.getVolume(),this._playbackQuality=this.pp.getPlaybackQuality(),this.init()},init:function(t){this.ready()},ready:function(){this.sendUpdate("modelReady"),this._ap?(this.sendUpdate("autostart",!0),this._setState("awakening")):this.displayItem(!1)},displayItem:function(e){return this._displayReady=!1,this._isPoster=!1,this.pp.removeListener("fullscreen.poster"),this.pp.removeListener("resize.poster"),e!==!0||this.getState("STOPPED")?(this._setState("idle"),this.applyImage(this.getPoster(),this.pp.getMediaContainer().html("")),this._isPoster=!0,this.displayReady(),void 0):(t("#"+this.pp.getMediaId()+"_image").remove(),t("#"+this.pp.getId()+"_testcard_media").remove(),this.applyMedia(this.pp.getMediaContainer()),void 0)},applyMedia:function(){},sendUpdate:function(t,e){"ERROR"!=this._currentState&&("error"==t&&this._setState("error"),this.pp._modelUpdateListener(t,e))},displayReady:function(){this._displayReady=!0,this.pp._modelUpdateListener("displayReady")},start:function(){var t=this;(null!=this.mediaElement||"PLAYLIST"==this.modelId)&&(this.getState("STARTING")||(this._setState("STARTING"),this.getState("STOPPED")||this.addListeners(),this.pp.getIsMobileClient("ANDROID")&&!this.getState("PLAYING")&&setTimeout(function(){t.setPlay()},500),this.setPlay()))},addListeners:function(){},removeListeners:function(){try{this.mediaElement.unbind(".projekktor"+this.pp.getId())}catch(t){}},detachMedia:function(){},destroy:function(e){this.removeListeners(),this.getState("IDLE")||this._setState("destroying"),this.detachMedia();try{t("#"+this.mediaElement.id).empty()}catch(i){}if(!this.pp.getIsMobileClient()){try{t("#"+this.mediaElement.id).remove()}catch(i){}try{this.mediaElement.remove()}catch(i){}this.pp.getMediaContainer().html("")}this.mediaElement=null,this.media.loadProgress=0,this.media.playProgress=0,this.media.frame=0,this.media.position=0,this.media.duration=0},reInit:function(){this.flashVersion===!1&&this._isFF()&&!this.getState("ERROR")&&this.pp.getConfig("bypassFlashFFFix")!==!0&&(this.sendUpdate("FFreinit"),this.removeListeners(),this.displayItem(!this.getState("IDLE")))},applyCommand:function(t,e){switch(t){case"quality":this.setQuality(e);break;case"error":this._setState("error"),this.setTestcard(e);break;case"play":if(this.getState("ERROR"))break;if(this.getState("IDLE")){this._setState("awakening");break}this.setPlay();break;case"pause":if(this.getState("ERROR"))break;this.setPause();break;case"volume":if(this.getState("ERROR"))break;this.setVolume(e)||(this._volume=e,this.sendUpdate("volume",e));break;case"stop":this.setStop();break;case"frame":this.setFrame(e);break;case"seek":if(this.getState("ERROR"))break;if(this.getSeekState("SEEKING"))break;if(this.getState("IDLE"))break;if(-1==this.media.loadProgress)break;this._setSeekState("seeking",e),this.setSeek(e);break;case"fullscreen":if(e==this._isFullscreen)break;this._isFullscreen=e,this.sendUpdate("fullscreen",this._isFullscreen),this.reInit(),this.setFullscreen();break;case"resize":this.setResize(),this.sendUpdate("resize",e)}},setFrame:function(t){var e=t/this.pp.getConfig("fps")+1e-5;this.setSeek(e)},setSeek:function(t){},setPlay:function(){},setPause:function(){},setStop:function(){this.detachMedia(),this._setState("stopped"),this.displayItem(!1)},setVolume:function(t){},setFullscreen:function(t){this.setResize()},setResize:function(){var t=this.pp.getMediaContainer();this.sendUpdate("scaled",{realWidth:this.media.videoWidth||null,realHeight:this.media.videoHeight||null,displayWidth:t.width(),displayHeight:t.height()})},setPosterLive:function(){},setQuality:function(t){if(this._quality!=t){this._quality=t;try{this.applySrc()}catch(e){}this.qualityChangeListener()}},getQuality:function(){return this._quality},getVolume:function(){return null==this.mediaElement?this._volume:this.mediaElement.prop("muted")===!0?0:this.mediaElement.prop("volume")},getLoadProgress:function(){return this.media.loadProgress||0},getLoadPlaybackProgress:function(){return this.media.playProgress||0},getPosition:function(){return this.media.position||0},getFrame:function(){return this.media.frame||0},getDuration:function(){return this.media.duration||0},getMaxPosition:function(){return this.media.maxpos||0},getPlaybackQuality:function(){return t.inArray(this._quality,this.media.qualities)>-1?this._quality:"default"},getInFullscreen:function(){return this.pp.getInFullscreen()},getKbPerSec:function(){return this._KbPerSec},getState:function(t){var e=null==this._currentState?"IDLE":this._currentState;return null!=t?e==t.toUpperCase():e},getBufferState:function(t){var e=null==this._currentBufferState?"NONE":this._currentBufferState;return null!=t?e==t.toUpperCase():e},getSeekState:function(t){var e=null==this._currentSeekState?"NONE":this._currentSeekState;return null!=t?e==t.toUpperCase():e},getSrc:function(){try{return this.mediaElement.get(0).currentSrc}catch(t){}try{return this.media.file[0].src}catch(t){}try{return this.getPoster()}catch(t){}return null},getModelName:function(){return this.modelId||null},getHasGUI:function(){return this.hasGUI&&!this._isPoster},getIsReady:function(){return this._displayReady},getPoster:function(){var t="poster",e=this.pp.getConfig(t),i="default",s=[];if("object"!=typeof e)return e;for(var n in e)e[n].quality&&s.push(e[n].quality);i=this.pp.getAppropriateQuality(s);for(var a in this.pp.getConfig(t))if(this.pp.getConfig(t)[a].quality==i){e=this.pp.getConfig(t)[a].src||null;break}return e},getMediaElement:function(){return this.mediaElement||t("")},getMediaDimensions:function(){return{width:this.media.videoWidth||0,height:this.media.videoHeight||0}},getSource:function(){var e=[],i=this.media.offset||this.media.position||!1,s=this,n="pseudo"==this.pp.getConfig("streamType")?this.pp.getConfig("startParameter"):!1;return t.each(this.media.file||[],function(){if(s._quality!=this.quality&&null!==s._quality)return!0;if(!n||!i)return e.push(this),!0;var a=$p.utils.parseUri(this.src),r=a.protocol+"://"+a.host+a.path,o=[];return t.each(a.queryKey,function(t,e){t!=n&&o.push(t+"="+e)}),r+=o.length>0?"?"+o.join("&")+"&"+n+"="+i:"?"+n+"="+i,this.src=r,e.push(this),!0}),0===e.length?this.media.file:e},timeListener:function(t){if(null!=t){var e=parseFloat((t.position||t.currentTime||this.media.position||0).toFixed(2)),i=parseFloat((t.duration||0).toFixed(2));isNaN(i+e)||((0!=i&&i!=this.media.duration&&!this.isPseudoStream||this.isPseudoStream&&0==this.media.duration)&&(this.media.duration=i,this.sendUpdate("durationChange",i)),e!=this.media.position&&(this.media.position=this.isPseudoStream&&Math.round(100*e)/100==Math.round(100*this.media.offset)/100?this.media.offset:this.media.offset+e,this.media.maxpos=Math.max(this.media.maxpos||0,this.media.position||0),this.media.playProgress=parseFloat(this.media.position>0&&this.media.duration>0?100*this.media.position/this.media.duration:0),this.media.frame=this.media.position*this.pp.getConfig("fps"),this.sendUpdate("time",this.media.position),this.loadProgressUpdate()))}},loadProgressUpdate:function(){var t=this.mediaElement.get(0),e=0;"object"==typeof t.buffered&&(0!==t.buffered.length||0!==t.seekable.length)&&100!=this.media.loadProgress&&(e=t.seekable&&t.seekable.length>0?Math.round(100*t.seekable.end(0)/this.media.duration):Math.round(100*t.buffered.end(t.buffered.length-1))/this.media.duration,this.media.loadProgress>e||(this.media.loadProgress=this.allowRandomSeek===!0?100:-1,this.media.loadProgress=100>this.media.loadProgress||void 0===this.media.loadProgress?e:100,this.sendUpdate("progress",this.media.loadProgress)))},progressListener:function(t,e){if(this.mediaElement instanceof jQuery&&"object"==typeof this.mediaElement.get(0).buffered&&this.mediaElement.get(0).buffered.length>0)return this.mediaElement.unbind("progress"),void 0;null==this._bandWidthTimer&&(this._bandWidthTimer=(new Date).getTime());var i=0,s=0;try{isNaN(e.loaded/e.total)?e.originalEvent&&!isNaN(e.originalEvent.loaded/e.originalEvent.total)&&(i=e.originalEvent.loaded,s=e.originalEvent.total):(i=e.loaded,s=e.total)}catch(n){t&&!isNaN(t.loaded/t.total)&&(i=t.loaded,s=t.total)}var a=i>0&&s>0?100*i/s:0;Math.round(a)>Math.round(this.media.loadProgress)&&(this._KbPerSec=i/1024/(((new Date).getTime()-this._bandWidthTimer)/1e3)),a=100!==this.media.loadProgress?a:100,a=this.allowRandomSeek===!0?100:5*Math.round(a/5),this.media.loadProgress!=a&&(this.media.loadProgress=a,this.sendUpdate("progress",a)),this.media.loadProgress>=100&&this.allowRandomSeek===!1&&this._setBufferState("full")},qualityChangeListener:function(){this.sendUpdate("qualityChange",this._quality)},endedListener:function(t){null!==this.mediaElement&&(0>=this.media.maxpos||"STARTING"!=this.getState()&&this._setState("completed"))},waitingListener:function(t){this._setBufferState("empty")},canplayListener:function(t){this._setBufferState("full")},canplaythroughListener:function(t){this._setBufferState("full")},suspendListener:function(t){this._setBufferState("full")},playingListener:function(t){this._setState("playing")},startListener:function(t){this.applyCommand("volume",this.pp.getConfig("volume")),this.isPseudoStream||this.setSeek(this.media.position||0),this._setState("playing")},pauseListener:function(t){this._setState("paused")},seekedListener:function(t){this._setSeekState("SEEKED",this.media.position)},volumeListener:function(t){this.sendUpdate("volume",this.getVolume())},flashReadyListener:function(){this._displayReady=!0},errorListener:function(t,e){},metaDataListener:function(t){try{this.media.videoWidth=t.videoWidth,this.media.videoHeight=t.videoHeight}catch(e){}this._scaleVideo()},setTestcard:function(e,i){var s=this.pp.getMediaContainer().html("").css({width:"100%",height:"100%"}),n=t.extend(this.pp.getConfig("messages"),this.pp.getConfig("msg")),a=null==n[e]?0:e,r=void 0!==i&&""!==i?i:n[a];this.removeListeners(),this.detachMedia(),this.pp.getItemCount()>1&&(r+=" "+n[99]),3>r.length&&(r="ERROR"),100==a&&(r=i),r=$p.utils.parseTemplate(r,t.extend({},this.media,{title:this.pp.getConfig("title")})),this.mediaElement=t("").addClass(this.pp.getNS()+"testcard").attr("id",this.pp.getId()+"_testcard_media").html("