=========================== 今天贴QQMUSIC 的部分脚本,当我 点击下载音乐的时候,蹦出来的,停在debugger =========================== window.MUSIC=MUSIC||{} MUSIC.widget=MUSIC.widget||{};MUSIC.widget.intellMatch={_const:{maxListNum:10,maxTryTime:2,dataUrl:"http://cgi.music.soso.com/fcgi-bin/fcg_smartbox.q?utf8=" +(Browser.isIE8?1:1)+"&w=",_inputN:"w",_listN:"keywords_list"},keyword:"",hashkey:"",data:null,cache:new HashTable(),useCache:false,timer:0,_callBack:null,getKeyword:function(keyword){return this.deleteDirtyWord(this.keyword).replace(/</g,"").replace(/>/g,"").replace(/%20/g," ").replace(/&/g," ").replace(/#/g," ").replace(/;/g," ").replace(////," ").replace(//,/," ").replace(////," ").replace(/'/," ").replace(//"/," ").replace(//{/," ").replace(//}/," ").replace(//[/," ").replace(//?/," ").replace(//|/," ").replace(//]/," ");},deleteDirtyWord:function(_str){return _str.replace(/可卡因/g,"").replace(/cocaine/g,"").replace(/cocain/g,"").replace(/抗疼痛/g,"")},load:function(callback,keyword){if(keyword) this.keyword=keyword;if(callback) this._callBack=callback;this.hashkey=this.getKeyword().replace(/(^/s*)|(/s*$)/g,"_");if(this.useCache&&this.cache.contains(this.hashkey)){try{this.data=this.cache.items(this.hashkey);this.show();}catch(e){var url=this._const.dataUrl+this.getKeyword();JsonLoadData(url,this.setData.bind(this),this.loadFail.bind(this));}}else{var url=this._const.dataUrl+this.getKeyword();JsonLoadData(url,this.setData.bind(this),this.loadFail.bind(this),null,"gb2312");}},setData:function(data){this.timer=0;this.data=data;if(this._callBack){this._callBack();} this.timer=0;if(this.useCache) this.cache.add(this.hashkey,this.data);},loadFail:function(){if(this.timer++<this._const.maxTryTime){this.load();}else{}},set:function(keyword){if(keyword) this.keyword=keyword;this.bindEvent();if(keyword.trim()==""){return;} this.load(this.show.bind(this));},doIntervalEvent:function(){var curInputVal=Element(this._const._inputN).value;if(curInputVal.trim()==""){hideElement(this._const._listN);MUSIC.widget.intellMatch._hasResult=false;return;} if(curInputVal.trim()!=""&&curInputVal!=this.keyword){this.set(curInputVal);}},_hasResult:false,show:function(){if(!this.data||!this.data.head){return;} var _obj=Element(this._const._listN);if(!_obj.getElementsByTagName("ul")) return;var ul=_obj.getElementsByTagName("ul")[0];if(this.data.head.error!=0){hideElement(this._const._listN);this._hasResult=false;return;}else{var html=[];if(!this.data.item||this.data.item.length==0){hideElement(this._const._listN);this._hasResult=false;return;}else{for(var i=0;i<this.data.item.length&&i<this._const.maxListNum;i++){html.push("<li><a href="#" mce_href="#" onclick='MUSIC.widget.intellMatch.search(this)'" +" onmouseover='MUSIC.widget.intellMatch._onmouseEvent(this);' index=" +i +" onmouseout='this.className=/"/"'>" +this.data.item[i].w+"</a></li>");} ul.innerHTML=html.join("");this._hasResult=true;}} showElement(this._const._listN);},_onmouseEvent:function(obj,index){var _obj=Element(this._const._listN);if(!_obj) return;var ul=_obj.getElementsByTagName("ul")[0];var lis=ul.getElementsByTagName("li");for(var i=0;i<lis.length;i++){lis[i].childNodes[0].className="";lis[i].childNodes[0].style.backgroundColor="";} this.curIndex=obj.index;obj.className="on";},search:function(obj){this.clear();hideElement(this._const._listN);Element("w").value=obj.innerText;Element("search_form").submit();},_event:null,clear:function(){if(this._event) clearInterval(this._event);this._event=null;document.onkeydown=null;},curIndex:-1,bindEvent:function(){this.clear();this.curIndex=-1;document.onkeydown=this._keydown;this._event=setInterval(this.doIntervalEvent.bind(this),300);var _obj=Element(this._const._listN);if(!_obj) return;_obj.attachEvent("onmouseenter",function(){MUSIC.widget.intellMatch._mlf=false;if(MUSIC.widget.intellMatch._hasResult&&Element(MUSIC.widget.intellMatch._const._inputN).value.trim()!="") showElement('keywords_list');});_obj.attachEvent("onmouseleave",function(){MUSIC.widget.intellMatch._mlf=true;setTimeout("if(MUSIC.widget.intellMatch._mlf)hideElement('keywords_list');",100);});Element(this._const._inputN).attachEvent("onmouseleave",function(){setTimeout("if(MUSIC.widget.intellMatch._mlf)hideElement('keywords_list');",100);});Element(this._const._inputN).attachEvent("onmouseenter",function(){MUSIC.widget.intellMatch._mlf=false;if(MUSIC.widget.intellMatch._hasResult&&Element(MUSIC.widget.intellMatch._const._inputN).value.trim()!="") showElement('keywords_list');});EventUtil(document,"click",function(){var _ev=event.srcElement;var _edit=false;if(_ev.tagName&&_ev.tagName=="INPUT"){_edit=true;} if(!_edit){hideElement('keywords_list');}});},_mlf:false,_keydown:function(){var _obj=Element(MUSIC.widget.intellMatch._const._listN);if(!_obj) return;var ul=_obj.getElementsByTagName("ul")[0];var lis=ul.getElementsByTagName("li");for(var i=0;i<lis.length;i++){lis[i].childNodes[0].className="";lis[i].childNodes[0].style.backgroundColor="";} var index=0;switch(event.keyCode){case 38:{if(MUSIC.widget.intellMatch.curIndex>0){MUSIC.widget.intellMatch.curIndex--;}else{MUSIC.widget.intellMatch.curIndex=lis.length-1;}} break;case 40:{if(MUSIC.widget.intellMatch.curIndex<lis.length-1){MUSIC.widget.intellMatch.curIndex++;}else{MUSIC.widget.intellMatch.curIndex=0;}} break;default:{if(!MUSIC.widget.intellMatch._event) MUSIC.widget.intellMatch._event=setInterval(MUSIC.widget.intellMatch.doIntervalEvent.bind(MUSIC.widget.intellMatch),300);return;} break;} index=MUSIC.widget.intellMatch.curIndex;try{lis[index].childNodes[0].className="on";Element(MUSIC.widget.intellMatch._const._inputN).value=lis[index].innerText;if(MUSIC.widget.intellMatch._event){clearInterval(MUSIC.widget.intellMatch._event);MUSIC.widget.intellMatch._event=null;}}catch(i){}}} ClassSoSoSong=function(tsongname,tsinger,turl,album,size,format,speed,songid,loc){this.songname=tsongname;this.url=turl;this.singer=tsinger;this.size=size;this.album=album;this.format=format;this.speed=speed;this.songid=songid;this.loc=loc;} function FormatSosoMusic(obj){var re=new RegExp("<//w[^>]+class=data[^>]*>(.*?)</////w[^>]*>","i") var arrTmp=["mid","msong","malbum","msinger","msize","mformat","mconn","iInteral","msongurl","mshowurl"];var length=arrTmp.length;var arrMusic=[];var i=0;if((arrMusic=re.exec(obj.innerHTML.replace(/&/g,"&")))!=null){arrMusic=arrMusic[1].split("@@");}else{this["error"]=1;for(i=0;i<length;i++){this[arrTmp[i]]="";} return;} if(arrMusic.length<2){this["error"]=1;} _length=Math.min(length,arrMusic.length);for(i=0;i<_length;i++){this[arrTmp[i]]=arrMusic[i];} for(i=_length;i<length;i++){this[arrTmp[i]]="";}} MUSIC.channel.soso={pager:{go:function(iPage){Element("search_form").p.value=iPage;Element("search_form").w.value=Element("search_form").lw.value;if(soso.checkForm()) Element("search_form").submit();soso.stat.startCli(-1,"","");}},copyLyric:function(idx){if(!window.clipboardData){alert('对不起,您的浏览器不支持此功能!');return;} window.clipboardData.setData('text',Element("lyric_"+idx).innerHTML.replace(/<BR>/gi,"/r/n").replace(/<//?strong>/gi,""));showElement("copylyrictips_"+idx);var timer=setTimeout(function(){hideElement("copylyrictips_"+idx);},2000);},getSosoMusic:function(obj){var music=new FormatSosoMusic(obj);if(!!music.error){music=new FormatMusic(obj);music.msongurl=this.getMusicUrlStream(music.mid,music.mstream);music.mshowurl=this.getMusicUrlIp(music.mid,music.mstream);music.mformat="mp3";music.mconn=100;music.iInteral=music.minterval;}else{var reg=new RegExp("(http|ftp)://[^;](.*?);","g");var array=music.msongurl.match(reg);if(array&&array[0]) music.msongurl=array[0].replace(/;/g,"");music.mshowurl=music.msongurl;} return music;},music:null,_callback:null,loadSosoData:function(callback){var url="http://soso.music.qq.com/fcgi-bin/music.fcg?w=" +this.music.msong+"+"+this.music.msinger+"&p=1&t=11";Ajax_GetData(url,this.dealSosoSucc.bind(this),this.dealSosoFail.bind(this));this._callback=callback;},dealSosoFail:function(){this._callback();},dealSosoSucc:function(xmlHttp){var xmlDom=xmlHttp.responseXml;var url=xmlDom.selectSingleNode("/song/url");if(!!url){this.music.msongurl=url.text var reg=new RegExp("(http|ftp)://[^;](.*?);","g");var array=this.music.msongurl.match(reg);if(array&&array[0]) this.music.msongurl=array[0].replace(/;/g,"");} var format=xmlDom.selectSingleNode("/song/format");if(!!format){this.music.mformat=format.text} var size=xmlDom.selectSingleNode("/song/size");if(!!size){this.music.msize=size.text} this._callback();},list:{arraySelect:[],songType:[],getList:function(lstMusic){var _lstMusic=lstMusic.firstChild;if(lstMusic&&lstMusic.nodeName=="TABLE"){while(_lstMusic&&_lstMusic.nodeName!="TBODY"){_lstMusic=_lstMusic.nextSibling;} if(_lstMusic&&_lstMusic.nodeName=="TBODY"){lstMusic=_lstMusic;}} lstMusic=lstMusic.childNodes;for(var j=0;j<lstMusic.length;j++){if(lstMusic[j].nodeType!=1||lstMusic[j].firstChild.nodeName=="TH"){continue;} var input=lstMusic[j].getElementsByTagName("input");if(input.length>0&&input[0].checked==false){continue;} var music=MUSIC.channel.soso.getSosoMusic(lstMusic[j]);this.arraySelect.push(music);this.songType.push(lstMusic[j].songtype);}},reportCli:function(obj){this.getList(obj);var music=null;for(var j=0;j<this.arraySelect.length;j++) {music=this.arraySelect[j];MUSIC.channel.soso.stat.startCli(this.songType[j],music.msong,music.msinger);}},play:function(obj){addBangdan(1);this.reportCli(obj.getElementsByTagName('table')[0]);},add:function(obj){addBangdan(2);this.reportCli(obj.getElementsByTagName('table')[0]);},downLoad:function(obj){player.list.download(obj.getElementsByTagName('table')[0]);this.reportCli(obj.getElementsByTagName('table')[0]);},collect:function(obj,type){if(typeof type=="undefined") {type=3;} var singerName=document.getElementsByName('lw')[0].value;addBangdan(type,singerName);this.reportCli(obj.getElementsByTagName('table')[0]);}},play:function(obj){player.play(obj);var music=this.getSosoMusic(obj) this.stat.startCli(obj.songtype,music.msong,music.msinger);},add:function(obj){player.add(obj);var music=this.getSosoMusic(obj) this.stat.startCli(obj.songtype,music.msong,music.msinger);},downLoad:function(obj){musicTip.downLoad(obj);var music=this.getSosoMusic(obj);this.stat.startCli(obj.songtype,music.msong,music.msinger);},setBack:function(obj){g_MyLike.setLikeSong(obj);var music=this.getSosoMusic(obj) this.stat.startCli(obj.songtype,music.msong,music.msinger);},playSoso:function(obj){this._songObj=!!obj?obj:this._songObj;if(!!this._songObj.err){this.buildNoSongTips(this._songObj);return;} this.music=!!obj?this.getSosoMusic(obj):this.music;if(!!this.music.msongurl||!obj){if(parseInt(this.music.msize)==0){if(!obj){this._songObj.setAttribute("err",1);} this.buildNoSongTips(this._songObj);return;}else{var type=0;try{if(this._songObj.songtype=="12") type=1;}catch(e){} var longTailFlag=0;for(var k=0;k<LongTailDomain.length;k++) {if(this.music.msongurl.indexOf(LongTailDomain[k])>=0) {longTailFlag=1;break;}} if(longTailFlag==1) var urlWithKey=this.music.msongurl+"?t="+LongTailKey+"&fromtag=10";else var urlWithKey=this.music.msongurl;playsososong(urlWithKey,this.music.msong,this.music.msinger,this.music.malbum,this.music.msize,this.music.iInteral,this.music.mconn,type);this.stat.statResult(this.music.msong,this.music.msinger,this.music.malbum,0);this.stat.startCli(this._songObj.songtype,this.music.msong,this.music.msinger);this.stat.statSosoUrl(this.music.msong,this.music.msinger,this.music.malbum);}}else{this.loadSosoData(this.playSoso.bind(MUSIC.channel.soso));}},_songObj:null,addSoso:function(obj){this._songObj=!!obj?obj:this._songObj;if(!!this._songObj.err){this.buildNoSongTips(this._songObj);return;} this.music=!!obj?this.getSosoMusic(obj):this.music;if(!!this.music.msongurl||!obj){if(parseInt(this.music.msize)==0){if(!obj){this._songObj.setAttribute("err",1);} this.buildNoSongTips(this._songObj);return;}else{var type=0;try{if(this._songObj.songtype=="12") type=1;}catch(e){} var longTailFlag=0;for(var k=0;k<LongTailDomain.length;k++) {if(this.music.msongurl.indexOf(LongTailDomain[k])>=0) {longTailFlag=1;break;}} if(longTailFlag==1) var urlWithKey=this.music.msongurl+"?t="+LongTailKey+"&fromtag=10";else var urlWithKey=this.music.msongurl;addsososong(urlWithKey,this.music.msong,this.music.msinger,this.music.malbum,this.music.msize,this.music.iInteral,this.music.mconn,1);this.stat.statResult(this.music.msong,this.music.msinger,this.music.malbum,type);this.stat.startCli(this._songObj.songtype,this.music.msong,this.music.msinger);this.stat.statSosoUrl(this.music.msong,this.music.msinger,this.music.malbum);}}else{this.loadSosoData(this.addSoso.bind(MUSIC.channel.soso));}},buildNoSongTips:function(obj){var oDiv=getElementInBody("sososingerinfo_tips","div",false,false,"sosoinfotips");if(!oDiv){return;} var arrHTML=new Array();arrHTML.push("<a class=/"bt_tipsclose/" href="/" mce_href="/""javascript:void(0)/" title=/"关闭/" onclick=/"hideElement('sososingerinfo_tips')/">关闭</a><h3>信息提示</h3><div class=/"content/"><p class=/"feedback bold/">对不起,未找到该歌曲试听链接,建议进行:</p><div class=/"bt_obj/"><button type=/"button/" title=/"用SOSO音乐搜索/" onclick=/"window.open('http://music.soso.com/music.cgi?sc=mus&source=4&w=" +this.music.msong.encodeURLSymbol() +"');/">用SOSO音乐搜索</button></div></div>");oDiv.innerHTML=arrHTML.join("");oDiv.style.display="";oDiv.style.pixelTop=200;oDiv.style.pixelLeft=getPosition(obj.childNodes[3]).left;},downLoadSoso:function(obj){this._songObj=!!obj?obj:this._songObj;if(!!this._songObj.err){this.buildNoSongTips(this._songObj);return;} this.music=!!obj?this.getSosoMusic(obj):this.music;if(!!this.music.msongurl||!obj){if(parseInt(this.music.msize)==0){if(!obj){this._songObj.setAttribute("err",1);} this.buildNoSongTips(this._songObj);return;}else{var longTailFlag=0;for(var k=0;k<LongTailDomain.length;k++) {if(this.music.msongurl.indexOf(LongTailDomain[k])>=0) {longTailFlag=1;break;}} debugger if(longTailFlag==1) this.music.msongurl=this.music.msongurl+"?t="+LongTailKey+"&fromtag=10";loadNewDonwloadTips(this.music,4);var type=0;try{if(this._songObj.songtype=="12"){type=1;stat_download(this.music.mid,1,3,'搜索');}else{stat_download(0,1,2,'搜索');}}catch(e){} this.stat.statResult(this.music.msong,this.music.msinger,this.music.malbum,type);this.stat.startCli(this._songObj.songtype,this.music.msong,this.music.msinger);}}else{this.loadSosoData(this.downLoadSoso.bind(MUSIC.channel.soso));}},searchSinger:function(obj){var music=this.getSosoMusic(obj);g_singerSearch.newSearch(music.msinger.replace(/['|"]/gi," "));var type=0;try{if(obj.songtype=="12") type=1;}catch(e){} this.stat.statResult(music.msong,music.msinger,music.malbum,type);this.stat.startCli(obj.songtype,music.msong,music.msinger);},searchAlbum:function(obj){var music=this.getSosoMusic(obj);var type=0;try{if(obj.songtype=="12") type=1;}catch(e){} g_singerAlbumSearch.newSearch(music.msinger.replace(/['|"]/gi," "),music.malbum.replace(/['|"]/gi," "),obj);this.stat.statResult(music.msong,music.msinger,music.malbum,type);this.stat.startCli(obj.songtype,music.msong,music.msinger);},search:function(obj){Element("w").value=obj.title;Element("search_form").submit();},downloadLyric:function(obj,mid){var ie="";if(Browser.isIE8) ie="utf-8";var music=this.getSosoMusic(obj);var url="http://cgi.music.soso.com/fcgi-bin/fcg_download_lrc.q?song=" +encodeURI(music.msong)+"&singer=" +encodeURI(music.msinger)+"&down=1&ie="+ie;window.open(url,"_blank");reportResPv("下载歌词浮出层");},downloadLyric2:function(music){var ie="";if(Browser.isIE8) ie="utf-8";var url="http://cgi.music.soso.com/fcgi-bin/fcg_download_lrc.q?song=" +encodeURI(music.msong)+"&singer=" +encodeURI(music.msinger)+"&down=1&ie="+ie;window.open(url,"_blank");reportResPv("下载歌词浮出层");},showLyricFlag:false,showLyric:function(obj,index){if(!this.showLyricFlag){this.showLyricFlag=true;var music=this.getSosoMusic(obj);MulLyricTip(obj,music).show();} reportResPv("查看歌词浮出层");},checkForm:function(flag){if(Element("search_form").w.value.trim()==""){if(!/miniportal/.test(location.href)) window.location.href="http://music.qq.com/miniportal/search.html";else if(!flag) window.location.reload();return false;} return true;},stat:{uin:Cookie.get("qqmusic_uin"),status:GetUserStatus(),statSoso:function(){var type=getParameter("t");var page=getParameter("p");var action=this.getAction();var uin=(this.uin=="")?"0":this.uin;var source=0;var keyword=Element("w").value;var base_url="http://cgi.music.soso.com/fcgi-bin/fcg_tj2.q?msgid=2080000064&num=17&uin=";var url=base_url+uin+"&isVIP="+(this.status==1?1:0) +"&reportID="+2+"&type="+type+"&keyword=" +keyword.replaceUrl()+"&songName="+""+"&singerName=" +""+"&albumName="+""+"&clientX="+page +"&clientY="+0+"&IP="+""+"&recordDate="+"" +"&guin="+""+"&bak1="+action+"&bak2="+0 +"&bak3="+""+"&bak4="+""+"&p="+Math.random();this.start(url)},getAction:function(){var action=3;try{if(/miniportal//search/.html/g.test(document.referrer)){action=2;}else if(getParameter("ctime")!=""){action=1;}else action=3;}catch(e){} return action;},start:function(url){var objImg=new Image();objImg.src=url+"&p="+Math.random();objImg.style.width=0;objImg.style.height=0;delete objImg;objImg=null;},statResult:function(song,singer,album,isWz){var uin=this.uin if(uin%100!=2||Browser.isIE8) return;var keyword=Element("w").value;var base_url="http://cgi.music.soso.com/fcgi-bin/fcg_tj2.q?msgid=2080000064&num=17&uin=";var url=base_url+uin+"&isVIP="+0+"&reportID="+1 +"&type="+0+"&keyword="+keyword.replaceUrl() +"&songName="+song.replaceUrl()+"&singerName=" +singer.replaceUrl()+"&albumName="+album.replaceUrl() +"&clientX="+0+"&clientY="+0+"&IP="+"" +"&recordDate="+""+"&guin="+""+"&bak1="+0 +"&bak2="+0+"&bak3="+(isWz?1:0)+"&bak4="+"" +"&p="+Math.random();this.start(url);},statSosoUrl:function(song,singer,album){var base_url="http://cgi.music.soso.com/fcgi-bin/fcg_tj2.q?msgid=2080000061&num=10&uin=&type=5&searchKeyword=&searchType=&songName="+song+"&singerName="+singer+"&albumName="+album+"&bak1=&bak2=&bak3=&p="+Math.random();this.start(base_url);},startCli:function(field,msong,msinger){if(this.uin%100!=2||Browser.isIE8) return;var type=parseInt(field);var f;if(type>=0&&type<=9){f=3;}else if(type==11){f=2;}else if(type==12||type==14){f=4;}else if(type==10){f=5;}else f=6;var keyword=Element("w").value;var page=Element("p").value;var base_url="http://cgi.music.soso.com/fcgi-bin/fcg_tj2.q?msgid=2080000064&num=17&uin=";var url=base_url+this.uin+"&isVIP="+0+"&reportID="+3 +"&type="+f+"&keyword="+keyword.replaceUrl() +"&songName="+msong.replaceUrl()+"&singerName=" +msinger.replaceUrl()+"&albumName="+""+"&clientX=" +page+"&clientY="+0+"&IP="+""+"&recordDate=" +""+"&guin="+""+"&bak1="+0+"&bak2="+0 +"&bak3="+""+"&bak4="+""+"&p="+Math.random();this.start(url);}},getMusicUrlStream:function(songid,songLoc){var str="http://stream"+songLoc+".qqmusic.qq.com/" +(parseInt(songid)+12000000)+".wma";return str;},getMusicUrlIp:function(songid,songLoc){var StreamIP=["116.28.66.253","116.28.63.250","116.28.63.250","116.28.66.253","121.9.210.27","121.9.210.27","121.9.210.102","121.9.210.102","121.9.210.27","121.9.210.102"];var str="http://"+StreamIP[songLoc-1]+"/" +(parseInt(songid)+30000000)+".mp3";return str;},albumSearchResult:function(jumpType,ID,name){if(!ID) {var t=0;if(jumpType) {t=8;} setTimeout('location.href="http://soso.music.qq.com/fcgi-bin/music.fcg?w=' +name.replaceUrl()+'&t='+t+'"',200);return;}else if(!jumpType) {setTimeout('location.href = "http://music.qq.com/miniportal/static/singer/' +(ID-Math.floor(ID/100)*100)+'/singer_'+ID +'.html"',200);}else setTimeout("document.location = 'http://music.qq.com/miniportal/static/album/" +(ID-Math.floor(ID/100)*100) +"/album_"+ID+"_1.html'",200);}} var soso=MUSIC.channel.soso;var stat=MUSIC.channel.soso.stat;var g_singerSearch={m_iCurPageNo:0,m_iPerPageItemNum:4,m_iPageNaviLen:5,m_arrData:new Array(),m_iResNum:0,m_iTotalPageNum:0,m_strKey:"",m_bBusy:false,m_iHitX:0,m_iHitY:0,newSearch:function(strKey){this.m_iHitX=event.clientX;this.m_iHitY=event.clientY;if(strKey.trim()==""){return;} if(strKey==this.m_strKey){this.showPage(1);return;} this.m_strKey=strKey;this.search()},showPage:function(iPageNo){var iIdDir;if(this.m_iResNum==1&&this.m_strKey.trim()==this.m_arrData[0].m_strName){iIdDir=this.m_arrData[0].m_iId;iIdDir=iIdDir-Math.floor(iIdDir/100)*100;setTimeout('location.href = "http://music.qq.com/miniportal/static/singer/' +iIdDir+'/singer_'+this.m_arrData[0].m_iId +'.html"',200);return;} if(this.m_iResNum==0){setTimeout('location.href="http://soso.music.qq.com/fcgi-bin/music.fcg?w=' +this.m_strKey.replaceUrl()+'"',200);return;} var arrHTML=new Array();var oDiv=getElementInBody("sososingerinfo_tips","div",null,null,"sosoinfotips");if(!oDiv) return;if(iPageNo<1) return;if(iPageNo>this.m_iTotalPageNum) return;this.m_iCurPageNo=iPageNo;arrHTML.push("<a class=/"bt_tipsclose/" href="/" mce_href="/""javascript:void(0)/" title=/"关闭/" onclick=/"document.getElementById('sososingerinfo_tips').style.display='none'/">关闭</a><h3>QQ音乐正版音乐库搜索结果</h3><div class=/"content/"><ol class=/"singerlist clearfix/">");var iStart=(this.m_iCurPageNo-1)*this.m_iPerPageItemNum;var srtNo="";var iIdDir=0;for(var i=0;i<4&&iStart<this.m_iResNum;i++,iStart++){srtNo=(iStart+1)<10?"0"+(iStart+1):""+(iStart+1);iIdDir=this.m_arrData[iStart].m_iId;iIdDir=iIdDir-Math.floor(iIdDir/100)*100;arrHTML.push("<li><span class=/"num/">" +srtNo +"</span><a class=/"fix/" href="/" mce_href="/""http://music.qq.com/miniportal/static/singer/" +iIdDir +"/singer_" +this.m_arrData[iStart].m_iId +".html/"><span class=/"mark/">" +this.m_arrData[iStart].m_strName.decodeURLSymbol()+"</span></a></li>");} arrHTML.push("</ol>");arrHTML.push(this.createPageNavi());arrHTML.push("</div>");oDiv.innerHTML=arrHTML.join("");;oDiv.style.display="";oDiv.style.pixelTop=this.m_iHitY-55;oDiv.style.pixelLeft=this.m_iHitX;MUSIC.widget.intellMatch.clear();return;},search:function(){this.reset();var url="http://portalcgi.music.qq.com/fcgi-bin/music_mini_portal/cgi_query_singer.fcg?name=" +this.m_strKey.replaceUrl() +"&utf8=" +(Browser.isIE8?1:0);JsonLoadData(url,this.handlSearch.bind(this));},handlSearch:function(data){if(data.retcode==0){var _listID=data.listid.split(",");var _listName=data.listname.split(",");var _listStatus=data.liststatus.split(",");var len1=_listID.length;var len2=_listName.length;var len3=_listStatus.length;if(len1>len2) len1=len2;if(len1>len3) len1=len3;for(var i=0;i<len1;i++){if(_listStatus[i]==2){this.m_arrData.push(new stSinger(_listID[i],_listName[i]));}}} if(this.m_arrData.length>0){this.m_iResNum=this.m_arrData.length;this.m_iTotalPageNum=Math.ceil(this.m_iResNum/this.m_iPerPageItemNum);} this.showPage(1);return;},reset:function(){this.m_iCurPageNo=0;this.m_arrData.length=0;this.m_iResNum=0;this.m_iTotalPageNum=0;},createPageNavi:function(){var arrPageNavi=new Array();if(this.m_iTotalPageNum<=0){return"";} arrPageNavi.push("<div class=/"page/">");if(this.m_iCurPageNo>1){arrPageNavi.push("<a title=/"上一页/" class=/"bt_songlist_pre/" href="/" mce_href="/""#/" onclick=/"g_singerSearch.showPage(" +(this.m_iCurPageNo-1)+")/">上一页</a>");} var iPageNaviHalf=Math.floor(this.m_iPageNaviLen/2);var iStart=this.m_iCurPageNo-iPageNaviHalf;var iEnd=this.m_iCurPageNo+iPageNaviHalf;if(iStart<1){iStart=1;iEnd=iStart+this.m_iPageNaviLen-1;} if(iEnd>this.m_iTotalPageNum){iEnd=this.m_iTotalPageNum;iStart=iEnd-this.m_iPageNaviLen+1} if(iStart<1){iStart=1;} var i;for(i=iStart;i<=iEnd;i++){if(i==this.m_iCurPageNo){arrPageNavi.push("<span class=/"now/">"+i+"</span>");}else{arrPageNavi.push("<a href="/" mce_href="/""#/" onclick=/"g_singerSearch.showPage(" +i+")/">"+i+"</a>");}} if(this.m_iCurPageNo<this.m_iTotalPageNum){arrPageNavi.push("<a href="/" mce_href="/""#/" onclick=/"g_singerSearch.showPage(" +(this.m_iCurPageNo+1) +");/" title=/"下一页/" class=/"bt_songlist_next/">下一页</a>");} arrPageNavi.push("</div>");return arrPageNavi.join("");}} function stSinger(iId,strName){this.m_iId=iId;this.m_strName=strName;} var g_singerAlbumSearch={m_strSinger:"",m_strAlbum:"",m_iHitX:0,m_iHitY:0,newSearch:function(strSinger,strAlbum,pparentNode){this.m_strSinger=strSinger;this.m_strAlbum=strAlbum;this.m_iHitX=getPosition(pparentNode.childNodes[4]).left;this.m_iHitY=event.clientY;var url="http://portalcgi.music.qq.com/fcgi-bin/music_mini_portal/cgi_singeralbum_match.fcg?sn=" +strSinger.replaceUrl() +"&an=" +strAlbum.replaceUrl() +"&utf8="+(Browser.isIE8?1:0);JsonLoadData(url,this.handlSearch.bind(this));},handlSearch:function(data){if(data.retcode==0&&data.num>=1&&data.status>0){var iAlbumId=parseInt(data.albumid.split(",")[0]);setTimeout("document.location = 'http://music.qq.com/miniportal/static/album/" +(iAlbumId-Math.floor(iAlbumId/100)*100) +"/album_"+iAlbumId+"_1.html'",200);}else{var oDiv=getElementInBody("sososingerinfo_tips","div",false,false,"sosoinfotips");if(!oDiv) return;var arrHTML=new Array();arrHTML.push("<a class=/"bt_tipsclose/" href="/" mce_href="/""javascript:void(0)/" title=/"关闭/" onclick=/"hideElement('sososingerinfo_tips')/">关闭</a><h3>QQ音乐正版音乐库搜索结果</h3><div class=/"content/"><p class=/"feedback bold/">QQ音乐无该专辑的匹配结果</p><div class=/"bt_obj/"><button type=/"button/" title=/"用SOSO音乐重新搜/" onclick=/"window.open('http://music.soso.com/music.cgi?sc=mus&source=4&w=" +this.m_strSinger.replaceUrl() +"%20" +this.m_strAlbum.replaceUrl() +"');/">用SOSO音乐重新搜索</button></div></div>");oDiv.innerHTML=arrHTML.join("");;oDiv.style.display="";oDiv.style.pixelTop=this.m_iHitY-10;oDiv.style.pixelLeft=this.m_iHitX;return;} return;}} var g_lyric_cache={};var ginfo_or_id;var gmusic;function MulLyricTip(info_or_id,music){if(music){gmusic=music;} var info=gmusic;song_id=info.mid;ginfo_or_id=info_or_id;song_id=parseInt(song_id,10);var lyric_tip_tpl=['<div class="global_tips tips_lyric">','<div class="tips_shadow"></div>','<div class="tips_content">','<h3 class="tips_title" title="%(song_name)">歌词:%(song_name)</h3>','<a href="#" mce_href="#" class="bt_tipsclose" onclick="MulLyricTip(%(song_id)).close();return false;">关闭</a>','<div class="tips_lyric_con">','<div class="info_con c_tx3">','<div class="lyric_tool"><a href="#" mce_href="#" class="bor1" onclick="MulLyricTip(%(song_id)).copy(this);return false;">复制歌词</a> <a href="#" mce_href="#" onclick="%(downloadLyric)" class="bor1">下载歌词</a> </div>','<div class="lyric_tips bor3 bg6" style="display:none;" mce_style="display:none;"> 已成功复制歌词 </div>','歌手:<a href="%(singer_url)" mce_href="%(singer_url)">%(singer_name)</a><br/>','专辑:<a href="%(album_url)" mce_href="%(album_url)">%(album_name)</a><br/>','<br/>','%(lyric_content)','</div>','</div>','</div>','</div>','</div>'].join('');var err_lyric_tip_tpl=['<div class="global_tips tips_lyric">','<div class="tips_shadow"></div>','<div class="tips_content">','<h3 class="tips_title">歌词:%(song_name)</h3>','<a href="#" mce_href="#" class="bt_tipsclose" onclick="MulLyricTip(%(song_id)).close();return false;">关闭</a>','<div class="tips_lyric_con">','<div class="info_con c_tx3">','歌手:<a href="%(singer_url)" mce_href="%(singer_url)">%(singer_name)</a><br/>','专辑:<a href="%(album_url)" mce_href="%(album_url)">%(album_name)</a><br/>','<br/>','%(content)','</div>','</div>','</div>','</div>'].join('');function _load_lyric_content(callback,err_callback){var lyric_url="http://music.qq.com/miniportal/static/lyric/" +(song_id%100)+"/"+song_id+".xml";function dealXmlSucc(xmlDom){var obj=null;if(xmlDom.responseXML) obj=xmlDom.responseXML;else obj=xmlDom;var html_lyric="";var text_lyric="";if(obj.selectSingleNode("/lyric")){var origin_lyric=obj.selectSingleNode("/lyric").text;html_lyric=origin_lyric.replace(//[[^/[/]]*/]/g,"<br>").replace(/(<br>/s*){2,}/g,"<br>").trim();text_lyric=html_lyric.unescapeHTML().replace(/<br//?>/ig,"/r/n").trim();} callback(html_lyric,text_lyric);} if(location.host!="music.qq.com"){if(!Element("music_portal_proxy")){var music_portal_proxy=getElementInBody("music_portal_proxy","iframe");music_portal_proxy.src="http://music.qq.com/proxy_ajax.html";music_portal_proxy.style.cssText="width:0px;height:0px;margin-top:0;margin-bottom:0;";} GetDataByAjax("music_portal_proxy",lyric_url,dealXmlSucc,err_callback);}else{Ajax_GetData(lyric_url,dealXmlSucc,err_callback);}} function set_lyric_html(tips_html){var tips_node=tips_html.compileHtml()[0];tips_node.style.display='none';g_lyric_cache[song_id]={tips_elm:tips_node};document.body.appendChild(tips_node);musicTip.showMaskDiv();utils.show(tips_node);} function dealLoadSosoMusicSucc(xmlHttp){var obj=xmlHttp.responseXml;try{var html_lyric="";var text_lyric="";if(obj.selectSingleNode("/lyric")){var origin_lyric=obj.selectSingleNode("/lyric").text;html_lyric=origin_lyric.replace(/<br//>/gi,"<br/>").trim();text_lyric=html_lyric.unescapeHTML().replace(/<br//?>/ig,"/r/n").trim();} if(html_lyric.trim()==""){handle_error(2);return;} var tips_html=utils.format2(lyric_tip_tpl,{song_id:song_id,lyric_content:html_lyric,song_name:info.msong||'',album_name:info.malbum||'',album_url:"##",singer_name:info.msinger||'',singer_url:"##",downloadLyric:"soso.downloadLyric2(gmusic);"});set_lyric_html(tips_html);g_lyric_cache[song_id].lyric_content=text_lyric;}catch(e){handle_error(2);}} function handle_error(_ret){var errmsg='';if(typeof _ret=='undefined'){_ret=1;} if(_ret==1){var sosolyricurl="http://soso.music.qq.com/fcgi-bin/music.fcg?t=10&w=" +(info.msong)+(info.msinger);try{Ajax_GetData(sosolyricurl,dealLoadSosoMusicSucc,null);}catch(e){handle_error(2);} return;}else if(_ret==2){errmsg="暂无歌词";}else{errmsg="系统繁忙,请稍候再试";} var tips_html=utils.format2(err_lyric_tip_tpl,{song_id:song_id,content:errmsg,song_name:info.msong||'',album_name:info.malbum||'',album_url:info.malbumid&&('http://music.qq.com/miniportal/static/album/' +(info.malbumid%100)+'/album_'+info.malbumid+'_1.html')||'#',singer_name:info.msinger||'',singer_url:info.msingerid&&('http://music.qq.com/miniportal/static/singer/' +(info.msingerid%100)+'/singer_' +info.msingerid+'.html')||'#'});set_lyric_html(tips_html);return false;} function getNode(){return info_or_id;} return{show:function(){if(song_id in g_lyric_cache){var elm=g_lyric_cache[song_id].tips_elm;if(elm){utils.show(elm);musicTip.showMaskDiv();return;}} _load_lyric_content(function(html_lyric,text_lyric){if(html_lyric.length==0){return handle_error(1);} var tips_html=utils.format2(lyric_tip_tpl,{song_id:song_id,lyric_content:html_lyric,music_span:"getNode()",song_name:info.msong||'',album_name:info.malbum||'',album_url:info.malbumid&&('http://music.qq.com/miniportal/static/album/' +(info.malbumid%100)+'/album_' +info.malbumid+'_1.html')||'#',singer_name:info.msinger||'',singer_url:info.msingerid&&('http://music.qq.com/miniportal/static/singer/' +(info.msingerid%100)+'/singer_' +info.msingerid+'.html')||'#',downloadLyric:"MulLyricTip(ginfo_or_id).download();return false;"});set_lyric_html(tips_html);g_lyric_cache[song_id].lyric_content=text_lyric;},handle_error);},close:function(){if(soso.showLyricFlag){soso.showLyricFlag=false;} if(song_id in g_lyric_cache){var elm=g_lyric_cache[song_id].tips_elm;if(elm!=null){musicTip.hideMaskDiv();utils.hide(elm);}}},copy:function(elm){if(song_id in g_lyric_cache){var lyric_content=g_lyric_cache[song_id].lyric_content;if(lyric_content) window.clipboardData.setData('text',lyric_content);var copy_tip=elm.parentNode.parentNode.childNodes[1];if(copy_tip) utils.show(copy_tip);setTimeout(function(){utils.hide(copy_tip);},2000);}},download:function(){var url_tpl='http://portalcgi.music.qq.com/fcgi-bin/music_download/cgi_download_lyric.fcg?songid=%(song_id)&song=%(song_name)&singer=%(singer_name)';var url=utils.format2(url_tpl,{song_id:song_id,song_name:info.msong||'',singer_name:info.msinger||''});window.open(url);reportResPv("下载歌词浮出层");}}} var pgvGenTitle;function pgvGenImageUrlForSearch(){var Url;if(typeof(pgvGenImageUrlOrg)=='function'){Url=pgvGenImageUrlOrg();Url=urlParamRep(Url,"url","/miniportal/sososearch_result.html");Url=urlParamRep(Url,"dm","music.qq.com");Url=urlParamRep(Url,"tt",pgvGenTitle);Url=urlParamRep(Url,"rurl","/miniportal/sososearch_result.html");return Url;} return"";} function reportResPv(title){pgvGenTitle=!title?"搜搜结果页PV":title;if(typeof(pgvMain)=='function'){pvRepeatCount=1;pgvGenImageUrlOrg=pgvGenImageUrl;pgvGenImageUrl=pgvGenImageUrlForSearch;pgvMain();pgvGenImageUrl=pgvGenImageUrlOrg;}} function reportIsNotQQ(){var page=getParameter("p");if(page==""){}else if(parseInt(page)!=1){return;} var type=getParameter("t");if(type==8) {}else{var obj=document.getElementsByTagName("table")[0].tBodies[0].childNodes;if(obj[0]){if(obj[0].songtype=="11"||obj[0].songtype=="12"){}else{var uin=Cookie.get("qqmusic_uin");var key=document.getElementById("w").value;var base_url="http://cgi.music.soso.com/fcgi-bin/fcg_tj2.q?msgid=2080000064&num=17&uin=";var url=base_url+uin+"&isVIP="+0+"&reportID="+4 +"&type="+0+"&keyword="+key.replaceUrl() +"&songName="+""+"&singerName="+""+"&albumName=" +""+"&clientX="+0+"&clientY="+0+"&IP="+"" +"&recordDate="+""+"&guin="+""+"&bak1="+0 +"&bak2="+0+"&bak3="+""+"&bak4="+"";var sImag=new Image();sImag.src=url+"&p="+Math.random();sImag.style.width=0;sImag.style.height=0;}}}} function reportNoResult(){if(document.getElementById("w")) {var uin=Cookie.get("qqmusic_uin");var key=document.getElementById("w").value;var base_url="http://cgi.music.soso.com/fcgi-bin/fcg_tj2.q?msgid=2080000064&num=17&uin=";var url=base_url+uin+"&isVIP="+0+"&reportID="+5 +"&type="+0+"&keyword="+key.replaceUrl() +"&songName="+""+"&singerName="+""+"&albumName=" +""+"&clientX="+0+"&clientY="+0+"&IP="+"" +"&recordDate="+""+"&guin="+""+"&bak1="+0 +"&bak2="+0+"&bak3="+""+"&bak4="+"";var sImag=new Image();sImag.src=url+"&p="+Math.random();sImag.style.width=0;sImag.style.height=0;}} function sosoMain(){setTimeout('try{watchSearchCommit();}catch(e){}',0);if(location.host=="music.qq.com") Element("w").focus();if(GetUserStatus()!=1){showElement("rem_pic");}} EventUtil(window,"load",sosoMain);MUSIC.channel.soso.sosoSongTips={sDivId:"soso_song_tips",show_timer:null,hide_timer:null,hide_H_timer:null,mouseY:0,mouseX:0,arrHTML:"",showFlag:false,songOverFlag:false,changeSongSize:function(iSongSize){var singnal=["B","K","M","G"];var strSongSize="";var sizeE=1024;for(var i=0;;i++){if((iSongSize/sizeE)<1){break;} sizeE*=1024;} strSongSize+=iSongSize*1024/sizeE;var index=strSongSize.indexOf(".");try{strSongSize=strSongSize.substring(0,index+3)+singnal[i];}catch(e){strSongSize=strSongSize.substring(0,index+2)+singnal[i];} return strSongSize;},showTips:function(){var oDiv=getElementInBody(this.sDivId,"div",null,null,"sosomusic bor_em c_tx3");if(!oDiv){alert("error in creation div!");return;} oDiv.innerHTML=this.arrHTML;oDiv.style.display="block";oDiv.style.top=this.mouseY;oDiv.style.left=this.mouseX;this.showFlag=false;oDiv.onmouseenter=function(){sosoSongTips.showFlag=true;};oDiv.onmouseleave=function(){sosoSongTips.showFlag=false;sosoSongTips.hideTips();};clearTimeout(this.show_timer);},showSosoSongTips:function(link,event,pparentNode){hideElement(this.sDivId);var music=soso.getSosoMusic(pparentNode);var mouseY=event.clientY;this.mouseX=getPosition(pparentNode.childNodes[2]).left;var iSongSize=this.changeSongSize(parseInt((music.size128)?music.size128:music.msize));var iFormat=music.mformat;var iConnRate=music.mconn;var strSongUrl=music.mshowurl;var strChgSongUrl="";if(strSongUrl.length>40) {strChgSongUrl=strSongUrl.substr(0,33)+"..." +strSongUrl.substring(strSongUrl.length-5);}else{strChgSongUrl=strSongUrl;} if(mouseY>362){mouseY-=100;} this.mouseY=mouseY;this.arrHTML="";this.arrHTML+="<h3 class=/"title bg4 c_tx1/">歌曲信息</h3>" +"<a href="/" mce_href="/""javascript:void(0)/" title=/"关闭/" onclick=/"document.getElementById('soso_song_tips').style.display='none'/" class=/"bt_close/">关闭</a><div class=/"info_box/"><ul><li class=/"size/">大小:" +iSongSize +"</li><li class=/"format/">格式:" +iFormat +"</li><li class=/"speed/">连通率:<div class=/"speedbar/"><img style="/" mce_style="/""width: " +iConnRate +"%;/" src="/" mce_src="/""http://imgcache.qq.com/musicportal_v2/img/_g_bg.png/" alt=/"soso/" /></div></li><li class=/"source/">来源:<a href="/" mce_href="/""javascript:void(0)/" onclick=/"SoSoDownLoadSong2('" +music.msong.encodeURLSymbol() +"','" +music.msinger.encodeURLSymbol() +"','" +music.malbum +"','" +music.msongurl +"','" +music.msize +"','" +music.mformat +"');closeVipFloat();return false;/"/>" +strChgSongUrl +"</a></li></ul></div>" +"<div class=/"copyright_tips/">版权声明:SOSO音乐搜索,所有搜索内容来自其他网站</div>";this.songOverFlag=true;this.show_timer=setTimeout("sosoSongTips.showTips();",500);},hideSosoSongTips:function(){this.songOverFlag=false;this.hide_H_timer=setTimeout("sosoSongTips.hideTips();",500);},hideTips:function(){if((!this.showFlag)&&(!this.songOverFlag)){hideElement(this.sDivId);} clearTimeout(this.hide_H_timer);}} var sosoSongTips=MUSIC.channel.soso.sosoSongTips;function watchSearchCommit(){var url="http://isdspeed.qq.com/cgi-bin/r.cgi?flag1=170&flag2=106";var basepoint=parseInt(getParameter("ctime"));var cssTime=g_WatchJsBegin-g_watchCssTime;var jsTime=g_WatchPageBegin-g_WatchJsBegin;var pageTime=g_WatchPageEnd-g_WatchPageBegin;var totalTime;if(basepoint<0||isNaN(basepoint)){totalTime=g_WatchPageEnd-g_watchCssTime;url+="&flag3="+1;url+="&flag4="+1;url+="&1="+totalTime;url+="&2="+cssTime+"&3="+jsTime;url+="&4="+pageTime;}else{basepoint*=1000;var cookiePoint=parseInt(Cookie.get("TIMEPOINT_FOR_CLIENT"));if(cookiePoint==basepoint){return;} Cookie.domain="music.qq.com" Cookie.set("TIMEPOINT_FOR_CLIENT",basepoint);totalTime=g_WatchPageEnd-basepoint;var jumpTime=g_watchCssTime-basepoint;url+="&flag3="+2;url+="&flag4="+1;url+="&1="+totalTime;url+="&2="+jumpTime+"&3="+cssTime+"&4="+jsTime;url+="&5="+pageTime;} var imgsrc=new Image() imgsrc.src=url;} var LongTailDomain=new Array("file.itingsong.com","file.51tingsong.com");