function Addplay(url) {
	
	var ifplay = GetCookie("jk_ifplay");
	
	if (ifplay == "1") {
		
		var now = new Date();
		
		var ss = now.getTime();
		
		now.setTime(ss + 12 * 60 * 60 * 1000); //12 hours
		
		document.cookie = "jk_addplay=" + (url) + ";domain=" + web_url + ";path=/;expires=" + now.toGMTString();
		
		asyncbox.tips("恭喜，已经添加到连续播放列表！", "alert", 1500);
		
	} else {
		if (url.split(",").length - 1 > 1) {
			window.open(web_url + "include/lplayer.php?id=" + url + "", "jk_play");
		} else {
			window.open(web_url + "include/lplayer.php?id=" + url + "", "jk_play");
		}
	}
}

var old = "";

function quanxuan(obj) {
	
	if (old != obj.toString()) {
		
		document.form.reset();
		
		old = obj.toString();
		
	}
	
	with (document.getElementById(obj)) {
		
		var ins = getElementsByTagName("input");
		
		for (var i = 0; i < ins.length; i++) {
			
			//if(ins[i].value!=""&&ins[i].value!="0")
			
			ins[i].checked = !ins[i].checked;
			
		}
		
	}
	
}

function playallquanxuan(obj) {
	
	document.form.reset();
	
	with (document.getElementById(obj)) {
		
		var ins = getElementsByTagName("input");
		
		for (var i = 0; i < ins.length; i++) {
			
			ins[i].checked = true;
			
		}
		
	}
	
}

function lbplay() {
	
	var newx = "",
	firstid = "";
	
	var ok = false;
	
	var lens = eval("document.form.Url").length;
	
	if (lens == undefined) {
		lens = 1
	}
	
	if (lens > 1) {
		
		for (var i = 0; i < lens; i++) {
			
			var temp = eval("document.form.Url[" + i + "]");
			
			if (temp.checked) {
				
				if (temp.value.replace("@", "") != "" && temp.value.replace("@", "") != "0") {
					
					if (firstid == "")
						firstid = temp.value.replace("@", "");
					
					newx = newx + temp.value.replace("@", "") + ",";
					
					ok = true;
					
				}
				
			}
			
		}
		
	} else {
		
		ok = true;
		
		if (document.form.Url.value.replace("@", "") != "" && document.form.Url.value.replace("@", "") != "0") {
			
			newx = document.form.Url.value.replace("@", "") + ",";
			
		}
		
	}
	
	if (ok) {
		
		if (newx.length > 2009) {
			
			asyncbox.tips("您选择的太多，请保持在60首以内，以便达到最佳效果！", "alert", 1500);
			
		} else {
			
			if (newx.split(",").length - 1 > 1)
				
				window.open(web_url + "include/lplayer.php?id=" + newx + "");
			else
				
				window.open(web_url + "include/lplayer.php?id=" + newx + "");
			
		}
		
	} else {
		asyncbox.tips("请选择后再播放", "alert", 1500);
	}
}
