var PPLiveActiveX=function(e){var q=false,f=false,a=false;var g="100%",B="100%";var d=null,b="",u="";function k(){}var o=e.ready?e.ready:k;var l=e.boot?e.boot:k;var i=e.installing?e.installing:k;var w=e.notSupport?e.notSupport:k;var j=e.checkInterval?e.checkInterval:3000;var m=e.readyInterval?e.readyInterval:200;var t=e.checkVersion?e.checkVersion:k;var A=e.notInstall?e.notInstall:k;var y=function(){this.initSettings={};this.set=function(p,D){this.initSettings[p]=D;return this};this.setProperties=function(D){for(var E in D){this.set(E,D[E])}};this.get=function(D){var p=this.initSettings[D];p=p?p:"";return p}};var r=new y();r.setProperties({id:"PPLivePlayerActiveX",width:"1px",height:"1px",codebase:"http://dl.pplive.com/PluginSetup.cab"});var n=new y();n.setProperties({logourl:"http://static1.pplive.cn/ikan3/090512/player/playerbg.jpg",logoposition:"center",dbclicktofullscreen:true,showcontextmenu:true,showstateinfo:true,showchannelname:true,showplayerbuffer:true,showdownloadbuffer:true,showdownloadrate:true,showplaycontroller:true,showplayprogress:true,showloadingad:false,showadcountdown:false,adcfgurl:"",enableupdate:"true",enableupdatetip:"true",updateurl:"",url:"",forceversion:"2.3.6.0007",skinpath:"skins\\Default"});if(e!=null){var c=e.properties;for(var s in c){switch(s.toLowerCase()){case"id":r.set("id",c[s]);case"width":g=c[s];break;case"height":B=c[s];break;case"codebase":r.set("codebase",c[s]);break;default:s=s.toLowerCase();n.set(s,c[s]);break}}var z=e.params;for(var s in z){n.set(s.toLowerCase(),z[s])}}this.setAttribute=function(p,D){r.set(p.toLowerCase(),D);return this};this.setAttributes=function(D){for(var p in D){r.set(p.toLowerCase(),D[p])}return this};this.setParam=function(p,D){n.set(p.toLowerCase(),D);return this};this.setParams=function(E){for(var D in E){n.set(D.toLowerCase(),E[D])}return this};function C(){var E=['<object classid="CLSID:ef0d1a14-1033-41a2-a589-240c01edc078"'];for(var D in r.initSettings){E.push([" ",D,'="',r.get(D),'"'].join(""))}E.push(">");for(var F in n.initSettings){E.push(['<param name="',F,'" value="',n.get(F),'">'].join(""))}E.push("</object>");return E.join("")}this.write=function(p){if(typeof(p)=="string"){d=document.getElementById(p)}else{d=p}if(navigator.userAgent.search("MSIE")<=0){d.innerHTML="<p>对不起，目前PPLive网页插件（98KB）暂不支持Firefox、Opera等浏览器，请使用IE观看，谢谢^_^</p>";w();return}u=d.innerHTML;b=C();d.innerHTML=b;v();return this};this.getPlayer=function(){return _player};function v(){_player=document.getElementById(r.get("id"));if((_player||0).IsReady!=undefined){this.installed=true;while(d.children.length>1){var p=d.removeChild(d.children[0]);delete p}_player.style.width=g;_player.style.height=B;t(_player.version);h()}else{if(!f){d.innerHTML=u+b;f=true;A()}setTimeout(v,j)}}function h(){if(_player.IsReady){try{_player.onFrameInstall=null}catch(p){}o(_player)}else{if(_player.IsReady!=undefined&&!a){_player.onFrameInstall=x;a=true;l(_player);setTimeout(h,m)}else{setTimeout(h,m)}}}function x(p,D){try{i(p,D)}catch(E){}}return this};(function(){function f(){var g=['<div class="err_setup">','<div style="height: 200px;"></div>','<p class="txt1">正在下载网页播放插件，请稍候... <span id="ikanpluginsetup_label_num">0</span>%</p>','<p class="txt2"><span style="width: 0%;" id="ikanpluginsetup_span_num"></span></p>','<p class="txt3">小提示：如果安装程序被杀毒软件阻止，请您解除阻止。</p>',"</div>",];return g.join("")}function c(g){this.events=[];this.name=g}c.prototype={fire:function(){var h=[];for(var j=0;j<arguments.length;j++){h.push(arguments[j])}for(var j=0,g=this.events.length;j<g;j++){var k=this.events[j];k[0].call(k[1],this.name,h)}},subscribe:function(h,g){this.events.push([h,g])},clear:function(){this.events=[]}};function e(h,g){for(var i in h){if(typeof g[i]!="undefined"){h[i]=g[i]}}}function d(g){return document.getElementById(g)}var b=15;var a={ops:{ggUrl:""},playInfo:{},ggTimer:null,player:null,playState:0,loadGG:false,setPlayInfo:function(g){this.playInfo=g.length>0?g[0]:{title:"未知节目",link:""}},readyHandler:function(g){a.ctlel.style.display="";a.otel.style.display="none";a.ppel.style.width=480+"px";a.ppel.style.height=360+"px";a.player=g;a.player.onPlayStateChanged=a.playHandler;a.player.Url=a.playInfo.link;a.title.innerHTML=a.playInfo.title;a.showGG()},playHandler:function(g){if(g==2){if(!a.loadGG){a.player.Pause();a.loadGG=true}a.btn_play2pause.className="btn3_1"}else{a.btn_play2pause.className="btn7_1"}},bootHandler:function(g){a.otel.innerHTML=f()},installingHandler:function(g,h){try{if(g!=1){h=100}d("ikanpluginsetup_label_num").innerHTML=h;d("ikanpluginsetup_span_num").style.width=h+"%"}catch(i){}if(g==3){a.otel.style.display="none";a.ppel.style.width=480+"px";a.ppel.style.height=360+"px"}},notSupportHandler:function(){var g='<p style="text-align:center;padding-top:140px;color: #fff;"><img alt="PPTV" src="http://static1.pplive.cn/ikan3/100519/images/pptv32.gif"><span style="font-size: 18px; line-height: 32px; vertical-align: top;">该浏览器暂不支持PPTV播放器。</span><br><br><span style="font-size: 12px;">您可以打开IE浏览器或安装 PPTV 客户端软件观看。</span><br><br><a style="color:#ffcc00; font-weight: bold;" href="http://jump.pplive.com.cn/pptvsetup_self.exe">下载PPTV客户端</a></p>';a.otel.innerHTML=g},initIkanPlugin:function(){(new PPLiveActiveX({properties:{id:"pplive_ikan_player",width:"100%",height:"100%",codebase:"http://upexe.pplive.com/config/pplite/pluginsetup.cab"},params:{logourl:"http://static1.pplive.cn/ikan3/100519/images/live_bg.jpg",logoposition:"center",dbclicktofullscreen:"true",showcontextmenu:"true",showstateinfo:"true",showchannelname:"true",showplayerbuffer:"true",showdownloadbuffer:"true",showdownloadrate:"true",showplaycontroller:"false",showplayprogress:"true",showloadingad:"false",showadcountdown:"false",adcfgurl:"",enableupdate:"true",enableupdatetip:"true",updateurl:"",forceversion:"1.0.0.51",skinpath:"skins\\Default",type:"1"},ready:this.readyHandler,boot:this.bootHandler,installing:this.installingHandler,notSupport:this.notSupportHandler,checkInterval:3000})).write(this.ppel)},init:function(g){e(this.ops,g);this.playboxel=d("playbox");this.ppel=d("playbox_pp");this.otel=d("playbox_ot");this.ctlel=d("playbox_ctl");this.btn_stop=d("playbox_btn_stop");this.btn_play2pause=d("playbox_btn_play2pause");this.ggel=d("playbox_gg");this.ggifm=d("playbox_gg_iframe");this.ggbar=d("playbox_gg_topbar");this.title=d("playbox_title");this.initIkanPlugin();this.bindEvent()},bindEvent:function(){d("playbox_btn_full").onclick=function(){this.blur();a.player.FullScreen=true;return false};this.btn_stop.onclick=function(){this.blur();a.player.Stop();return false};this.btn_play2pause.onclick=function(){this.blur();if(this.className=="btn3_1"){a.player.Pause()}else{a.player.Play()}return false}},showPP:function(){this.ggel.style.display="none";var g=d("pplive_ikan_player");g.style.width="100%";g.style.height="100%"},showGG:function(){var j=d("pplive_ikan_player");j.style.width=1+"px";j.style.height=1+"px";this.ggel.style.display="block";this.ggifm.src=this.ops.ggUrl+"?v="+Math.floor(Math.random()*100);clearInterval(this.ggTimer);var h=" 秒后精彩节目即将开始";var g="正在播放 : "+this.playInfo.title+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";this.ggbar.innerHTML=g+b+h;var i=new Date().getTime();this.ggTimer=setInterval(function(){var k=a.player.BufferingProgress;var l=Math.max(0,b-Math.floor((new Date().getTime()-i)/1000));if(l==0&&k!=100){a.ggbar.innerHTML=g+"节目缓冲中("+k+"%)"}else{a.ggbar.innerHTML=g+l+h}if(l==0&&k==100&&a.loadGG){clearInterval(a.ggTimer);a.showPP();a.player.Play();a.ggifm.src="about:blank"}},1000)}};window.IkanPlayerOCX=a})();