function getIds(){ var els = arguments[0]; var len = els.length; var str = new Array(); $.each(els,function(i,n){str[i]=n.value;}); return str.join("_"); }; function strLen(str) { var charset = document.charset; var len = 0; for(var i = 0; i < str.length; i++) { len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == "utf-8" ? 3 : 2) : 1; } return len; }; var JWSite=new Object(); JWSite.Cookie={ set:function(name,value,path){ var expires=new Date(new Date().getTime()+(120*3600*200*7)); var domain=web_domain;//var domain=top.location.hostname; document.cookie=name+"="+value+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"; path=/")+((domain)?";domain="+domain:""); }, set2:function(name,value,path,time){ var expires=new Date(new Date().getTime()+time); var domain=web_domain;//var domain=top.location.hostname; document.cookie=name+"="+value+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"; path=/")+((domain)?";domain="+domain:""); }, get:function(name){var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)")); if(arr!=null){return unescape(arr[2]);} return null;} }; function addplay(url){ var ifplay=JWSite.Cookie.get("cxjw_ifplay"); if(ifplay=="1"){ JWSite.Cookie.set("cxjw_addplay",formatStr(url),"/"); do_alert("已经添加到“临时列表”"); }else{ var pdwids=url.split("_"); if(web_html=="0"){ window.open(""+web_url+"play/"+pdwids[0]+web_asphtml+"","play"); JWSite.Cookie.set("cxjw_addplay",formatStr(url.replace(pdwids[0]+'_','')),"/"); }else{ window.open(""+web_url+"?play_"+pdwids[0]+web_asphtml+"","play"); JWSite.Cookie.set("cxjw_addplay",formatStr(url.replace(pdwids[0]+'_','')),"/"); } } } function clk(a,b){ var part = b; var els = $("#" + part + ' ul')[0]; if(a=="all"){ $("input",els).attr("checked","checked"); }else if(a=="un") $.grep($("input",els),function(el){el.checked=el.checked?"":"checked";}); else if(a=="play"){ var getE = $.grep($("input",els),function(el){return el.checked;}); var len = getE.length; if(len == 0){do_alert("请先选择歌曲,再进行连播");return false;} if ( 1 == JWSite.Cookie.get("cxjw_ifplay") ){ JWSite.Cookie.set("cxjw_addplay",formatStr(getIds(getE)),"/"); do_alert('已经添加到“临时列表”'); $("input",els).attr("checked",""); }else{ var pdwids=getIds(getE).split("_"); if(web_html=="0"){ window.open(''+web_url+'play/' + pdwids[0] + web_asphtml + '', 'play'); JWSite.Cookie.set("cxjw_addplay",formatStr(getIds(getE).replace(pdwids[0]+'_','')),"/"); }else{ window.open(''+web_url+'?play_' + pdwids[0] + web_asphtml + '', 'play'); JWSite.Cookie.set("cxjw_addplay",formatStr(getIds(getE).replace(pdwids[0]+'_','')),"/"); } $("input",els).attr("checked",""); } }else if(a=="add"){ var getE = $.grep($("input",els),function(el){return el.checked;}); var len = getE.length; if(len == 0){do_alert("请选择添加歌曲");return false;} if ( 1 == JWSite.Cookie.get("cxjw_ifplay") ){ JWSite.Cookie.set("cxjw_addplay",formatStr(getIds(getE)),"/"); do_alert('已经添加到“临时列表”'); $("input",els).attr("checked",""); }else{ var pdwids=getIds(getE).split("_"); if(web_html=="0"){ window.open(''+web_url+'play/' + pdwids[0] + web_asphtml + '', 'play'); JWSite.Cookie.set("cxjw_addplay",formatStr(getIds(getE).replace(pdwids[0]+'_','')),"/"); }else{ window.open(''+web_url+'?play_' + pdwids[0] + web_asphtml + '', 'play'); JWSite.Cookie.set("cxjw_addplay",formatStr(getIds(getE).replace(pdwids[0]+'_','')),"/"); } $("input",els).attr("checked",""); } } } function formatStr(str){ str=str.replace(/(ling)/g,"0"); str=str.replace(/(yi)/g,"1"); str=str.replace(/(er)/g,"2"); str=str.replace(/(san)/g,"3"); str=str.replace(/(si)/g,"4"); str=str.replace(/(wu)/g,"5"); str=str.replace(/(liu)/g,"6"); str=str.replace(/(qi)/g,"7"); str=str.replace(/(ba)/g,"8"); str=str.replace(/(jiu)/g,"9"); return str; } document.write(''); document.write(''); //document.write('self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);'); //document.write('if(top.location!==self.location){top.location=self.location;}');