if(typeof ns_API=="undefined"){var ns_API={loadEvents:[],reservedLabels:new RegExp(/^\s*(ns\_.*|agent|availscreen|colordepth|cookie|corporate|day|full\_loading\_time|html\_loading\_time|httpreferer|innersize|ip|java|lang|mimetypes|name|newcookie|offset|or|outersize|p|pie|plugins|referrer|screen|site|\_t|time|type|url|ver)\s*$/i),regCounter:new RegExp(/(?:https?):\/\/([^\/]+)\/([^\/]+)\/([^\/]+)\/s\?([\w_\-\.\[\]\(\)\$\~\{\}\*\^\,]{1,200})/)}}if(typeof ns_API.addEvent=="undefined"){ns_API.addEvent=(document.addEventListener)?(function(c,b,a){c.addEventListener(b,a,false)}):(document.attachEvent)?(function(c,b,a){c.attachEvent("on"+b,a)}):new Function}if(typeof ns_API.isIE=="undefined"){ns_API.isIE=
/*@cc_on!@*/
false}if(typeof ns_API.isIE7=="undefined"){ns_API.isIE7=(ns_API.isIE&&/MSIE\s*7/i.test(navigator.userAgent))?true:false}if(typeof ns_API.getJSPageURL=="undefined"){ns_API.getJSPageURL=function(){return(document.URL)?document.URL:document.location.domain+document.location.pathname+document.location.search}}if(typeof ns_API.onDocumentReady=="undefined"){ns_API.onDocumentReady=function(f){try{if(document.addEventListener&&!/webkit/i.test(navigator.userAgent)){document.addEventListener("DOMContentLoaded",f,false)}else{if(/msie/i.test(navigator.userAgent)){var d="__ie_onload_"+new Date().getTime();document.write('<script id="ns_api_defered'+d+'" defer src="javascript:void(0)"></script>');var c=document.getElementById(d);c.onreadystatechange=function(){if(/complete/i.test(this.readyState)){f()}}}else{if(/webkit/i.test(navigator.userAgent)){var a=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(a);f()}},10)}else{throw 0}}}}catch(b){ns_API.addEvent(window,"load",f)}}}if(typeof ns_API.addLoadEvent=="undefined"){ns_API.addLoadEvent=function(a){ns_API.loadEvents.push(a);if(!ns_API.loadEventHandler){ns_API.loadEventHandler=ns_API.onDocumentReady(function(){for(var c=0,b;(b=ns_API.loadEvents[c]);c++){if(b instanceof Function){b()}}})}}}if(typeof ns_API.constructLabel=="undefined"){ns_API.constructLabel=function(a){return a.replace(/[^\-_\.a-zA-Z0-9]/g,"___")}}if(typeof ns_API.startTime=="undefined"){ns_API.startTime=ns_API.addLoadEvent(function(){ns_API.startTime=new Date().getTime()})}if(typeof ns_API.streaming=="undefined"){ns_API.streaming=function(){return{version:"2.1.0",DEBUG:false,COMPATIBILITY_MODE:false,DEVELOPER:false,players:{},cntPlayers:0,url:"",label_prefix:"ns_st_",incLogs:0,uniqueIds:{},keepAliveInterval:20,players:[],events:{play:["pb","pl","cn","pr","ep","pn","tp","el","dt","ty","br","cs","st","cl","ca","ub","bt","mp","mv","fee","id","po","sq","sp","sv","cu","li","jspageurl","er"],pause:["pl","pr","cc","ep","pn","tp","el","dt","ty","st","id","po","li","cn"],end:["pe","pl","pr","cp","cn","ep","pn","tp","el","dt","ty","br","cs","st","cl","ca","ub","bt","bp","mp","mv","fee","pt","pa","id","po","pc","pp","sv","cu","sp","li","jspageurl","er"],"keep-alive":"jspageurl"},addCustomEvent:function(a,b){if(/^\s*(play|pause|end|keep-alive)\s*$/i.test(a)){return}this.events[a]=b;return true},clearCustomEvent:function(a){if(this.events[a]){delete this.events[a]}},getScriptVersion:function(){return this.version},init:function(){try{if(this.url==""){this.url=window.ns_pixelUrl.match(ns_API.regCounter)[0]}for(var b=0,a;(a=this.players[b]);b++){if(a.isInitialized){continue}if(a.onInit instanceof Function){try{if(this.COMPATIBILITY_MODE){var d=function(e){var f=e;return function(){if(!f.isCompatible()){ns_API.streaming.logIncompatible(f)}}}(a);setTimeout(d,0)}a.onInit.call(a)}catch(c){this.throwException(c)}}}}catch(c){this.throwException(c)}},throwException:function(a){if(this.DEBUG){alert("Streaming API\n"+(a.message||a))}},uniqueID:function(){var a=new Date().getTime();if(!this.uniqueIds[a]){this.uniqueIds[a]=0}this.uniqueIds[a]++;return String(a+"#"+this.uniqueIds[a])},setKeepAlive:function(a){var b=a;var c=function(){ns_API.streaming.setKeepAlive.call(ns_API.streaming,b)};if(!a.keepalive){a.keepalive=setInterval(c,this.keepAliveInterval*60000)}else{this.log("keep-alive",{})}},enableKeepAlive:function(a){if(!a.keepalive){this.setKeepAlive(a)}},clearKeepAlive:function(a){if(a&&a.keepalive){clearInterval(a.keepalive)}},log:function(b,a,k){if(!a){return}try{if(this.url==""){throw"Please specify a valid sitestat url"}var g=["&"+this.label_prefix+"ev="+b,"ns_type=hidden","ns_ts="+new Date().getTime()];if(!this.events[b]){return}var f;for(var h in a){if(ns_API.reservedLabels.test(h)){continue}f=new RegExp(h+"[;|$]?","i");if(((a[h]!=""&&a[h]!="null")||a[h]==0)&&a[h]!=null&&typeof a[h]!="undefined"&&(f.test(this.events[b]))){if(/cu/i.test(h)){g=g.concat(a[h].split("&"))}else{g.push((/jspageurl/i.test(h))?"ns_jspageurl="+escape(a[h]):((k instanceof Function&&k(h)||!new RegExp(h+"[||$]","i").test(this.events[b].join("|")))?"":this.label_prefix)+h+"="+String(escape(a[h]).substring(0,200)))}}}window["ns_img"+this.incLogs]=new Image();window["ns_img"+this.incLogs].src=this.url+g.join("&");if(this.DEVELOPER){if(this.debugLabels){var c=[];for(var i=0;i<g.length;i++){if(this.debugLabels.test(g[i])){c.push(g[i])}}g=c}document.getElementById("debug").innerHTML="<HR>"+g.sort().join("&").replace(/ns_(type|ts)\=[^&]+&/gi,"").replace(/\=(play|pause|end)/gi,"=<font color='blue'>$1</font>").replace(/(dev\-[^\=]+)\=([^&]+)/gi,"<font color='gray'>$1</font>=<b>$2</b>").replace(/(ns_st_[^\=]+)\=([^&]+)/gi,"<font color='red'>$1</font>=<b>$2</b>").substring(1).replace(/&/g,"<br/>")+document.getElementById("debug").innerHTML}this.incLogs++}catch(d){this.throwException(d)}},logIncompatible:function(a){var b=a.getLabelValues.call(a,"play");a.clear();this.log("play",b)},getLabels:function(a){return(this.events[a])?this.events[a]:null},getURL:function(){return this.url},setURL:function(a){this.url=a},register:function(a){this.players.push(a)},_construct:ns_API.addLoadEvent(function(){ns_API.streaming.init.apply(ns_API.streaming)})}}()}ns_API.streaming.playlist=function(){this.entries=[];this.uid=ns_API.streaming.uniqueID();this.sequence=1};ns_API.streaming.playlist.prototype.addEntry=function(a){this.entries.push(a);a.uid=this.uid;a.clip=this.entries.length};ns_API.streaming.playlist.prototype.getTotalValues=function(c){var a=0,b;for(var e=0,d;(d=this.entries[e]);e++){b=/duration/i.test(c)?d.info[c]:d[c];a+=(b=="undefined"||isNaN(parseInt(b))?0:parseInt(b))}return a};ns_API.streaming.playlist.prototype.getTotalPlayingTime=function(){return this.getTotalValues("totalPlayed")};ns_API.streaming.playlist.prototype.getTotalEvents=function(){return this.getTotalValues("events")};ns_API.streaming.playlist.prototype.getPlayListLength=function(){return this.getTotalValues("duration")};ns_API.streaming.playlist.prototype.getTotalBufferTime=function(){var a=0;for(var c=0,b;(b=this.entries[c]);c++){a+=b.getBufferTime()}return a};ns_API.streaming.playlistItem=function(a){a=a||{};this.uid=0;this.sequence=0;this.buffer=[];this.__bufferstart=0;this.currentPosition=0;this.events=0;this.playStart=0;this.totalPlayed=0;this.playTime=0;this.episodeLength=a.episodeLength||0;this.clip=a.clip||1;this.info={date:a.date,duration:(a.duration)?a.duration==""?0:a.duration:0,station:a.station,streamtype:a.streamtype,totalparts:a.totalparts||1,fee:a.fee,part:a.part||1,episode:a.episode||1,program:a.program,custom:a.custom||""};this.playing=false;this.paused=false;this.buffering=false;this.timer=null;this.onPlayingCallback=a.onPlayingCallback};ns_API.streaming.playlistItem.prototype.clear=function(){this.buffer=[];this.events=0;this.playStart=0;this.playTime=0;this.totalPlayed=0};ns_API.streaming.playlistItem.prototype.play=function(a){if(this.buffering){this.bufferEnd()}if(this.playing){return}this.playStart=new Date().getTime();var b=this;this.timer=window.setInterval(function(){try{b.onPlaying.call(b)}catch(c){}},100);this.playing=true;this.paused=false;ns_API.streaming.enableKeepAlive(this)};ns_API.streaming.playlistItem.prototype.pause=function(a){this.events++;this.paused=true;if(this.timer){window.clearInterval(this.timer)}this.playing=false};ns_API.streaming.playlistItem.prototype.end=function(a){if(!this.playing&&this.playing!=null){return}ns_API.streaming.clearKeepAlive(this);if(this.timer){window.clearInterval(this.timer)}this.playing=false;this.paused=false};ns_API.streaming.playlistItem.prototype.onPlaying=function(){if(this.onPlayingCallback instanceof Function){this.currentPosition=this.onPlayingCallback()}};ns_API.streaming.playlistItem.prototype.addPlayingTime=function(){this.totalPlayed+=(new Date().getTime()-this.playStart);this.playStart=new Date().getTime()};ns_API.streaming.playlistItem.prototype.bufferStart=function(a){if(this.playing){this.addPlayingTime();a.dispatchState("end",this);this.playing=false;this.buffering=true}this.__bufferstart=new Date().getTime()};ns_API.streaming.playlistItem.prototype.bufferEnd=function(a){this.buffering=false;if(this.__bufferstart&&parseInt(this.__bufferstart)>0){this.buffer.push(new Date().getTime()-this.__bufferstart)}};ns_API.streaming.playlistItem.prototype.getBufferTime=function(){var a=0;for(var b=0;b<this.buffer.length;b++){a+=parseInt(this.buffer[b])}return a};ns_API.streaming.playlistItem.prototype.getItemInfo=function(a){if(this.info[a]){return this.info[a]}};ns_API.streaming.playlistItem.prototype.setItemInfo=function(a,b){if(typeof b!="undefined"&&b!=""){this.info[a]=b}};ns_API.streaming.player=function(a){this._base=ns_API.streaming;this.ref=a;this.keepalive=null;this.player=null;this.playerVersion="x.x";this.userPlaylist={title:"",clips:[]};this.playLists={};this.playList=null;this.classId=null;this.hasPlaylist=false;this.embedType=null;this.currentItem=null;this.isInitialized=false;this.doPlaylistEndEvent=false;this.doPlaylistStartEvent=true;if(!!arguments.length){this.construct()}};ns_API.streaming.player.prototype.construct=function(){this._base.register(this)};ns_API.streaming.player.prototype.clear=function(){};ns_API.streaming.player.prototype.isCompatible=function(){return true};ns_API.streaming.player.prototype.onInit=function(){this.isInitialized=true;this.player=(typeof this.ref=="string")?((document.getElementById(this.ref)!=null)?document.getElementById(this.ref):(window[this.ref])?window[this.ref]:document[this.ref]):this.ref;if(!ns_API.isIE&&this.player&&!/embed/i.test(this.player.tagName)){this.player=document[this.player.getElementsByTagName("embed")[0].name]}if(!this.player||!this.player.tagName){throw ("DomElement not found")}};ns_API.streaming.player.prototype.clearPlaylist=function(){this.playList=null;this.userPlaylist={title:"",clips:[]};this.playLists={}};ns_API.streaming.player.prototype.getLabelValues=function(a,g){var h={};if(ns_API.streaming.events[a]){var b=ns_API.streaming.events[a];for(var f=0,c;(c=b[f]);f++){if(this["getLabelValue_"+c.toUpperCase()] instanceof Function){try{h[c]=this["getLabelValue_"+c.toUpperCase()]()}catch(d){}}}}return h};ns_API.streaming.player.prototype.dispatchState=function(a,b){if(!b||!b[a] instanceof Function){return}if(b&&b.buffering&&b.bufferEnd instanceof Function){b.bufferEnd()}if(b.playing){b.addPlayingTime()}if((a=="end"&&(b.playing==null)||b.playing||(b.paused&&a!="pause"))||a!="end"){this._base.log(a,this.getLabelValues(a))}b[a].call(b,this);this.doPlaylistStartEvent=false};ns_API.streaming.player.prototype.onOpenStateChange=function(a){if(this["onOpenState_"+this.openStates[a]] instanceof Function){this["onOpenState_"+this.openStates[a]].apply(this,arguments)}};ns_API.streaming.player.prototype.onPlayStateChange=function(a){if(this["onPlayState_"+this.playStates[a]] instanceof Function){this["onPlayState_"+this.playStates[a]].apply(this,arguments)}};ns_API.streaming.player.prototype.onBuffering=function(b){var a=this.getSelectedItem();if(!a){return}a["buffer"+((b)?"Start":"End")](this)};ns_API.streaming.player.prototype.getDurationFromString=function(b){var a=b.split(":"),c=0;for(var d=a.length-1,e=0;d>=0;d--,e++){c+=isNaN(parseInt(a[d]))?0:parseInt(a[d])*(Math.pow(60,e)*1000)}return c};ns_API.streaming.player.prototype.setPlaylistTitle=function(a){this.userPlaylist.title=a};ns_API.streaming.player.prototype.setClipDetails=function(a,d,f,i,g,c,j,b,k,h,e){a=(a&&!isNaN(parseInt(a)))?parseInt(a):1;if(!this.userPlaylist.clips){this.userPlaylist.clips=[]}if(this.userPlaylist.clips.length<a){this.userPlaylist.clips.length=a}this.userPlaylist.clips[a-1]=new this._base.playlistItem({clip:a,duration:d,date:j,station:k,streamtype:h,totalparts:g,part:c,episode:i,program:f,custom:e})};ns_API.streaming.player.prototype.getClipInfo=function(b,c,a,d){if(this.userPlaylist&&this.userPlaylist.clips&&this.userPlaylist.clips[c]){return(d instanceof Function)?d(this.userPlaylist.clips[c].getItemInfo(b)):this.userPlaylist.clips[c].getItemInfo(b)}else{if(a&&a.getItemInfo instanceof Function){return a.getItemInfo(b)}}};ns_API.streaming.player.prototype.getPlaylistClip=function(a){if(this.userPlaylist&&this.userPlaylist.clips&&this.userPlaylist.clips[a]){return this.userPlaylist.clips[a]}};ns_API.streaming.player.prototype.clearClipIncrements=function(b){for(var c=0,a;(a=b.entries[c]);c++){a.clear()}};ns_API.streaming.player.prototype.incrementPlaylist=function(){var a=this.getCurrentPlaylist();this.clearClipIncrements(a);a.sequence++};ns_API.streaming.player.prototype.getCurrentPlaylist=function(){};ns_API.streaming.player.prototype.getLabelValue_PB=function(){return(this.doPlaylistStartEvent)?1:null};ns_API.streaming.player.prototype.getLabelValue_PE=function(){return(this.doPlaylistEndEvent)?1:null};ns_API.streaming.player.prototype.getLabelValue_MP=function(){return this.type};ns_API.streaming.player.prototype.getLabelValue_MV=function(){return this.playerVersion};ns_API.streaming.player.prototype.getLabelValue_SV=function(){return this._base.version};ns_API.streaming.player.prototype.getLabelValue_EL=function(){return this.getSelectedItem().episodeLength};ns_API.streaming.player.prototype.getLabelValue_CN=function(){return this.getSelectedItem().clip};ns_API.streaming.player.prototype.getLabelValue_PT=function(){return this.getSelectedItem().totalPlayed};ns_API.streaming.player.prototype.getLabelValue_PC=function(){return this.getSelectedItem().events};ns_API.streaming.player.prototype.getLabelValue_SQ=function(){var a=this.getSelectedItem();a.sequence=Math.max(1,a.sequence);return a.sequence};ns_API.streaming.player.prototype.getLabelValue_PO=function(){return this.getSelectedItem().currentPosition};ns_API.streaming.player.prototype.getLabelValue_CL=function(){return this.getClipInfo("duration",this.getIndex(),this.getSelectedItem(),this.getDurationFromString)};ns_API.streaming.player.prototype.getLabelValue_BT=function(){return this.getSelectedItem().getBufferTime()};ns_API.streaming.player.prototype.getLabelValue_PR=function(){return this.getClipInfo("program",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_EP=function(){return this.getClipInfo("episode",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_PN=function(){return this.getClipInfo("part",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_DT=function(){return this.getClipInfo("date",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_FEE=function(){return this.getClipInfo("fee",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_TY=function(){return this.getClipInfo("streamtype",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_ST=function(){return this.getClipInfo("station",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_TP=function(){return this.getClipInfo("totalparts",this.getIndex(),this.getSelectedItem())};ns_API.streaming.player.prototype.getLabelValue_ID=function(){return this.getSelectedItem().uid};ns_API.streaming.player.prototype.getLabelValue_SP=function(){return this.getCurrentPlaylist().sequence};ns_API.streaming.player.prototype.getLabelValue_CA=function(){return(this.doPlaylistEndEvent)?this.getCurrentPlaylist().getPlayListLength():null};ns_API.streaming.player.prototype.getLabelValue_BP=function(){return(this.doPlaylistEndEvent)?this.getCurrentPlaylist().getTotalBufferTime():null};ns_API.streaming.player.prototype.getLabelValue_PA=function(){return(this.doPlaylistEndEvent)?this.getCurrentPlaylist().getTotalPlayingTime():null};ns_API.streaming.player.prototype.getLabelValue_PP=function(){return(this.doPlaylistEndEvent)?this.getCurrentPlaylist().getTotalEvents():null};ns_API.streaming.player.prototype.getLabelValue_CP=function(){return this.getCurrentPlaylist().entries.length};ns_API.streaming.player.prototype.getLabelValue_PL=function(){return(this.userPlaylist.title.replace(/\s/g,"")!="")?this.userPlaylist.title:null};ns_API.streaming.player.prototype.getLabelValue_JSPAGEURL=function(){return ns_API.getJSPageURL()};ns_API.streaming.player.prototype.getLabelValue_UB=function(){};ns_API.streaming.player.prototype.getLabelValue_CS=function(){};ns_API.streaming.player.prototype.getLabelValue_BR=function(){};ns_API.streaming.player.prototype.getLabelValue_ER=function(){};ns_API.streaming.player.prototype.getLabelValue_LI=function(){};ns_API.streaming.mediaPlayer=function(){this._super.apply(this,arguments);this.type="MediaPlayer";this.classId=new RegExp(/6BF52A52-394A-11D3-B153-00C04F79FAA6/i);this.embedType="";this.openStates=["undefined","PlaylistChanging","PlaylistLocating","PlaylistConnecting","PlaylistLoading","PlaylistOpening","PlaylistOpenNoMedia","PlaylistChanged","MediaChanging","MediaLocating","MediaConnecting","MediaLoading","MediaOpening","MediaOpen","BeginCodecAcquisition","EndCodecAcquisition","BeginLicenseAcquisition","EndLicenseAcquisition","BeginIndividualization","EndIndividualization","MediaWaiting","OpeningUnknownUrl"];this.playStates=["undefined","Stopped","Paused","Playing","ScanForward","ScanReverse","Buffering","Waiting","MediaEnded","Transitioning","Ready","Reconnecting"]};ns_API.streaming.mediaPlayer.prototype=new ns_API.streaming.player();ns_API.streaming.mediaPlayer.prototype._super=ns_API.streaming.player;ns_API.streaming.mediaPlayer.prototype.constructor=ns_API.streaming.mediaPlayer;ns_API.streaming.mediaPlayer.prototype.onInit=function(){if(this.isInitialized){return}this._super.prototype.onInit.call(this);if(!this.isCompatible()){throw"Internet Explorer needed"}if(!this.classId.test(this.player.classid)){throw"Invalid classid for element\nrequired:"+this.classId.toString()}if(this._base.DEBUG){this.player.settings.mute=true}this.playerVersion=this.player.versionInfo;this.setEventHandlers()};ns_API.streaming.mediaPlayer.prototype.isCompatible=function(){var a=false;try{a=(this.player&&this.player.currentMedia&&this.classId.test(this.player.classid))?true:false}catch(b){}return a};ns_API.streaming.mediaPlayer.prototype.setEventHandlers=function(){var a=this;this.player.SendPlayStateChangeEvents=1;this.player.SendOpenStateChangeEvents=1;this.player.attachEvent("PositionChange",function(){try{a.onPositionChange.apply(a,arguments)}catch(b){}});this.player.attachEvent("PlayStateChange",function(){try{a.onPlayStateChange.apply(a,arguments)}catch(b){}});this.player.attachEvent("OpenStateChange",function(){try{a.onOpenStateChange.apply(a,arguments)}catch(b){}});this.player.attachEvent("buffering",function(){try{a.onBuffering.apply(a,arguments)}catch(b){}})};ns_API.streaming.mediaPlayer.prototype.initPlaylist=function(){var c=this.player.currentPlaylist,e=this;if(!this.playLists[c.name]){this.playLists[c.name]=new this._base.playlist()}for(var d=0,a,b;d<c.count&&(a=c.item(d));d++){if(this.playLists[this.player.currentPlaylist.name].entries[d]){this.playLists[this.player.currentPlaylist.name].entries[d].setItemInfo("duration",this.calculateDuration(a))}else{b=new ns_API.streaming.playlistItem({onPlayingCallback:function(){return Math.floor(e.player.controls.currentPosition)*1000},episodeLength:this.getEpisodeLength(a),clip:d+1,duration:this.calculateDuration(a),date:a.getItemInfo("date"),station:a.getItemInfo("station"),streamtype:a.getItemInfo("streamtype"),totalparts:a.getItemInfo("totalparts"),fee:a.getItemInfo("fee"),part:a.getItemInfo("part"),episode:a.getItemInfo("episode"),program:a.getItemInfo("program"),custom:a.getItemInfo("custom")});b.uid=this.playLists[this.player.currentPlaylist.name].uid;this.playLists[c.name].addEntry(b)}}};ns_API.streaming.mediaPlayer.prototype.getEpisodeLength=function(c){var b=c.getItemInfo("episode");if(b==""){return this.calculateDuration(c)}var a=0;for(var e=0,d;e<this.player.currentPlaylist.count&&(d=this.player.currentPlaylist.item(e));e++){if(d.getItemInfo("episode")==b){a+=this.calculateDuration(d)}}return(a==0)?null:a};ns_API.streaming.mediaPlayer.prototype.calculateDuration=function(a){if(!a){return 0}else{return parseFloat((a.getItemInfo("Duration")=="")?0:a.getItemInfo("Duration").replace(",","."))*1000}};ns_API.streaming.mediaPlayer.prototype.getLabelValue_UB=function(){return this.player.network.bandWidth};ns_API.streaming.mediaPlayer.prototype.getLabelValue_PL=function(){if(this.userPlaylist.title.replace(/\s/g,"")!=""){return this.userPlaylist.title}else{var a=this.player.currentPlaylist.getItemInfo("playlist");try{return(/^\s*$/.test(a))?null:a}catch(b){}}};ns_API.streaming.mediaPlayer.prototype.getLabelValue_CS=function(){try{return String(this.player.currentMedia.imageSourceWidth+"x"+String(this.player.currentMedia.imageSourceHeight))}catch(a){}};ns_API.streaming.mediaPlayer.prototype.getLabelValue_BR=function(){try{return this.player.currentMedia.getItemInfo("Bitrate")}catch(a){}};ns_API.streaming.mediaPlayer.prototype.getLabelValue_ER=function(){return(this.player&&this.player.currentMedia&&this.player.currentMedia.error)?this.player.currentMedia.error.errorDescription:null};ns_API.streaming.mediaPlayer.prototype.onPositionChange=function(){this.getSelectedItem().currentPosition=Math.floor(this.player.controls.currentPosition*1000)};ns_API.streaming.mediaPlayer.prototype.onPlayStateChange=function(a){if(a==1){this.doPlaylistEndEvent=true}this._base.player.prototype.onPlayStateChange.apply(this,arguments)};ns_API.streaming.mediaPlayer.prototype.getSelectedItem=function(){try{var f=this.player.currentPlaylist;var b=this.playLists[f.name];if(!b){this.initPlaylist()}b=this.playLists[f.name];for(var c=0,a;c<f.count&&(a=f.item(c));c++){if(this.player.currentMedia.isIdentical(a)){return b.entries[c]}}}catch(d){return this.currentItem}};ns_API.streaming.mediaPlayer.prototype.getIndex=function(){try{var f=this.player.currentPlaylist,b=this.playLists[f.name];if(!b){this.initPlaylist()}b=this.playLists[f.name];for(var c=0,a;c<f.count&&(a=f.item(c));c++){if(this.player.currentMedia.isIdentical(a)){return c}}}catch(d){return 0}};ns_API.streaming.mediaPlayer.prototype.getCurrentPlaylist=function(){try{return this.playLists[this.player.currentPlaylist.name]}catch(a){}};ns_API.streaming.mediaPlayer.prototype.onPlayState_Playing=function(){this.getSelectedItem().currentPosition=Math.floor(this.player.controls.currentPosition*1000);this.dispatchState("play",this.getSelectedItem())};ns_API.streaming.mediaPlayer.prototype.onPlayState_Paused=function(){this.dispatchState("pause",this.getSelectedItem())};ns_API.streaming.mediaPlayer.prototype.onPlayState_Stopped=function(){var a=this.getSelectedItem();this.doPlaylistEndEvent=true;this.dispatchState("end",a);this.incrementPlaylist();this.doPlaylistEndEvent=false;this.doPlaylistStartEvent=true};ns_API.streaming.mediaPlayer.prototype.onOpenState_MediaChanging=function(){this.setEndEventState(this.currentItem);this.dispatchState("end",this.currentItem)};ns_API.streaming.mediaPlayer.prototype.setEndEventState=function(a){if(a.clip==this.getCurrentPlaylist().entries.length){this.doPlaylistEndEvent=true}};ns_API.streaming.mediaPlayer.prototype.onPlayState_MediaEnded=function(){var a=this.getSelectedItem();this.setEndEventState(a);this.dispatchState("end",a);if(this.doPlaylistEndEvent){this.incrementPlaylist()}};ns_API.streaming.mediaPlayer.prototype.onOpenState_MediaOpen=function(){this.initPlaylist();var a=this.getSelectedItem();a.sequence++;this.currentItem=a;this.doPlaylistEndEvent=false;a.events=0;a.totalPlayed=0;a.playing=null;a.buffering=false;if(a.clip==1){this.doPlaylistStartEvent=true}};ns_API.streaming.realPlayer=function(){this.version="1.0.0";this._super.apply(this,arguments);this.type="RealPlayer";this.playStates=["Stopped","Contacting","Buffering","Playing","Paused","Seeking"];this.classId=new RegExp(/CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA/i);this.embedType="";this.realTag="object";this.bufferState=-1;this.doClipEndEvent=false};ns_API.streaming.realPlayer.prototype=new ns_API.streaming.player;ns_API.streaming.realPlayer.prototype._super=ns_API.streaming.player;ns_API.streaming.realPlayer.prototype.constructor=ns_API.streaming.realPlayer;ns_API.streaming.realPlayer.prototype.onInit=function(){if(this.isInitialized){return}this._super.prototype.onInit.call(this);try{if(!this.classId.test(this.player.classid)){throw"Invalid classid for element\nrequired:"+this.classId.toString()}this.realTag="object"}catch(a){this.realTag="embed"}this.setEventHandlers()};ns_API.streaming.realPlayer.prototype.clear=function(){if(this.player){this.player.removeAttribute("SCRIPTCALLBACKS");this.player.removeAttribute("scriptcallbacks")}};ns_API.streaming.realPlayer.prototype.isCompatible=function(){var a=false;try{var b=this.player.GetVersionInfo();a=true}catch(c){}return a};ns_API.streaming.realPlayer.prototype.setEventHandlers=function(){try{var f=this;if(/object/i.test(this.realTag)&&ns_API.isIE){if(ns_API.isIE7){var d;var b=function(){var g=f.player.GetPlayState();if(g!=d){try{if(/seeking/i.test(f.playStates[g])){f.onClipClosed.call(f)}else{if(/buffering/i.test(f.playStates[g])){f.onBuffering.call(f,0)}else{if(/contacting/i.test(f.playStates[g])){f.onClipOpened.call(f)}else{if(/buffering/i.test(f.playStates[d])){f.onBuffering.call(f,2)}if(f.currentItem&&f.currentItem!=f.getSelectedItem()){f.onClipClosed.call(f)}if(!f.getSelectedItem().isOpened){f.onClipOpened.call(f)}f.onPlayStateChange.call(f,g)}}}}catch(h){}}d=f.player.GetPlayState()};setInterval(b,50)}else{this.player.attachEvent("onPostSeek",function(){try{f.onPostSeek.apply(f,arguments)}catch(g){}});this.player.attachEvent("onClipOpened",function(){try{f.onClipOpened.apply(f,arguments)}catch(g){}});this.player.attachEvent("onBuffering",function(){try{f.onBuffering.apply(f,arguments)}catch(g){}});this.player.attachEvent("onPlayStateChange",function(){try{f.onPlayStateChange.apply(f,arguments)}catch(g){}});this.player.attachEvent("onClipClosed",function(){try{f.onClipClosed.apply(f,arguments)}catch(g){}})}}else{var a=this.player.getAttribute("name");window[a+"_onPostSeek"]=function(){try{f.onPostSeek.apply(f,arguments)}catch(g){}};window[a+"_OnBuffering"]=function(){try{f.onBuffering.apply(f,arguments)}catch(g){}};window[a+"_OnPlayStateChange"]=function(){try{f.onPlayStateChange.call(f,arguments[1])}catch(g){}};window[a+"_onClipOpened"]=function(){try{f.onClipOpened.apply(f,arguments)}catch(g){}};window[a+"_onClipClosed"]=function(){try{f.onClipClosed.apply(f,arguments)}catch(g){}}}ns_API.addEvent(window,"beforeunload",function(){try{f._base.clearKeepAlive();f.onClipClosed.apply(f)}catch(g){}})}catch(c){throw c.message||c}};ns_API.streaming.realPlayer.prototype.initPlayList=function(){if(!this.playList){this.playList=new this._base.playlist();this.doPlaylistStartEvent=true}else{if(this.playList&&this.playList.entries>0&&this.playList.entries.length==this.player.GetNumEntries()){return}}var c=this;for(var b=0;b<this.player.GetNumEntries();b++){if(!this.playList.entries[b]){var a=new ns_API.streaming.playlistItem({onPlayingCallback:function(){return function(){return(this.getSelectedItem()==this.currentItem)?this.player.GetPosition():this.currentItem.currentPosition}.apply(c)},episodeLength:0,clip:b+1,duration:0});a.uid=this.playList.uid;a.sequence=0;this.playList.addEntry(a)}}};ns_API.streaming.realPlayer.prototype.getSelectedItem=function(){this.initPlayList();try{try{if(/stopped/i.test(this.playStates[this.player.GetPlayState()])||this.doClipEndEvent){return(this.currentItem)?this.currentItem:this.playList.entries[this.player.GetCurrentEntry()]}}catch(a){}return this.playList.entries[this.player.GetCurrentEntry()]}catch(a){return null}};ns_API.streaming.realPlayer.prototype.getIndex=function(){try{return this.currentItem.clip-1}catch(a){return 0}};ns_API.streaming.realPlayer.prototype.getCurrentPlaylist=function(){return this.playList};ns_API.streaming.realPlayer.prototype.onPostSeek=function(){if(this.player.GetPosition()==this.player.GetLength()){this.dispatchState("end",this.getSelectedItem())}this.getSelectedItem().currentPosition=this.player.GetPosition()};ns_API.streaming.realPlayer.prototype.onPlayStateChange=function(a){var b=this.getSelectedItem();if(this.playStates[a]&&/stopped/i.test(this.playStates[a])){var b=this.getSelectedItem();this.doPlaylistEndEvent=true;if(b){b.sequence++}}this._base.player.prototype.onPlayStateChange.apply(this,arguments);if(this.playStates[a]&&/playing/i.test(this.playStates[a])){this.doPlaylistStartEvent=false}};ns_API.streaming.realPlayer.prototype.onPlayState_Playing=function(){var a=this.getSelectedItem();if(!a){return}if(!a.isOpened){this.onClipOpened()}this.doClipEndEvent=false;if(this.currentItem!=a&&this.currentItem&&this.currentItem.playing){this.doClipEndEvent=true;this.dispatchState("end",this.currentItem)}else{this.doClipEvent=false}this.currentItem=a;if(this.player.GetPosition()==this.player.GetLength()&&!this.player.GetLiveState()){return}this.playerVersion=(this.player.GetVersionInfo().replace(/\s/g,"")!="")?this.player.GetVersionInfo():this.playerVersion;this.dispatchState("play",a)};ns_API.streaming.realPlayer.prototype.onPlayState_Stopped=function(){var a=this.getSelectedItem();if(!a){return}this.doPlaylistEndEvent=true;this.doPlaylistStartEvent=true;this.doClipEndEvent=true;this.dispatchState("end",a);a.isOpened=false;this.incrementPlaylist();this.doPlaylistEndEvent=false};ns_API.streaming.realPlayer.prototype.onPlayState_Paused=function(){this.dispatchState("pause",this.getSelectedItem())};ns_API.streaming.realPlayer.prototype.onClipOpened=function(){if(this._base.DEBUG){this.player.SetMute(true)}var a=this.getSelectedItem();if(!a){return}a.isOpened=true;this.doPlaylistStartEvent=(this.doClipEndEvent||this.doPlayListStartEvent||(!this.currentItem||(this.currentItem.clip!=a.clip&&a.clip==1)))?true:false;if(a!=this.currentItem){a.sequence++}this.doClipEndEvent=false;a.currentPosition=0;a.playing=false;a.events=0;a.bufferState=-1;a.buffering=false};ns_API.streaming.realPlayer.prototype.onClipClosed=function(){this.doClipEndEvent=true;this.currentItem.isOpened=false;this.dispatchState("end",this.currentItem)};ns_API.streaming.realPlayer.prototype.onPlayState_Buffering=function(){var a=this.getSelectedItem();this._base.player.prototype.onBuffering.call(this,true)};ns_API.streaming.realPlayer.prototype.onBuffering=function(a){var b=this.getSelectedItem();if(!b){return}if(a!=this.bufferState){this.bufferState=a;this._base.player.prototype.onBuffering.call(this,(a==0)?true:false)}};ns_API.streaming.realPlayer.prototype.setBitrate=function(b,a){b=parseInt(b);if(isNaN(b)){return}if(this.userPlaylist&&this.userPlaylist.clips[b-1]){this.userPlaylist.clips[b-1].setItemInfo("bitrate",a)}};ns_API.streaming.realPlayer.prototype.getLabelValue_CA=function(){var d=this.getCurrentPlaylist();if(!d){return}var a=0;for(var e=0,b,c;(c=d.entries[e]);e++){b=c.info["duration"];a+=(b=="undefined"||isNaN(parseInt(b))?0:parseInt(b));if(b==0){b=this.getClipInfo("duration",e,null,this.getDurationFromString);a+=(b=="undefined"||isNaN(parseInt(b))?0:parseInt(b))}}return a};ns_API.streaming.realPlayer.prototype.getLabelValue_LI=function(){return this.player.GetLiveState()};ns_API.streaming.realPlayer.prototype.getLabelValue_UB=function(){return this.player.GetBandwidthAverage()};ns_API.streaming.realPlayer.prototype.getLabelValue_CS=function(){return String(this.player.GetClipWidth()+"x"+String(this.player.GetClipHeight()))};ns_API.streaming.realPlayer.prototype.getLabelValue_BR=function(){return this.getClipInfo("bitrate",this.getIndex(),this.getSelectedItem())};ns_API.streaming.realPlayer.prototype.getLabelValue_ER=function(){return(this.player.GetLastErrorUserString()!="")?this.player.GetLastErrorUserString():null};ns_API.streaming.realPlayer.prototype.getEpisodeLength=function(c){var b=c.getItemInfo("episode"),a=0;if(b==""){return c.getItemInfo("duration")}for(var e=0,d;(d=this.playList.entries[0]);e++){if(d.getItemInfo("episode")==b){a+=d.getItemInfo("duration")}}return(a==0)?null:a};ns_API.streaming.exceptions={};ns_API.streaming.exceptions.ReservedLabelException=function(){return{message:"Label is reserved."}};ns_API.streaming.exceptions.InvalidLabelException=function(){return{message:"Label format is invalid."}};ns_API.streaming.exceptions.ReservedEventException=function(){return{message:"Event is reserved."}};ns_API.streaming.eventRegExp=function(){return{play:new RegExp(ns_API.streaming.events.play.join("|"),"i"),pause:new RegExp(ns_API.streaming.events.pause.join("|"),"i"),end:new RegExp(ns_API.streaming.events.end.join("|"),"i")}}();ns_API.streaming.player.prototype.addEndEventLabel=function(c,a){if(this._base.eventRegExp.end.test(c)){if(this._base.DEBUG){throw new this._base.exceptions.ReservedLabelException}else{return}}if(!/^[a-z]{1,50}$/i.test(c)){if(this._base.DEBUG){throw new this._base.exceptions.InvalidLabelException}else{return}}var b=new RegExp(this._base.events.end.join("|"),"i");if(!b.test(c)){this._base.events.end.push(c)}var d=a;this["getLabelValue_"+c.toUpperCase()]=function(){return(this.doPlaylistEndEvent)?(d instanceof Function)?d():d:null}};ns_API.streaming.player.prototype.resetEndEventLabels=function(){this._base.events.end=this._base.eventRegExp.end.source.split("|")};ns_API.streaming.player.prototype.dispatchEvent=function(d,c){d=d||new String();c=c||new String();if(/^\s*(play|pause|end|keep-alive)\s*$/i.test(d)){if(this._base.DEBUG){throw new this._base.exceptions.ReservedEventException}else{return}}this._base.events[d]=this._base.eventRegExp.pause.source.split("|");var b=this.getLabelValues(d)||{},e=c.split(";");var h=new RegExp(/([^\=]+)(?:\=([^&]+))?/i);for(var a=0,g,f;(g=e[a]);a++){f=h.exec(g);if(!f){continue}if(ns_API.reservedLabels.test(f[1])){if(this._base.DEBUG){throw new this._base.exceptions.InvalidLabelException}else{continue}}this._base.events[d].push(f[1]);b[f[1]]=f[2]}this._base.log(d,b,function(i){return !ns_API.streaming.eventRegExp.pause.test(i)});delete this._base.events[d]};
