﻿if(document.URL.toLowerCase().indexOf("666ccc.com")!=-1)document.domain="666ccc.com";
focus();
//if (top.location != self.location) {top.location=self.location;window.external.addFavorite('http://www.666ccc.com','今生缘音乐网');}
var $song_Lrc = new Array();
var $data_Url = new Array();
var id_list=0;
var id_list_play=0;
var id_list_fy=1;
var song_play_id=0;
var song_qumu_id=0;
var fast=false;
var maxperpage=17;
var buffering=0,stoped=0,linking=0;
var totalpage=1,currentPage=1;
var $referrer=document.referrer;
var _url = "http://www.666ccc.com/";
var playlrcid;
var isIE=document.all? true:false;
var wmaaddr = "";
var JKSite=new Object();
var s = "";
var gg="";

function getTime(str)
{
	var time =0;
	var ta = str.split(":");
	if(ta.length<2)
		return time;

	if(ta[1].indexOf(".")>0){
		var tb = ta[1].split(".");
		time = ta[0]*60*1000+tb[0]*1000+tb[1]*10;
	}
	else{
		time =ta[0]*60*1000+ta[1]*1000;
	}
	return time;	//	parseInt(time/1000)
}

JKSite.Cookie={
	set:function(name,value,path){
		var expires=new Date(new Date().getTime()+(120*3600*200*7));
		var domain="666ccc.com";
		//alert(name+"="+value+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"; path=/")+((domain)?";domain="+domain:""));
		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 IsNum(s){return(new RegExp(/^(\+|-)?(0|[1-9]\d*)(\.\d*[1-9])?$/).test(s));}
function formatFloat(src, pos){ var gyc= Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);if(src>gyc){return gyc+1;}else{return gyc;}}
function $waitbehind(b){document.getElementById('song_list').innerHTML= '<div id="landing"><div id="lan"><div class="h3"><p>'+b+'</p></div></div></div>';}
function User_landing(b){
var html = '<div id="landing"><div id="lan"><div class="h2">会员登录</div>';
if(b){html +='<div class="h4" id="landing_error">'+b+'</div>';}
html +=' <form action="" method="POST" onSubmit="return User_attestation(this);"><div class="h3">用户名称：  <input name="username" type="text" id="username" value="" size="15" /></div><div class="h3">登录密码： <input name="password" type="password" id="password" value="" size="15" /></div><div class="h5"><input type="submit" id="B12" class="bu ok" value="登 录"/>  <input type="button" class="bu ok" id="B13" onclick="javascript:window.open(\'http://box.666ccc.com/reg.htm\',\'_blank\',\'\')" value="注 册"/></div></form></div></div>';
document.getElementById('song_list').innerHTML= html;
}
function User_attestation(b){
if (b.username.value == "") {document.getElementById('landing_error').innerHTML='<span style="color: #009900">注意！</span><br />请输入会员名称。';b.username.focus(); return (false); } 
if (b.password.value == "") {document.getElementById('landing_error').innerHTML='<span style="color: #009900">注意！</span><br />请输入登录密码。';b.password.focus(); return (false); } 
b.B12.disabled=true;b.B13.disabled=true;
var url = "http://box.666ccc.com/UserBoxMini.asp?Action=showmusic&username="+ escape(b.username.value) + "&password=" + escape(b.password.value) +"&s=";
$waitbehind('正在登录，请稍候....');
$download(url);
return (false);
}
function slTop(b){
	document.getElementById("song_list").scrollTop=b;
}
function ctlent(hf){
	var ie = (document.all)? true:false;
	if (ie){
		if(event.ctrlKey && window.event.keyCode==13){
			document.getElementById('bofang').value='1';
			optlist(3);
			document.getElementById('bofang').value='0';
		}
	}
}
function imgadd(imgid){
	document.getElementById("addimg"+imgid).src="/2009/i/no-add.gif";
}
function song_list(x,fi){
	this._ad = function(u,w,h){
		return '<div class="ad" style="text-align:center;width:'+w+'px"><iframe MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="0" SCROLLING="no" src="'+u+'" width="'+w+'" height="'+h+'"></iframe></div>';
	};
	x=parseInt(x);
	fi=parseInt(fi);
	eval("id_list_fy=fi");
	if(x==id_list){
		var listHtml='';
		var ni=maxperpage;
		var ki=0;
if($song_data[x]){
	var song_data = $song_data[x].split('||');
	var n=song_data.length-1
	var gy=formatFloat(n/ni, 0);
	if(fi>gy){
		fi=gy;
	}
	if(fi>1){
		ki=ni*(fi-1);
	}
	if(n>ni){
		ni=ni*fi;
	}
	if(ni>n){
		ni=n;
	}
	var ii;
	for(var i = ki;i < ni;i++){
		ii=i+1;
		if (ii<10){
			ii="0"+ii;
		}
		var song_n = song_data[i].split('|');
		if(x==0){
			listHtml += '<ul id="song_'+song_n[0]+'_p" onMouseOut="pu.MouseOut(this,'+i+');pu.hideDelIcon(this,'+i+');" onMouseOver="pu.MouseOver(this,'+i+');pu.showDelIcon(this,'+i+');"'
		}else{
			listHtml += '<ul id="song_'+song_n[0]+'_p" onMouseOut="pu.MouseOut(this,'+i+');" onMouseOver="pu.MouseOver(this,'+i+');"'
		}
		var curplaystr="";
		if(song_n[0]==song_play_id && x==id_list_play){
			listHtml += ' class="a"';curplaystr="checked";
		}
		//listHtml += '><li class="a"><input name="id" type="checkbox" id="id" value="'+song_n[0]+'|'+i+'" />';
		listHtml += '><li class="a">';
		/*if(curplaystr==""){}else{listHtml+='<img src="/2009/i/nowplay.gif" border=0>';}*/
		listHtml += '<input name="id" type="checkbox" id="id" value="'+song_data[i]+'||'+i+'" />';
		listHtml += '<a onClick="pu.utils('+id_list+','+i+',1);" title="歌手：'+song_n[3]+'&#10;歌曲：'+song_n[1]+'" style="CURSOR: pointer" class="light"><span>'+ii+'.</span>'+song_n[1]+'</a></li>';
		listHtml += '<li class="b"><a href="'+_url+'allsong/'+song_n[2]+'.htm"  target="_blank"><span style="COLOR:#36c;">'+song_n[3]+'</span></a></li>';
		if(x==0){
			listHtml+='<li class="c" style="display:none;">';
		}else{
			listHtml+='<li class="c">';
		}
		if(x==0){
			/*if(curplaystr=="")*/
			listHtml += '<a onClick="pu.DelPlayer('+i+');" style="CURSOR: pointer" title="删除"><img src="/2009/i/del.gif" style="margin-top: 8px;" alt="删除" ></a>';
		}else{
			listHtml += '<a ';
			if($song_data[0].indexOf(song_data[i]+'||')==-1){
				listHtml += 'onClick="pu.$AddPlayer(\''+song_data[i]+'||\');" style="CURSOR: pointer" title="添加到“临时列表”">';
			}else{
				listHtml+=' style="CURSOR: pointer" title="已添加到“临时列表”">';
			}
			listHtml += '<span style="';
			if($song_data[0].indexOf(song_data[i]+'||')==-1){
				imgstr="add";listHtml += 'COLOR:#0066FF';
			}else{
				imgstr="no-add";listHtml += 'COLOR:#999999';
			}
			listHtml +='" onClick="imgadd('+i+');"><img id="addimg'+i+'" style="margin-top: 8px;" src="/2009/i/'+imgstr+'.gif"></span></a>';
		}
		listHtml += '</li></ul>';
	}
	if(x==3&&totalpage>1){
		//搜索其他页
		var tiaoHtml = '<select onChange="searchnextpage(this.options[this.selectedIndex].value);slTop(0)">';
		for(var ti = 1;ti <= totalpage;ti++){
			if(currentPage==ti){
				tiaoHtml += '<option value="'+ti+'" selected>'+ti+'</option>';
			}else{
				tiaoHtml += '<option value="'+ti+'">'+ti+'</option>';
		}
	}
	tiaoHtml += '</select>';
	listHtml += '<div class="x"><span>共'+(totalpage)+'/'+tiaoHtml+'页</span>';
	if(currentPage==1){
		listHtml += '上一页 ';
	}else{
		listHtml += '<a onClick="searchnextpage('+(currentPage-1)+');slTop(0)" style="CURSOR: pointer">上一页</a> ';
	}
	if(currentPage==totalpage){
		listHtml += '下一页';
	}else{
		listHtml += '<a onClick="searchnextpage('+(currentPage+1)+');slTop(0)" style="CURSOR: pointer">下一页</a>';
	}
	listHtml +='</div>';
	//搜索页结束
}else{
	if(gy!=1){
		var tiaoHtml = '<select onChange="song_list('+x+',this.options[this.selectedIndex].value);slTop(0)">';
		for(var ti = 1;ti < gy+1;ti++){
			if(fi==ti){
				tiaoHtml += '<option value="'+ti+'" selected>'+ti+'</option>';
			}else{
				tiaoHtml += '<option value="'+ti+'">'+ti+'</option>';
			}
		}
		tiaoHtml += '</select>';
		listHtml += '<div class="x"><span>共'+(gy)+'/'+tiaoHtml+'页</span>';
		if(fi==1){
			listHtml += '上一页 ';
		}else{
			listHtml += '<a onClick="song_list('+x+','+(fi-1)+');slTop(0)" style="CURSOR: pointer">上一页</a> ';
		}
		if(fi==gy){
			listHtml += '下一页';
		}else{
			listHtml += '<a onClick="song_list('+x+','+(fi+1)+');slTop(0)" style="CURSOR: pointer">下一页</a>';
		}
		listHtml +='</div>';
	}else{
		//临时列表广告
		if(n<=5){
			//listHtml += _ad('/2009/hezuo/p_161305.htm',150,300)
		}
	}
}
document.getElementById('song_list').innerHTML=listHtml;

}else{
	document.getElementById('song_list').innerHTML='<p class="el">没找到歌曲</p>';
}
}
if(x==3){
	var qString = new String(document.getElementById('key').value);var keywords = qString.split(" ");
	/*setAllColor('light', keywords, 'CC0033');*/
}
}
function searchnextpage(pages){
	currentPage=pages;
	optlist(3);
	return (false);	
}
function $download(URL){
	Tag = document.createElement("script");
	Tag.type="text/javascript";
	Tag.src=URL;
	document.getElementsByTagName("head")[0].appendChild(Tag);
}
function so_jk(){
	var select1 = document.getElementById('select').value;
	//弹窗搜索方式已被去掉
	if (select1 != "default") {
		var key = document.getElementById('key').value;
		var bofang = document.getElementById('bofang').value;
		window.open("http://so.666ccc.com/music/s/?key="+key,"_blank");
		return false;
	}
	optlist(3);
	return false;
}
function optlist(n){
	slTop(0);
	var num = 	new Date().getTime();
	this._download1 = function(st){
		if(st==id_list_play){
			song_list(st,formatFloat((song_qumu_id+1)/50, 0));
		}else{
			song_list(st,1);
		}
	};
	this._download2 = function(st,URL){
		if(!$song_data[st]){
			$data_Url[st]='';
		}
		if(st>0 && $data_Url[st]!=URL){
			$waitbehind('获取歌曲数据 请稍候...');
			$download(URL);
			eval("$data_Url[st]=URL");
		}else{
			this._download1(st);
		}
	};
	this.download_data = function(st,URL){
		if(st==1){
			if(st!=id_list_play){
				this._download2(st,URL);
			}else{
				this._download1(st);
			}
		}else{
			this._download2(st,URL);
		}
	};
	document.getElementById('song_list').innerHTML='';
	if(document.getElementById(id_list+'_list'))document.getElementById(id_list+'_list').className="";
	document.getElementById(n+'_list').className="a";
	if(n!=id_list_play){
		if(document.getElementById(id_list_play+'_list'))document.getElementById(id_list_play+'_list').className="b";
	}
	eval("id_list=n");
	if(n==0){
		song_list(0,1);
	}else if(n==1){
		var url="dd";
	}else if(n==2){
		var url = "http://box.666ccc.com/UserBoxMini.asp?Action=iflogin&"+num;
	}else if(n==3){
		var key = document.getElementById('key').value;
		var bofang = document.getElementById('bofang').value;
		if (key == "" || key == "输入关键字进行搜索") {
			document.getElementById('song_list').innerHTML='<p class="el"><span style="color: #FF0000">请输入关键字 ！</span></p>';
			return false;
		}
		var url = _url+"2009/getser.asp?key="+escape(key)+"&page="+currentPage;
	}else if(n>3){
		var url = _url+"2009/music/"+n+".js";
	}
	var x_list = 'onMouseOut="this.className=\'bu ok\'" onMouseOver="this.className=\'bu ok1\'"'
	var c_list = '<input type="button" class="bu ok" value="全，反选" onclick="clk(\'reverse\',\'song_list\');" '+x_list+'/>';
	c_list += '<input type="button" class="bu ok" ';
	if(n==0){
		c_list += 'value="删除播放" title="将选择删除" onclick="clk(\'playdel\',\'song_list\');';
	}else{
		if(n==1){
			c_list += 'value="删除所选" title="删除选中的歌曲" onclick="clk(\'delsel\',\'song_list\');';
		}else{
			c_list += 'value="加入列表" title="将选择的歌曲加入“临时列表”" onclick="clk(\'playadd\',\'song_list\');';
		}
	}
	c_list += '"'+x_list+'/>';
	if(n==0){c_list += '<input type="button" class="bu ok" value="批量收藏" title="快速批量收藏歌曲" onclick="clk(\'plsc\',\'song_list\');"'+x_list+'/>';}
	if(n==1){c_list += '<input type="button" class="bu ok" value="清空所有" title="清理所有历史播放记录" onclick="delcok();"'+x_list+'/>';}
	if(n==2){c_list += '<input type="button" class="bu ok" value="删除收藏" title="删除我收藏的歌曲" onclick="clk(\'delfav\',\'song_list\');"'+x_list+'/>';}
	if(n>2)c_list += '<input type="button" class="bu ok" value="连续播放" onclick="clk(\'play\',\'song_list\');" '+x_list+'/>';
	document.getElementById('control_list').innerHTML=c_list;
if(url=="dd"){
	//music_list(document.cookie);
	var str=document.cookie;
	var num_start=str.indexOf("l_music");
	if(num_start!=-1){
		var num_end=str.indexOf("l_end");
		if(num_end>num_start){
			var str_list=str.substring(num_start,num_end).replace(/l_music=/ig,"");
			var arr_list=str_list.split(",");
			if(arr_list.length>0){
				var myDate = new Date();
				var url=_url+"2009/Url.asp?id="+str_list+"&t="+myDate.getMilliseconds();
				this.download_data(n,url);

				//下面是一个一个歌读取的模式，较慢
				//for(i=0;i<arr_list.length;i++){
				//	var str_ti=arr_list[i];
				//	if(str_ti!=undefined||str_ti!="undefined"||str_ti!=null||str_ti!=""){
				//		//var url="/url/s9.js"
				//		//var url=_url+"2009/Url.asp?musicid="+str_ti";
				//		//this.download_data(n,url);
				//	}
				//}
			}			
		}else{
			$song_data[1]='';
		}
	}else{
		$song_data[1]='';
	}
}else{
	this.download_data(n,url);
}
return false;
}
function PlayerUtils(){
var p = 0;
var song_id;
var singer_id;
var song_u = new Array();
var rnd_id=0;
var total=0;
var lrctimea=9999999;
var Stat_drag=0;
var Stat_Time=0;
var Stat_inn='-1';
var Stat_num='';
var utils_s=0;
var stnum = 1190351137140;
var stnumk = 0;

//document.getElementById('other').innerHTML='<a href="'+_url+'player.htm" target="jk_play"><span style="color: #0063C6">随机播放</span></a> <a href="http://my.666ccc.com/gbook/index.asp" target="_blank"><span style="color: #0063C6">意见反馈</span></a>';

this.MouseOver = function(c,d){c.style.backgroundColor="#b5cfff";};
this.MouseOut = function(c,d){c.style.backgroundColor="";};
this.showDelIcon = function(c,d){c.getElementsByTagName("li")[2].style.display="block";};
this.hideDelIcon = function(c,d){c.getElementsByTagName("li")[2].style.display="none";};
this.func_ad3 = function(t){document.getElementById('ad3').innerHTML='<iframe MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="0" SCROLLING="no" src="" width="300" height="257"></iframe>'};
this.DelPlayer = function(d){
	d += '_';
	var x = d.split('_');
	var c = $song_data[0];
	for(var i = 0;i < x.length-1;i++){
		c=c.replace($song_data[0].split('||')[parseInt(x[i])]+'||','');
		if(p>=parseInt(x[i])){
			p=p-1;
		}
	}
	$song_data[0]=c;
	total=c.split('||').length-1;
	song_list(0,id_list_fy);
};
this.DelPlayer_cok = function(d){
	d += '_';
	var x = d.split('_');
	var c = $song_data[1];
	for(var i = 0;i < x.length-1;i++){
		c=c.replace($song_data[1].split('||')[parseInt(x[i])]+'||','');
		if(p>=parseInt(x[i])){
			p=p-1;
		}
	}
	$song_data[1]=c;
	total=c.split('||').length-1;
	song_list(1,id_list_fy);
};
this.DelPlayer_fav = function(d){
	d += '_';
	var x = d.split('_');
	var c = $song_data[2];
	for(var i = 0;i < x.length-1;i++){
		c=c.replace($song_data[2].split('||')[parseInt(x[i])]+'||','');
		if(p>=parseInt(x[i])){
			p=p-1;
		}
	}
	$song_data[2]=c;
	total=c.split('||').length-1;
	song_list(2,id_list_fy);
};
this.$AddPlayer =function(cli){
	if (cli) {
		if (total==1 && id_list_play==0){
			document.getElementById('Playleixin').value=0;
		}
		var dc= $song_data[0];
		if($song_data[0].indexOf(cli)==-1)$song_data[0]= dc + cli;
		total=$song_data[0].split('||').length-1;
		if (id_list==0){optlist(0);}
	}
};
this.AddPlayer = function(id){
	if (id) {
		JKSite.Cookie.set("jk_addplay","","/");
		id="@0_"+id+"_0@";
		var song_data = $song_data[0].split('||');
		for(var i = 0; i < song_data.length; i++){
			id=id.replace('_'+song_data[i].split('|')[0]+'_','_');
		}
		id=id.replace('_0@','').replace('@0_','').replace('@0','');
		if (id) {
			var myDate = new Date();
			var url=_url+"2009/UrlAdd.asp?id="+id+"&t="+myDate.getMilliseconds();
			$download(url);
			//alert(id);
			//var idss=id.split("_");
			//for(var is=0;is<idss.length;is++){
			//	$download(_url+"s8/"+idss[is]+".js");
			//}
		}
	}
};
this.$AddPlayer_cok =function(cli){
	if (cli) {
		var dc= $song_data[1];
		if($song_data[1].indexOf(cli)==-1)$song_data[1]= cli+dc;
	}
};
this._Stat_go =function(){
	Stat_drag=0;Stat_Time=0;
	Stat_num = new Date().getTime();
	if(Stat_inn=='-1'){
		Stat_inn=0;pu.Stat_go();
	}
	Stat_inn=0;
};
this.Stat_go =function(){
	if(90==Stat_inn && Stat_drag==0){
		var num = new Date().getTime();
	}
};
this.ssPlay = function(){
fast=false;	
var leixin=document.getElementById('Playleixin').value;
/*播放器状态检测*/
var jiuku=document.getElementById("Exobud");
var currentZt = jiuku.playState;
switch(currentZt){
	case 10:		//准备就绪
		//reloadpage();
		this.PlayNext(1);
		break;
	case 9:			//正在连接
		linking+=2;
		if(linking>=12){
			linking=0;
			//reloadpage();
			this.PlayNext(1);
		}
		break;
	case 6:			//正在缓冲
		buffering+=2;
		//if(buffering>=12){
			//buffering=0;
			//reloadpage();
			//this.PlayNext(0);
		//}
		break;
	case 3:			//正在播放		
		buffering=0;
		stoped=0;
		linking=0;
		break;
	case 2:			//暂停
		break;
	case 1:			//播放完停止了
		if(leixin==0){this.PlayNext(1);
		}else if(leixin==1){
			this.PlayNext(0);
		}else if(leixin==2){
			this.utils(id_list_play,rnd_id,0);
		}
		break;
	default:		//其他
		stoped+=2;
		if(stoped>=12){
			stoped=0;
			//reloadpage();
			this.PlayNext(0);
		}
		break;
}
/*检测结束*/
if(leixin==2){if(rnd_id>=total-1){rnd_id=0;}else{rnd_id++;}}
this.AddPlayer(JKSite.Cookie.get("jk_addplay"));
//if(stnumk>2){
//}else{
setTimeout("pu.ssPlay()", 2000); 
//}
};
this._Next = function(t){p += t;
if(p>(total-1)){p = 0;}else if(p<0){p = (total-1);}
this.utils(id_list_play,p,0);};
this.PlayNext = function(t){buffering=0;stoped=0;linking=0;this._Next(t);};
this.utils = function(t,r,s){
clearTimeout(playlrcid);
playlrcid = setTimeout("pu.PlayLrc()", 200);
if(fast){return(false);}
fast=true;
if(t!=id_list){document.getElementById(t+'_list').className="b";}
if(t!=id_list_play){document.getElementById(id_list_play+'_list').className="";}
if($song_data[t]){
var song_data = $song_data[t].split('||');
total=song_data.length-1;
song_u = song_data[r].split('|');
var num = 	new Date().getTime();
var url=song_u[4].replace("//","/");

wmaaddr=url;
document.getElementById("Exobud").URL = DzUrl+url;
if((num-stnum)>3000){stnumk=0;}else{stnumk++;}
stnum=num;
document.getElementById('play_title').innerHTML='歌曲：<a href="'+_url+'play/'+song_u[2]+'/'+song_u[0]+'.htm" target="jk_play">'+song_u[1]+'</a> 歌手：<a href="'+_url+'allsong/'+song_u[2]+'.htm" target="_blank">'+song_u[3]+'</a> <span><a href="http://cnc.666ccc.com/ErrMsg.html?musicid='+song_u[0]+'" target="_blank">报错</a></span>';
//document.getElementById('adright2').setAttribute('src', '/2009/hezuo/right2_taobaoke.htm?t='+new Date().getTime());
Singer=song_u[3];MusicName=song_u[1];
//if(s!=2&&s!=3){}
document.title = song_u[1] +' '+song_u[3]+' - mp3下载 - 歌曲试听 - 今生缘音乐网';
document.getElementById("ad3").innerHTML='<iframe  src="/2009/youday/300300/08111107539837608924.htm?id=08111107539837608924&songname='+escape(song_u[1])+'&webownerId=19524&childid=10000" width=305 height=301 marginheight=0 marginwidth=0 frameborder=0 scrolling=NO></iframe>';
p = r;
utils_s = s;
this._Stat_go();
this.changeBg(r,t,song_id,song_u[0]);
this.listBg(t,id_list,id_list_play);
this.downloadlrc(song_u[0],song_u[2]);
//cokstr=song_u[0]+"|"+encodeURI(song_u[1])+"|"+song_u[2]+"|"+encodeURI(song_u[3])+"|"+song_u[4]+"";
cokstr=song_u[0];
write_cookie(document.cookie);//this.Playerhistory(song_u[0]);
/*if(song_id!=song_u[0]){this.func_ad3(song_u[1]);}*/
song_id=song_u[0];
singer_id=song_u[2];
eval("song_qumu_id=r");eval("song_play_id=song_id");eval("id_list_play=t");
if(t==id_list){
var gy=formatFloat((r+1)/maxperpage, 0);
//song_list(t,gy);
}
}
};
this.changeBg = function(r,t,song_id,song_u) {
if(t==id_list){
var gy=formatFloat((r+1)/maxperpage, 0);
if(gy==1){xx=(r-0);}else{xx=r-(maxperpage*(gy-1));}
if(gy==id_list_fy){slTop((xx-5)*22);}
if(gy!=formatFloat((song_qumu_id+1)/maxperpage, 0)){song_list(t,gy);}
try {document.getElementById('song_'+song_id+'_p').className="";} catch (e) {}
try {document.getElementById('song_'+song_u+'_p').className="a";} catch (e) {}
}
};
this.listBg = function(t,a,b) {
if(t!=a){document.getElementById(t+'_list').className="b";}
if(t!=b){if(document.getElementById(id_list_play+'_list'))document.getElementById(id_list_play+'_list').className="";}};
this.Playerhistory = function(id){
var flag = id+',';
var history= ','+JKSite.Cookie.get("Playerhistory")+',';history = history.replace(','+flag,",");history = flag + history;var history_data = history.split(',');if(history_data.length){
var historyc="";var n=0;
for(var i = 0;i < history_data.length;i++){if(IsNum(history_data[i])&&50>n){historyc += history_data[i]+',';n++;}}
historyc = historyc.substring(0,historyc.length-1);
JKSite.Cookie.set("Playerhistory",historyc,"/play");
}
};
this.led = function (s1,s2,s3,s4,s5,s6,s7){
	document.getElementById("LR1").innerHTML=s1;
	document.getElementById("LR2").innerHTML=s2;
	document.getElementById("LR3").innerHTML=s3;
	document.getElementById("LR4").innerHTML=s4;
	document.getElementById("LR5").innerHTML=s5;
	document.getElementById("LR6").innerHTML=s6;
	document.getElementById("LR7").innerHTML=s7;
};
this.downloadlrc = function(t,t2) {
	if(!$song_Lrc[t]){
		this.led('','','','正在载入歌词...','','','');
		$download(_url+'lrc2009/'+t2+'/'+t+'.js');
	}
lrctimea=9999999;
};
this.doSp = function (oT){
	if(oT>1){
		document.getElementById("Exobud").controls.currentPosition=oT;
	}
};
this.lrci = function (xi,i){
	if(_t[i]){
		document.getElementById(xi).innerHTML = '<a style="CURSOR: pointer" onclick="pu.doSp(\''+_t[i].split("|||")[0]+'\')" >'+_t[i].split("|||")[1]+'</a>';
	}else{
		document.getElementById(xi).innerHTML = '';
	}
};
this.PlayLrc = function (){
	var nolrc=false;
	if($song_Lrc[song_id]){
	try {
		var curTime = parseInt(document.getElementById("Exobud").controls.currentPosition*1000+500);
	} catch (e) {
		var curTime = 0;
	}
	if(Stat_drag==1|| curTime-1000>Stat_Time || Stat_Time>curTime){
		Stat_drag=1;
	}else{
		Stat_drag=0;
	}
	Stat_Time=curTime;
	if($song_Lrc[song_id]==0 || $song_Lrc[song_id].indexOf("暂无[/]")!=-1){
		if(9999999 == lrctimea){
			this.led('','<span style="color: #FF9900">歌手：'+song_u[3]+'</span>','<span style="color: #FF9900">歌曲：'+song_u[1]+'</span>','<a href="http://cnc.666ccc.com/LrcPost.html?id='+song_u[0]+'" target="_blank">没找到相关歌词,我来添加</a>','','','');
			document.getElementById("txtword").style.display="none";
			document.getElementById("lyric").style.display="block";
		}
		lrctimea=0;
		nolrc=false;
	}else if($song_Lrc[song_id].indexOf("文本歌词[/]")!=-1){
		lrctimea=0;
		nolrc=true;
		document.getElementById("lyric").style.display="none";
		document.getElementById("txtword").style.display="block";
		document.getElementById("txtword").innerHTML= '此歌词为文本歌词，不会动。<a href="http://cnc.666ccc.com/LrcPost.html?id='+song_u[0]+'" target="_blank">我要更新此歌词</a><br>' + $song_Lrc[song_id].split("[/]")[1];
		if($song_Lrc[song_id].indexOf("暂时找不到这首歌曲的歌词")!=-1){
			document.getElementById("txtword").style.overflowY="hidden";
		}
	}else if($song_Lrc[song_id].length >0){
		nolrc=false;
		document.getElementById("lyric").style.display="block";
		document.getElementById("txtword").style.display="none";
		if(9999999 == lrctimea){
			s=$song_Lrc[song_id];
			//规范化歌词内容
			while (s.indexOf("'")>0){
				s=s.replace("'","`");
			}
			while (s.indexOf(",")>0){
				s=s.replace(",","，");
			}
			while (s.indexOf("][")>0){
				s=s.replace("][","','")
			}
			var lrc=s.split("[");
			if(lrc.length>5){
				var arr1 = new Array();
				var arr2 = "";
				for (var i=0;i<lrc.length ;i++ ){
					t= lrc[i].split("]");
					if (t[1] && t[1]!=""){
						gg=t[0].split("','");
						for (var j=0;j<gg.length;j++){
							var g = new Object();
							g.time = getTime(gg[j]);
							if(isNaN(g.time)==false)
							{
								g.c = t[1];
								if(g.c != ""){
									arr1.push(g);
								}
							}
						}
					}
				}
			}
			//对歌词进行排序
			arr1.sort(function(x, y) {
				if (parseInt(x.time)>parseInt(y.time))  
					return 1;
				else if(parseInt(x.time)<parseInt(y.time))
					return -1;
				else
					return 0;
				}                   
			);
			var gg="";
			for(var i = 0;i<arr1.length;i++)
			{
				var g = arr1[i];
				if (gg!=g.c){
					if (arr2==""){
						arr2=g.time + "|||" + g.c;
					}else{
						arr2=arr2 + "," + g.time + "|||" + g.c;
					}
					gg=g.c;
				}
			}
			arr2=arr2 +  ",9999999|||今生缘音乐 666ccc.com";
			_t = arr2.split(",");
		}
		for(var i = 0; i < _t.length; i++){
			if(_t[i].split("|||")[0] < curTime  &&  curTime < _t[i+1].split("|||")[0] || 9999999 == lrctimea){
				if(lrctimea!=i){
					this.lrci("LR1",i-3);
					this.lrci("LR2",i-2);
					this.lrci("LR3",i-1);
					this.lrci("LR4",i);
					this.lrci("LR5",i+1);
					this.lrci("LR6",i+2);
					this.lrci("LR7",i+3);
				}
				lrctimea=i;
			}
		}
	}else{
		if(9999999 == lrctimea){
			this.led('','','','载入歌词失败！','','','');
			lrctimea=0;
			nolrc=false;
		}
	}
}
if(nolrc){clearTimeout(playlrcid);}else{playlrcid = setTimeout("pu.PlayLrc()", 200);}
};
this.sendamigo = function(){
	//epen2("http://my.666ccc.com/diange/sendsong.asp?mid=play/"+singer_id+"/"+song_id+".htm");
	/*window.clipboardData.setData("text",_url+"play/"+singer_id+"/"+song_id+".htm");alert("网址复制成功啦!");*/
};
this.showpic = function(){
	//epen2("http://so.666ccc.com/pic/s/?key="+Singer);
}
this.showmtv = function(){
	//epen2("http://so.666ccc.com/video/s/?key="+MusicName);
}
this.showcl = function(){
	//epen2("http://my.12530.com/newchannel/c/m/searchKeyWorld/"+MusicName+"/1/1/search.htm?u=1001&uu=18312");
}
this.downmp3 = function(){
	epen2(_url+"down/"+singer_id+"/"+song_id+".htm");
}
this.geci = function(){
	epen2(_url+"lrc/"+singer_id+"/"+song_id+".htm");
}
this.showpl = function(){
	//epen2("http://my.666ccc.com/pl"+song_id+"_3.shtml");
}
}
function Media_wma(){
	//FILTER: alpha(opacity=100,style=3),filter:xray()/gray()/invert(),

	//在播放位置挡住
	//var txt="<input type=\"button\" class=\"bu on\" title=\"查看该歌手的图片\" value=\"图片\" onClick=\"pu.showpic();\" onMouseOut=\"this.className='bu on'\" onMouseOver=\"this.className='bu on'\"/><input type=\"button\" class=\"bu on\" title=\"查看该歌手的MTV\" value=\"MTV\" onClick=\"pu.showmtv();\" onMouseOut=\"this.className='bu on'\" onMouseOver=\"this.className='bu on'\"/><input type=\"button\" class=\"bu on\" title=\"下载手机彩铃\" value=\"彩 铃\" onClick=\"pu.showcl();\" onMouseOut=\"this.className='bu on'\" onMouseOver=\"this.className='bu on1'\"/><input type=\"button\" class=\"bu on\" title=\"查看当前播放歌曲的歌词\" value=\"歌 词\" onclick=\"showword(song_play_id);return false;\" onMouseOut=\"this.className='bu on'\" onMouseOver=\"this.className='bu on1'\"/><input type=\"button\" class=\"bu on\" title=\"评论此歌曲\" value=\"评 论\" onclick=\"pu.showpl();return false;\" onMouseOut=\"this.className='bu on'\" onMouseOver=\"this.className='bu on1'\"/>";

	var txt=""
	//<table height=18 width=304 bgcolor=black border=0 cellpadding=0 cellspacing=0><tr valign=middle><td background=\"/2009/i/b_d.gif\" class=\"ceng\" align=\"left\">"+txt+"</td></tr></table>

	var s1="<div style=\"margin:0;position:relative;\">  <div id=\"neirong\" style=\"position:absolute; z-index:1000; ; left: 0; top: -2px;text-align:left; width: 270px; height:22px; TABLE-LAYOUT: fixed; overflow:hidden;\" class=\"ceng\"></div>";	//在div前加上上面一行
	s1 +="<object id=\"Exobud\" name=\"Exobud\" width=\"100%\" height=\"64\"";
	if(isIE){s1 +=" classid=\"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6\"";}else{s1 +=" type=\"application/x-ms-wmp\"";}
	s1 +="><param name=\"ShowControls\" value=\"1\"><param name=\"ShowPositionControls\" value=\"0\"><param name=\"ShowAudioControls\" value=\"1\"><param name=\"ShowTracker\" value=\"1\"><param name=\"ShowDisplay\" value=\"0\"><param name=\"ShowStatusBar\" value=\"0\"><param name=\"AutoSize\" value=\"0\"><param name=\"ShowGotoBar\" value=\"0\"><param name=\"ShowCaptioning\" value=\"0\">";
	s1 +="<param name=\"AutoStart\" value=\"1\"><param NAME=\"PlayCount\" value=\"1\"><param name=\"AnimationAtStart\" value=\"0\"><param name=\"TransparentAtStart\" value=\"0\"><param name=\"AllowScan\" value=\"0\"><param name=\"EnableContextMenu\" value=\"0\"><param name=\"ClickToPlay\" value=\"0\"><param name=\"InvokeURLs\" value=\"1\"><param name=\"DefaultFrame\" value=\"datawindow\"><param name=\"volume\" value=\"100\">";
	s1 +="<embed name=\"MediaPlayer_embed\" pluginspage=\"http://www.microsoft.com/windows/windowsmedia/download/\" type=\"application/x-mplayer2\" src=\"\" ShowControls=\"0\" ShowDisplay=\"0\" ShowStatusBar=\"0\" autostart=\"0\" autorewind=\"0\" ShowPositionControls=\"0\" ShowTracker=\"0\"></embed></object>";
	s1 +="</div>";
	document.writeln(s1);
}
//####################################################
function epen(URL,W,H){
	var Ws=screen.availWidth/2;
	var Hs=screen.availHeight/2;
	window.open(URL,"showwordjk","scrollbars=yes,width="+W+",height="+H+",top="+(Hs-(H/1.5))+",left="+(Ws-(W/2))+",");
}
function epen2(URL){
	window.open(URL)
}
function UserCollect(obj){
	//var favurl="http://box.666ccc.com/MusicFav.asp?flag=space&musicid="+obj;
	ajaxFav(obj);
}
function showword(obj) {
	epen2("/geci/"+obj+".htm");
}
function getTags(parentobj, tag){
	if (parentobj == null){
		return new Array();
	}else if (typeof parentobj.getElementsByTagName != 'undefined'){
		return parentobj.getElementsByTagName(tag);
	}else if (parentobj.all && parentobj.all.tags){
		return parentobj.all.tags(tag);
	}else{
		return new Array();
	}
}
function clk(type,id){
	var url = "";
	var urlcok = "",urlfav="";
	var urli=0;
	var object = getTags(document.getElementById(id),"input");
	if(object.length > 133){
		objectlength=133;
	}else{
		objectlength=object.length;
	}for(var i=0;i<object.length;i++){
		if(type=="all"){
			if(objectlength >i ){
				object[i].checked = true;
			}else{
				object[i].checked = false;
			}
		}else if(type=="reverse"){
			if(object[i].checked){
				object[i].checked = false;
			}else{
				object[i].checked = true;
			}
		}else if(type=="delsel"){
			if(type=="delsel"){
				var url_value = object[i].value.split('||')[1];
				var url_value_cok0 = object[i].value.split('||')[0].split("|")[0];
				var url_value_cok1 = object[i].value.split('||')[0].split("|")[1];
				var url_value_cok2 = object[i].value.split('||')[0].split("|")[2];
				var url_value_cok3 = object[i].value.split('||')[0].split("|")[3];
				var url_value_cok4 = object[i].value.split('||')[0].split("|")[4];
			}
			if(object[i].checked){
				url += url_value + "_";
				urli++;
				urlcok += url_value_cok0+",";
			}
		}else if(type=="delfav"){
			//收藏删除
			if(type=="delfav"){
				var url_value = object[i].value.split('||')[1];
				var url_value_fav0 = object[i].value.split('||')[0].split("|")[0];
			}else{
				var url_value = object[i].value.split('|')[0];
			}
			if(object[i].checked){
				url += url_value + "_";
				urli++;
				urlfav += url_value_fav0+"-";
			}
		}else{
			if(type=="playdel"){
				var url_value = object[i].value.split('||')[1];
			}else{
				var url_value = object[i].value.split('|')[0];
			}
			if(url_value>-1 && object[i].checked){
				url += url_value + "_";
				urli++;
			}
		}
	}
	url = url.substring(0,url.length-1);
	if(type=="play"){
		if(url.length==0){
			alert("请选择歌曲!");
		}else if(urli > 80){
			alert("连续播放不能超过80首!");
		}else{
			//if(url.indexOf("_")!=-1){
				window.open(_url+"playlist.html?"+url,"_self");
			//}else{
			//	window.open("/play/"+url+".htm","_self");
			//}
		}
	}
	if(type=="playadd"){
		if(url.length==0){
			alert("请选择添加歌曲!");
		}else{
			var ifplay=JKSite.Cookie.get("jk_ifplay");
			if(ifplay=="1"){
				JKSite.Cookie.set("jk_addplay",url,"/");
				alert("已经添加到“临时列表”！");
			}else{
				//if(url.indexOf("_")!=-1){
					window.open(_url+"playlist.html?"+url,"_self");
				//}else{
				//	window.open("/play/"+url+".htm","_self");
				//}
			}
		}
	}
	if(type=="playdel"){
		if(url.length==0){
			alert("请选择删除歌曲!");
		}else{
			pu.DelPlayer(url);
		}
	}
	if(type=="delsel"){
		if(url.length==0){
			alert("请选择删除歌曲!");
		}else{
			pu.DelPlayer_cok(url);
			urlcok = urlcok.substring(0,urlcok.length-1);
			del_list(urlcok);
		}
	}
	if(type=="delfav"){
		if(url.length==0){
			alert("请选择删除歌曲!");
		}else{
			if(confirm("真的要删除您收藏的歌曲吗？")){
				pu.DelPlayer_fav(url);delmyfav(urlfav);
			}
		}
	}
	//收藏删除

	if(type=="plsc"){
		if(url.length==0){
			alert("请选择歌曲!");
		}else{
			if(confirm("真的要批量收藏所选歌曲吗？")){
				plsc(url);
			}
		}
	}
	//批量收藏
}
JKSite.Cookie.set("jk_ifplay","1","/");
(function(){
        (function(el,cb){
            if (el.addEventListener){
                el.addEventListener('unload', cb, false);
            }else if (el.attachEvent){
                el.attachEvent('onunload', cb);
            }
        })(window,function(){
            if (window.sidebar) {
			JKSite.Cookie.set("jk_ifplay","0","/");
            } else if (window.external) {
			JKSite.Cookie.set("jk_ifplay","0","/");
            } else if (window.opera && window.print) {
            return true;
          }
        });
}
)();
//正则表达式替换
function replaceUrl(str,s1,s2){   
	var r, re; // 声明变量。   
	re = new RegExp(s1,"g"); // 创建正则表达式对象。   
	r = str.replace(re,s2); // 在字符串 s 中查找匹配。   
	return(r);    
}
function GetO(){
	var ajax=false; 
	try { 
		ajax = new ActiveXObject("Msxml2.XMLHTTP"); 
	} catch (e) { 
		try { 
			ajax = new ActiveXObject("Microsoft.XMLHTTP"); 
		} catch (E) { 
			ajax = false; 
		} 
	}
	if (!ajax && typeof XMLHttpRequest!='undefined') { 
		ajax = new XMLHttpRequest(); 
	} 
	return ajax;
}
function reloadpage(){
	var expires = new Date();
	expires.setFullYear(expires.getFullYear()+1);
	document.cookie="ss=99;path=/;expires=" + expires.toGMTString();
	showdivcode33();
}
function showdivcode33(){
	var ss=jkGetCookie("ss");
	var r=Math.ceil(Math.random()*maxr);
	if(ss==null||ss.length>=3){
		jkSetCookie("ss",r);
		var ss=jkGetCookie("ss");
	}
	if((ss-maxr)>0){
		jkSetCookie("ss",r);
		var ss=jkGetCookie("ss");
	}
	r=ss;
	if(r==null)r=Math.ceil(Math.random()*maxr);
	var DzUrl = sArr[r]+lastModifiedp(vir)+"/";
	document.getElementById("Exobud").URL = DzUrl+wmaaddr;
}
//删除我的收藏
function delmyfav(favstr){
	var ajax = GetO();
	var url="/2009/MusicDel_player.asp?act=delmusic&username="+JKSite.Cookie.get("username")+"&password="+JKSite.Cookie.get("password")+"&musicid="+favstr+"&"+Math.random();
	ajax.open("Get",url, true);
	ajax.onreadystatechange=function(){
		if (ajax.readyState == 4 && ajax.status == 200) {}
	}
	ajax.send(null)
}
//收藏歌曲
function ajaxFav(favurl){
	login_name = JKSite.Cookie.get("username");
	if(login_name && login_name!=null){
		window.tobox("http://box.666ccc.com/MusicAdd2.asp?musicid="+favurl+"&t="+Math.random(),"_box");
	}else{
		window.tobox("/2009/userlogin.htm?"+favurl,"_box");
	}
}
//批量收藏
function plsc(_scurl){
	login_name = JKSite.Cookie.get("username");
	if(login_name && login_name!=null){
		//alert("http://box.666ccc.com/MusicAdd2.asp?musicid="+_scurl+"&t="+Math.random());
		window.tobox("http://box.666ccc.com/MusicAdd2.asp?musicid="+_scurl+"&t="+Math.random(),"_box");
	}else{
		window.tobox("/2009/userlogin.htm?"+_scurl,"_box");
	}	
}
//判断是否清空过
var yy=JKSite.Cookie.get("yy");
if(yy==undefined||yy=="undefined"||yy==null||yy==""){
	var nextyear=new Date();
	nextyear.setFullYear(nextyear.getFullYear()-10);
	var str_time=nextyear.toGMTString();
	document.cookie="l_music=l_end;expires="+str_time+";path=/";
	JKSite.Cookie.set("yy","1","/");
}
document.write("<scr"+"ipt src=\"/2009/jquery.js\" type=\"text/javascript\"></scr"+"ipt>");
document.write("<scr"+"ipt src=\"/2009/fav.js\" type=\"text/javascript\"></scr"+"ipt>");