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 allyes_ad_360_430="";var allyes_ad_360_430_ifr="";var isLoadedAllyesAd=0;var isAllyesExt=0;var isAllyes=0;var isRefresh=0;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 ad3_script=null;var createAdTimeout=0;var first_song=csong+"_"+csinger;var using_ad2=false;var guangGao="http://a.baidu.com/ecom?di=18&tm=baidufsbanner&word=";var guangGao2="http://a.baidu.com/ecom?di=106,107,188&tm=baidufslink,baidufsbanner,baidufsbanner&word=";var guangGao3="http://eiv.baidu.com/mapm2/1223AllyesMp3/mp3_mt_extend.js";function $d(A){return document.getElementById(A)}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)}isAllyes=/allyes/.test(arrBaiduAds[18]);if(isAllyes){if(isAllyesExt){showAd(allyes_ad_360_430,1)}else{if(!isLoadedAllyesAd){createAd3()}else{showAd(arrBaiduAds[18],0)}}}else{showAd(arrBaiduAds[18],0)}}else{hasAds=false;isAllyes=false;hideLeftAd();if(is_ext_mb){try{try_iframe.showLeftCheck("all")}catch(A){}}}}}function loadAd3(){isLoadedAllyesAd=1;if(ad3_script.readyState=="loaded"||isFF){if(typeof (allyes_ad_360_430)!="undefined"&&allyes_ad_360_430!=""){allyes_ad_360_430=allyes_ad_360_430.replace(/(^\s*)|(\s*$)/g,"");hasAds=true;isAllyesExt=1;showAd(allyes_ad_360_430)}else{showAd(arrBaiduAds[18])}}}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(A){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}}function createAd3(){if(ad3_script==null){ad3_script=document.createElement("script")}else{try{ad_script_div.removeChild(ad3_script)}catch(A){hasAds=false}ad3_script=document.createElement("script")}if(isFF){ad3_script.onload=loadAd3}else{ad3_script.onreadystatechange=loadAd3}ad3_script.src=guangGao3+"?t="+Math.random()*(new Date()).getMilliseconds();ad_script_div.appendChild(ad3_script)}function refreshExt(){if(!isAllyesExt||!isAllyes){return false}var B=encodeURIComponent(csong+"??"+csinger);var A=encodeURIComponent($d("song_url").href);if(allyes_ad_360_430==""){return false}var C='<iframe marginheight=0 marginwidth=0 allowtransparency="true" src="'+allyes_ad_360_430+"?word="+B+"&url="+A+'" frameborder=0 scrolling=no></iframe>';if(allyes_ad_360_430_ifr!=C){allyes_ad_360_430_ifr=C;$d("leftAd2_div").innerHTML=allyes_ad_360_430_ifr}}var playingsong="";function mainTimeOut(){csong=$d("song").innerHTML;csinger=$d("singer").innerHTML;var E=csong+"_"+csinger;if((playingsong==E)&&!isRefresh){if(!isFF){try{var F=$d("MediaPlayer1");if(isMH){if(((F.PlayState==3)||(F.PlayState==6)||(F.PlayState==2))&&((F.OpenState==13))){isRefresh=true}}else{if(((F.PlayState==3)||(F.PlayState==2)||(F.PlayState==1))&&((F.OpenState==6))){isRefresh=true}}}catch(C){}try{var B=$d("RealPlayer1");if((B.GetPlayState()==2)||(B.GetPlayState()==3)||(B.GetPlayState()==4)){isRefresh=true}}catch(C){}}if((playingsong==E)&&isRefresh){setTimeout(refreshExt,500);return true}}if(playingsong!=E){isRefresh=false}if(playingsong==E){return false}if(createAdTimeout!=0){clearTimeout(createAdTimeout);createAdTimeout=0}var A=true;if(!A){hideLeftAd();if(is_ext_mb){try{try_iframe.showLeftCheck("all")}catch(D){}}else{try{try_iframe.showLeftCheck("all")}catch(D){}}if(using_ad2){hideAd2()}else{if(E!=first_song){hideAd2()}}return }playingsong=E;try{hideLeftAd();if(is_ext_mb){try_iframe.showLeftCheck("all")}showcount=0;dispcount=0;createAd();if(using_ad2){hideAd2()}else{if(E!=first_song){hideAd2()}}if(first_song!=playingsong&&using_ad2==false){using_ad2=true}if(using_ad2){createAd2()}}catch(D){}}var showingsong="";function showAd(A){if(A==""){$d("LrcShower_div").style.display="inline";document.getElementById("LrcUrlA").style.visibility="visible";$d("lrctellall_div").style.display="none";$d("lrctellall_div").innerHTML="";return }try{if(is_ext_mb){if(!try_iframe.isOp()){showLeftAd(arrBaiduAds[18]);try_iframe.showLeftCheck("top")}}else{if((!hasLrc)&&!isAllyesExt||(isFF&&!isAllyesExt)){hideLeftAd();$d("leftAd_div").innerHTML=A;$d("LrcShower_div").style.display="none";document.getElementById("LrcUrlA").style.visibility="hidden";$d("lrctellall_div").style.display="inline";$d("lrctellall_div").innerHTML=A;var B=$d("arrowright_div");B.className="aw";B.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(isFF&&isAllyesExt){$d("Lrc_div").style.position="absolute";$d("Lrc_div").style.left="430px"}if(showingsong!=playingsong){showingsong=playingsong;if(screen.width>800){window.moveTo(100,0)}else{window.moveTo(0,0)}window.resizeTo(810+woffset,600)}showLeftAd(A);$d("arrowright_div").style.marginLeft="420px"}}}catch(C){}}function showLeftAd(B){if(arguments.length==0){B=arrBaiduAds[18]}var C=$d("try_iframe");C.style.height="225px";if(isAllyesExt&&isAllyes){csong=$d("song").innerHTML;csinger=$d("singer").innerHTML;var D=encodeURIComponent(csong+"??"+csinger);var A=encodeURIComponent($d("song_url").href);var E='<iframe marginheight=0 marginwidth=0 allowtransparency="true" src="'+allyes_ad_360_430+"?word="+D+"&url="+A+'" frameborder=0 scrolling=no></iframe>';if(E!=allyes_ad_360_430_ifr){allyes_ad_360_430_ifr=E;$d("leftAd2_div").innerHTML=allyes_ad_360_430_ifr}}$d("leftAd_div").innerHTML=arrBaiduAds[18];if(is_ext_mb){$d("leftAd_div").style.marginTop="5px"}else{if(isAllyesExt){$d("leftAd_div").style.display="none";$d("leftAd2_div").style.display="";$d("leftAd2_div").style.height="430px";$d("leftAd2_div").style.marginTop="100px";return true}else{$d("leftAd_div").style.marginTop="230px"}}$d("leftAd2_div").style.display="none";$d("leftAd_div").style.display=""}function hideLeftAd(){var A=$d("try_iframe");A.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,500);function showAdRight(A){$d("Blrc").style.display="none";$d("LrcShower_div").style.display="none";$d("lrctellall_div").style.display="inline";$d("lrctellall_div").innerHTML=A;document.getElementById("LrcUrlA").style.visibility="hidden"}function showAd2(B,A,C){$d("adtb").style.display="block";$d("LrcShower_div").style.height="243px";$d("ad1").innerHTML=A;$d("ad2").innerHTML=B;$d("ad3").innerHTML=C}function hideAd2(){$d("ad1").innerHTML="";$d("ad2").innerHTML="";$d("ad3").innerHTML="";$d("adtb").style.display="none";$d("LrcShower_div").style.height="253px"}function createAd2(){if(ad2_script==null){ad2_script=document.createElement("script")}else{try{ad_script_div.removeChild(ad2_script)}catch(A){}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],arrBaiduAds[188])}else{hideAd2()}}}var samplingEnable=true;var ratio=10;var player=null;var sitebase="http://imgs.zhangmen.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.os=-1;this.id="";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;this.clickURL=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");this.id=(new Date()).getTime()+","+Math.floor(1000000*Math.random());img.src=sitebase+"status/attend.gif?url="+this.songURL+"&id="+this.id;this.runInterval=setInterval(this.runTime,1000)};Sampling.prototype.stopRun=function(){if(sampling.runInterval!=0){try{clearInterval(sampling.runInterval)}catch(A){}}sampling.runInterval=0};Sampling.prototype.decision=function(){var A=parseInt(Math.random()*ratio);return A==1};Sampling.prototype.clkURL=function(){if(!sampling.clickURL){sampling.clickURL=1}};Sampling.prototype.get=function(){sampling.isGet=1;try{if(isLoadIf){return }}catch(A){}try{sampling.bufferingCount=player.network.bufferingCount}catch(A){sampling.bufferingCount=0}try{sampling.receivedPackets=player.network.receivedPackets}catch(A){sampling.receivedPackets=0}try{sampling.downloadProgress=player.network.downloadProgress}catch(A){sampling.downloadProgress=0}try{sampling.bufferingProgress=player.network.bufferingProgress}catch(A){sampling.bufferingProgress=0}};Sampling.prototype.send=function(){sampling.isSend=1;try{if(isLoadIf){return }}catch(B){}if(!sampling.isGet){sampling.get()}try{sampling.songLen=Math.round(player.currentMedia.duration)}catch(B){sampling.songLen=0}sampling.pageTime=sampling.spend;try{sampling.playTime=Math.round(player.controls.currentPosition)}catch(B){sampling.playTime=0}try{sampling.pState=player.playState}catch(B){sampling.pState=0}try{sampling.oState=player.openState}catch(B){sampling.oState=0}try{sampling.bandWidth=player.network.bandWidth}catch(B){sampling.bandWidth=0}try{sampling.bitrate=player.currentMedia.getItemInfo("Bitrate")}catch(B){sampling.bitrate=0}var C=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+"&clickurl="+sampling.clickURL+"&id="+sampling.id+"&os="+sampling.os;img.src=C;var A=new Date().getTime();while(new Date().getTime()-A<50){}};Sampling.prototype.closeWindow=function(){if(sampling.isSend==1){return }sampling.closeFlag=1;try{sampling.send()}catch(A){}};Sampling.prototype.runTime=function(){if(sampling.isSend==1){sampling.stopRun();return }sampling.spend++;if(sampling.spend==20){try{sampling.get()}catch(A){}}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(A){}}}sampling.latestPos=player.controls.currentPosition}catch(A){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();