$("document").ready(function(){
	
	//推荐歌曲全选
	$("#allbut").click(function(){
		$("#hotmusic input[type='checkbox']").attr("checked",'checked');
	});
	
	//推荐歌曲反选
	$("#antibut").click(function(){
		$("#hotmusic input[type='checkbox']").each(function(){
			if($(this).attr("checked")){
				$(this).removeAttr("checked");
			}else{
				$(this).attr("checked",'checked');
			}
		});
	});
	
	//周排行全选
	$("#weekallcheckbox").click(function(){
		if($(this).attr("checked")){
			$("#weekdiv input[type='checkbox']").attr("checked",'checked');
		}else{
			$("#weekdiv input[type='checkbox'] ").each(function(){
				$(this).removeAttr("checked");
			});
		}
	});
	
	//月排行全选
	$("#monthallcheckbox").click(function(){
		if($(this).attr("checked")){
			$("#monthdiv input[type='checkbox']").attr("checked",'checked');
		}else{
			$("#monthdiv input[type='checkbox'] ").each(function(){
				$(this).removeAttr("checked");
			});
		}
	});
	
	//专辑排行全选
	$("#topallcheckbox").click(function(){
		if($(this).attr("checked")){
			$("#topdiv input[type='checkbox']").attr("checked",'checked');
		}else{
			$("#topdiv input[type='checkbox'] ").each(function(){
				$(this).removeAttr("checked");
			});
		}
	});
})

	/*
	 * 当前多个复选框是否有选取
	 */
	function isselected(form){
		var bool = false;
		$("#"+form+" input[type='checkbox']").each(function(){
			if($(this).attr("checked")){
				bool = true;
			}
		});
		if(bool){
			document.getElementById(form).submit();
		}else{
			alert("请选择歌曲或专辑");
		}
	}


/*
 * 添加到收藏
 */
function addMe(url,name){
	window.external.AddFavorite(url,name);
}