📄 bd_adv.js
字号:
var MAX_COUNT=15;var MAX_LOAD_COUNT=5;var SWITCH_INTERVAL=20000;var showcount=0;var dispcount=0;var arrBaiduAds=new Array();arrBaiduAds[18]="";var hasAds=false;var iLoadCount=0;var csong=$d('song').innerHTML;var csinger=$d('singer').innerHTML;var ad_script_div=$d('ad_script_div');var ad_script=null;var ad2_script=null;var createAdTimeout=0;var first_song=csong+"_"+csinger;var using_ad2=false;var guangGao="http://masrch.baidu.com:8080/ecom?di=18&tm=baidufsbanner&word=";var guangGao2="http://masrch.baidu.com:8080/ecom?di=106,107&tm=baidufslink,baidufsbanner&word=";function $d(s){return document.getElementById(s)};function loadAd(){if(iLoadCount>=MAX_LOAD_COUNT){showAd("");return}iLoadCount++;if(ad_script.readyState=="loaded"||isFF){if(typeof(arrBaiduAds[18])!="undefined"&&arrBaiduAds[18]!=""){arrBaiduAds[18]=arrBaiduAds[18].replace(/(^\s*)|(\s*$)/g,"");if(arrBaiduAds[18].split("<embed").length>1)arrBaiduAds[18]="<embed wmode='Opaque' "+arrBaiduAds[18].split("<embed")[1];hasAds=true;showcount++;if(showcount<=MAX_COUNT){if(createAdTimeout!=0){clearTimeout(createAdTimeout);createAdTimeout=0}createAdTimeout=setTimeout(createAd,SWITCH_INTERVAL)}showAd(arrBaiduAds[18])}else{hasAds=false;hideLeftAd();if(is_ext_mb){try{try_iframe.showLeftCheck("all")}catch(err){}}}}};function createAd(){dispcount++;if(dispcount>MAX_COUNT){return};if(ad_script==null)ad_script=document.createElement("script");else{try{ad_script_div.removeChild(ad_script)}catch(err){hasAds=false};ad_script=document.createElement("script")}if(isFF)ad_script.onload=loadAd;else ad_script.onreadystatechange=loadAd;if(csong!=""&&csinger!=""){ad_script.src=guangGao+csong+"??"+csinger+"&t="+Math.random()*(new Date()).getMilliseconds();ad_script_div.appendChild(ad_script);iLoadCount=0}else{hasAds=false}};var playingsong="";function mainTimeOut(){csong=$d('song').innerHTML;csinger=$d('singer').innerHTML;var songinfo=csong+"_"+csinger;if(playingsong==songinfo)return;if(createAdTimeout!=0){clearTimeout(createAdTimeout);createAdTimeout=0}var playing=false;if(!isFF){try{var p=$d("MediaPlayer1");if(isMH){if(((p.PlayState==3)||(p.PlayState==6)||(p.PlayState==2))&&((p.OpenState==13))){playing=true}}else{if(((p.PlayState==3)||(p.PlayState==2)||(p.PlayState==1))&&((p.OpenState==6))){playing=true}}}catch(err){};try{var player=$d("RealPlayer1");if((player.GetPlayState()==2)||(player.GetPlayState()==3)||(player.GetPlayState()==4)){playing=true}}catch(err){}}else{playing=true}if(!playing){hideLeftAd();if(is_ext_mb){try{try_iframe.showLeftCheck("all")}catch(oException){}}else{try{try_iframe.showLeftCheck("all")}catch(oException){}}if(using_ad2){hideAd2()}else if(songinfo!=first_song){hideAd2()}return}playingsong=songinfo;try{hideLeftAd();if(is_ext_mb){try_iframe.showLeftCheck("all")}showcount=0;dispcount=0;createAd();if(using_ad2){hideAd2()}else if(songinfo!=first_song){hideAd2()}if(first_song!=playingsong&&using_ad2==false)using_ad2=true;if(using_ad2)createAd2()}catch(oException){}};var showingsong="";function showAd(adStr){if(adStr==""){$d("LrcShower_div").style.display="inline";$d("lrctellall_div").style.display="none";$d('lrctellall_div').innerHTML="";return}try{if(is_ext_mb){if(!try_iframe.isOp()){showLeftAd(adStr);try_iframe.showLeftCheck("top")}}else if(!hasLrc||isFF){hideLeftAd();$d('leftAd_div').innerHTML=adStr;$d("LrcShower_div").style.display="none";$d("lrctellall_div").style.display="inline";$d('lrctellall_div').innerHTML=adStr;var arrowright_div=$d("arrowright_div");arrowright_div.className="aw";arrowright_div.title=txtEp;if(showingsong!=playingsong){showingsong=playingsong;window.moveTo((screen.width-399)/2,0);if(isFF)window.resizeTo(384,550);else{window.resizeTo(399+woffset,600)}}}else{$d("rightIfrm_div").style.display="inline";if(showingsong!=playingsong){showingsong=playingsong;if(screen.width>800)window.moveTo(100,0);else window.moveTo(0,0);window.resizeTo(810+woffset,600)}showLeftAd(adStr);$d("arrowright_div").style.marginLeft="420px"}}catch(oException){}};function showLeftAd(adStr){if(arguments.length==0)adStr=arrBaiduAds[18];var mi=$d('try_iframe');mi.style.height="225px";if(is_ext_mb)$d("leftAd_div").style.marginTop="5px";else $d("leftAd_div").style.marginTop="230px";$d("leftAd_div").style.display="";$d('leftAd_div').innerHTML=adStr};function hideLeftAd(){var mi=$d('try_iframe');mi.style.height="520px";$d("leftAd_div").style.display="none";$d('leftAd_div').innerHTML="";if(hasAds){if(!is_ext_mb&&(rightIfrm_div.style.display=="inline")){$d("Lrc_div").style.marginLeft="8";$d("rightIfrm_div").style.display="none";$d("arrowright_div").style.marginLeft="0px";window.moveTo((screen.width-399)/2,0);window.resizeTo(399+woffset,600)}}};var mainInterval=setInterval(mainTimeOut,3000);function showAdRight(adStr){$d("Blrc").style.display="none";$d("LrcShower_div").style.display="none";$d("lrctellall_div").style.display="inline";$d('lrctellall_div').innerHTML=adStr};function showAd2(s106,s107){$d('adtb').style.display="block";$d('LrcShower_div').style.height="266px";$d('ad1').innerHTML=s107;$d('ad2').innerHTML=s106};function hideAd2(){$d('ad1').innerHTML="";$d('ad2').innerHTML="";$d('adtb').style.display="none";$d('LrcShower_div').style.height="276px"};function createAd2(){if(ad2_script==null)ad2_script=document.createElement("script");else{try{ad_script_div.removeChild(ad2_script)}catch(err){};ad2_script=document.createElement("script")}if(isFF)ad2_script.onload=loadAd2;else ad2_script.onreadystatechange=loadAd2;if(csong!=""&&csinger!=""){ad2_script.src=guangGao2+csong+"??"+csinger+"&t="+Math.random()*(new Date()).getMilliseconds();ad_script_div.appendChild(ad2_script)}else{}};function loadAd2(){if(ad2_script.readyState=="loaded"){if((typeof(arrBaiduAds[106])!="undefined"&&arrBaiduAds[106]!="")||(typeof(arrBaiduAds[107])!="undefined"&&arrBaiduAds[107]!="")){arrBaiduAds[107]=arrBaiduAds[107].replace(/(^\s*)|(\s*$)/g,"");if(arrBaiduAds[107].split("<embed").length>1)arrBaiduAds[107]="<embed wmode='Opaque' "+arrBaiduAds[107].split("<embed")[1];showAd2(arrBaiduAds[106],arrBaiduAds[107])}else{hideAd2()}}};var samplingEnable=true;var ratio=10;var player=null;var sitebase="http://box.baidu.com/";function Sampling(){this.songURL="";this.songLen=0;this.beginTime=-1;this.pageTime=0;this.playTime=0;this.opFlag=0;this.pState=0;this.oState=0;this.closeFlag=0;this.isGet=0;this.isSend=0;this.spend=0;this.runInterval=0;this.bSampling=false;this.latestPos=0;this.bandWidth=0;this.bufferingCount=0;this.receivedPackets=0;this.downloadProgress=0;this.bufferingProgress=0;this.bitrate=0;this.cached=0;this.buffstart=0;this.buffstop=0;this.hasDone=0;Sampling.prototype.startRun=function(){if(!samplingEnable){return}if(search_location.indexOf("gate=1")==-1){return}this.bSampling=this.decision();if(this.bSampling==false){return}if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){return}player=window.document.getElementById("MediaPlayer1");if(player==null){return}if(!isMH)return;this.songURL=window.document.getElementById("song_url");img.src=sitebase+"status/attend.gif";this.runInterval=setInterval(this.runTime,1000)};Sampling.prototype.stopRun=function(){if(sampling.runInterval!=0){try{clearInterval(sampling.runInterval)}catch(err){}}sampling.runInterval=0};Sampling.prototype.decision=function(){var n=parseInt(Math.random()*ratio);return n==1};Sampling.prototype.get=function(){sampling.isGet=1;try{if(isLoadIf)return}catch(err){}try{sampling.songLen=Math.round(player.currentMedia.duration)}catch(err){sampling.songLen=0}sampling.pageTime=sampling.spend;try{sampling.playTime=Math.round(player.controls.currentPosition)}catch(err){sampling.playTime=0}try{sampling.pState=player.playState}catch(err){sampling.pState=0}try{sampling.oState=player.openState}catch(err){sampling.oState=0}try{sampling.bandWidth=player.network.Bandwidth}catch(err){sampling.bandWidth=0}try{sampling.bufferingCount=player.network.bufferingCount}catch(err){sampling.bufferingCount=0}try{sampling.receivedPackets=player.network.receivedPackets}catch(err){sampling.receivedPackets=0}try{sampling.downloadProgress=player.network.downloadProgress}catch(err){sampling.downloadProgress=0}try{sampling.bufferingProgress=player.network.bufferingProgress}catch(err){sampling.bufferingProgress=0}try{sampling.bitrate=player.currentMedia.getItemInfo("Bitrate")}catch(err){sampling.bitrate=0}};Sampling.prototype.send=function(){sampling.isSend=1;try{if(isLoadIf)return}catch(err){}if(!sampling.isGet){sampling.get()};var sget=sitebase+"status/song.gif?len="+sampling.songLen+"&begin="+sampling.beginTime+"&page="+sampling.pageTime+"&play="+sampling.playTime+"&pstat="+sampling.pState+"&ostat="+sampling.oState+"&op="+sampling.opFlag+"&close="+sampling.closeFlag+"&url="+sampling.songURL+"&bandw="+sampling.bandWidth+"&bufc="+sampling.bufferingCount+"&rcvp="+sampling.receivedPackets+"&downp="+sampling.downloadProgress+"&bufp="+sampling.bufferingProgress+"&bitrate="+sampling.bitrate+"&cached="+sampling.cached;img.src=sget;var i=0;for(i=0;i<10000;i++){}};Sampling.prototype.closeWindow=function(){if(sampling.isSend==1)return;sampling.closeFlag=1;try{sampling.send()}catch(err){}};Sampling.prototype.runTime=function(){if(sampling.isSend==1){sampling.stopRun();return}sampling.spend++;if(sampling.spend==20){try{sampling.get()}catch(err){}}try{if((player.playState==3)&&(player.openState==13)&&(sampling.beginTime==-1)){sampling.beginTime=sampling.spend}if(player.currentMedia.duration>0){if(player.currentMedia.duration-player.controls.currentPosition<=3){try{sampling.send()}catch(err){}}}sampling.latestPos=player.controls.currentPosition}catch(err){sampling.stopRun()}}};function bclosewin(){if(player==null)return;if(!sampling.bSampling)return;if(!samplingEnable)return;sampling.closeWindow()};window.onbeforeunload=bclosewin;var img=new Image();var sampling=new Sampling();sampling.startRun();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -