function Music(){this.init()}!function(){var o=[],p=[],a=null;Music.prototype={total:70,pageSize:10,dataUrl:"http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.common",playerUrl:"http://box.baidu.com/widget/flash/bdspacesong.swf",init:function(){var s=this;domUtils.on($G("J_searchName"),"keyup",function(e){13==(window.event||e).keyCode&&s.dosearch()}),domUtils.on($G("J_searchBtn"),"click",function(){s.dosearch()})},callback:function(e){var s=this;s.data=e.song_list,setTimeout(function(){$G("J_resultBar").innerHTML=s._renderTemplate(e.song_list)},300)},dosearch:function(){a=null;var e=$G("J_searchName").value;if(""==utils.trim(e))return!1;e=encodeURIComponent(e),this._sent(e)},doselect:function(e){"object"==typeof e?a=e:"number"==typeof e&&(a=this.data[e])},onpageclick:function(e){for(var s=0;s',utils.loadFile(document,{src:this.dataUrl+"&query="+e+"&page_size="+this.total+"&callback=music.callback&.r="+Math.random(),tag:"script",type:"text/javascript",defer:"defer"})},_removeHtml:function(e){return e.replace(/<\s*\/?\s*[^>]*\s*>/gi,"")},_getUrl:function(e){var s=this,t="from=tiebasongwidget&url=&name="+encodeURIComponent(s._removeHtml(a.title))+"&artist="+encodeURIComponent(s._removeHtml(a.author))+"&extra="+encodeURIComponent(s._removeHtml(a.album_title))+"&autoPlay="+e+"&loop=true";return s.playerUrl+"?"+t},_getTryingElem:function(){for(var e=$G("J_listPanel").getElementsByTagName("span"),s=0;s'+lang.emptyTxt+"";e=s._rebuildData(e);var t=[],a=[],n=[];t.push('
'),a.push('
');for(var i,l=0;i=e[l++];){p.push("panel"+l),o.push("page"+l),1==l?(t.push('
'),1!=e.length&&n.push('
'+l+"
")):(t.push('
'),n.push('
'+l+"
")),t.push('
'),t.push('
'+lang.chapter+''+lang.singer+''+lang.special+''+lang.listenTest+"
");for(var r,c=0;r=i[c++];)t.push('");t.push("
"),t.push("
")}return n.reverse(),a.push(n.join("")),t.push("
"),a.push("
"),t.join("")+a.join("")},exec:function(){null!=a&&($G("J_preview").innerHTML="",editor.execCommand("music",{url:this._getUrl(!1),width:400,height:95}))}}}();