

//全选选中状态
jQuery(function(){
 jQuery(".setPlayXuan").live("click",function (){
		var jQueryclThis=jQuery(this);
		jQuery(".setPlayXuan").not(jQueryclThis).removeClass("setPlayXuanCur");
		jQueryclThis.toggleClass("setPlayXuanCur");
		})
});


function clk(_act, _id) {
	var v = [];
	var a = get_tags($$(_id), 'input');

	for (var i = 0; i < a.length; i++) {
		if (_act == 'all' ) {a[i].checked = true;}
		else if (_act == 'un' ) { a[i].checked = (a[i].checked) ? false : true; }
		else if (_act == 'uns' ) { a[i].checked = false; }
		else { if (0 < a[i].value && a[i].checked){ v.push(a[i].value); } }
	}

	if ( 'addplay' == _act ) {
		if(v.length<1){ alert('请选择您要添加的歌曲！');return;  }
		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="+(v.join('/'))+";domain="+(DomainUrl)+";path=/;expires="+ now.toGMTString();
			alert("恭喜，已经添加到连续播放列表！");
		}else{
			window.open(''+web_url+'index.php/dance/playsong?id=' + v.join(',')+'', 'jk_play');
		}
	}

	if ( 'random' == _act ) {
		clk('uns', _id)
		//alert(a.length);
		for(j=0;j<a.length/2;j++){
			var roundNum=Math.floor(Math.random()*a.length);
			//alert(roundNum);
			a[roundNum].checked = true;
		}
	}

	if ( 'play' == _act ) {
		if(v.length){
			if(v.length>50){
				alert("您选择的太多，请保持在50首以内，以便达到最佳效果！");return;
			}else{
				window.open(''+web_url+'index.php/dance/playsong?id=' + v.join(',')+'', 'jk_play');
			}
		}else{
			alert('请选择您要播放的歌曲！');return;
		}
	}
};

function getHisObject(idname) {if (document.getElementById){return document.getElementById(idname);}else if (document.all){return document.all[idname];}else if (document.layers){return document.layers[idname];}else{return null;}}
function getHisTags(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 GetHisCookie(name){var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|jQuery)"));if(arr!=null){return unescape(arr[2]);}return null;}



function getObject(idname) {if (document.getElementById){return document.getElementById(idname);}else if (document.all){return document.all[idname];}else if (document.layers){return document.layers[idname];}else{return null;}}
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 GetCookie(name){var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|jQuery)"));if(arr!=null){return unescape(arr[2]);}return null;}

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="+(DomainUrl)+";path=/;expires="+ now.toGMTString();
		alert("恭喜，已经添加到连续播放列表！");
	}else{
		window.open(''+web_url+'?cs=lb-id-' + url+'.html', 'jk_play');
	}
}

jQuery(function(){
	jQuery(".moreJianjie").live("click",function(){
		jQuery(".introduction-all").addClass("unfold")
	})
	jQuery(".lessJianjie").live("click",function(){
		jQuery(".introduction-all").removeClass("unfold")
	})
})


function classlist(s){
  for(var i=1;i<12;i++){
      if(s==i){
	document.getElementById('type_'+i).style.display='block';
      }else{
	document.getElementById('type_'+i).style.display='none';
      }
  }
}