function checkUerID()
{
	service.panduan(function(aaa){
	if(aaa=="yes"){
				return true;
	}else{
				showLoginDiv();
	}});
}
function setBackground()
{
	var bWidth=parseInt(document.body.scrollWidth);
	var bHeight=parseInt(document.body.scrollHeight);
	var back=document.createElement("div");
	back.id="back";
	var styleStr="top:0px;left:0px;position:absolute;background:#666;width:"+bWidth+"px;height:"+bHeight+"px;";
	styleStr+=(isIe)?"filter:alpha(opacity=0);":"opacity:0;";
	back.style.cssText=styleStr;
	document.body.appendChild(back);
	showBackground(back,50);
}

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle        
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
         }
      }
   }
window.attachEvent("onload", correctPNG);

function wuyule(val1){
	window.location=val1;
}

//删除选中歌曲
function delSelect(name,bb)
{
	service.panduan(function(aaa)
	{
		if(aaa=="yes"){
		document.getElementById("chenggong222").innerHTML="确实要删除选中歌曲记录吗？";
		var trackid="";
		var str="";
		var e=document.getElementsByTagName("input");  
				for (var i=0;i<e.length;i++)
				{
					if(e[i].checked==true&&e[i].name==name)
					{
						trackid=trackid+"ID="+e[i].value+"&";
						str=e[i].value;
					}
				}
				if(str=="")
				{
					alert("请选择歌曲");
					return ;
				}
			document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"wuyule('del_listen_song.do?"+trackid+"pages="+bb+"')\"  />";
			ssss11();
		}else{
					showLoginDiv();
			}
		}
	);
}
function delSelect1(name,page)
{
	service.panduan(function(aaa)
	{
		if(aaa=="yes"){
		document.getElementById("chenggong222").innerHTML="确实要删除选中歌曲记录吗？";
		var trackid="";
		var str="";
		var e=document.getElementsByTagName("input");  
		
				for (var i=0;i<e.length;i++)
				{
					if(e[i].checked==true&&e[i].name==name)
					{
						trackid=trackid+"ID="+e[i].value+"&";
						str=e[i].value;
					}
				}
				if(str=="")
				{
					alert("请选择歌曲");
					return ;
				}
			document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"wuyule('deleteCollectionTrack.do?"+trackid+"pages="+page+"&&type=5')\"  />";
			ssss11();
		}else{
					showLoginDiv();
			}
		}
	);
}
function delTrackConfirmer(aa,bb,cc,dd){
	service.panduan(function(aaa)
	{
		if(aaa=="yes"){
		document.getElementById("chenggong222").innerHTML="确实要删除该收藏的单曲吗？";
		document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"wuyule('deleteCollectionTrack.do?List_id="+aa+"&&Ioda_track_id="+bb+"&&pages="+cc+"&&type="+dd+"')\"  />";
		ssss11();
	}else{
				showLoginDiv();
		}
	}
	);
}

function delReleaseConfirmer(aa,bb){
	service.panduan(function(aaa)
	{
		if(aaa=="yes"){
		document.getElementById("chenggong222").innerHTML="确实要删除该收藏的专辑吗？";
		document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"wuyule('deleteCollectionRelease.do?Userid="+aa+"&&Ioda_release_id="+bb+"')\"  />";
		ssss11();
	}else{
				showLoginDiv();
		}
	}
	);
}

function delArtistConfirmer(aa,bb){
	service.panduan(function(aaa)
	{
		if(aaa=="yes"){
		document.getElementById("chenggong222").innerHTML="确实要删除该收藏的艺人吗？";
		document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"wuyule('deleteCollectionArtist.do?Userid="+aa+"&&Ioda_artist_id="+bb+"')\"  />";
		ssss11();
	}else{
				showLoginDiv();
		}
	}
	);
}

function delMyListConfirmer(aa){
	service.panduan(function(aaa)
	{
		if(aaa=="yes"){
	document.getElementById("chenggong222").innerHTML="确实要删除该自建列表吗？";
	document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"wuyule('deleteCollectionMyList.do?List_id="+aa+"')\"  />";
	ssss11();
	}else{
				showLoginDiv();
		}
	}
	);
}

function delListenList(aa,bb){
	service.panduan(function(aaa)
	{
		if(aaa=="yes"){
	document.getElementById("chenggong222").innerHTML="确实要删除该收藏的单曲吗？";
	document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"wuyule('del_listen_song.do?ID="+aa+"&&pages="+bb+"')\"  />";
	ssss11();
	}else{
				showLoginDiv();
		}
	}
	);
}

function openWin(win)
{
	window.open(win);
}


function chk(var1)
{
	
	document.getElementById(var1).innerHTML="<font color=\"red\">注册登陆后才可以享受包月下载服务</font>";
}
function Chklocation()
{
	showLocationDiv();
}

function dakai(val1){
	var obj=document.getElementById(val1);
	//obj.style.color="#ffffff";
	if(obj.style.display=="block") obj.style.display="none";
	else obj.style.display="block";
	obj.style.position = "absolute";
	obj.style.zindex   = "999";
	obj.style.width    = "200px";
	obj.style.height   = "80px";
	obj.style.top  = "238px";
	obj.style.left ="150px";
}
function dakai1(val1){
	var obj=document.getElementById(val1);
	//obj.style.color="#ffffff";
	if(obj.style.display=="block") obj.style.display="none";
	else obj.style.display="block";
	obj.style.position = "absolute";
	obj.style.zindex   = "999";
	obj.style.width    = "200px";
	obj.style.height   = "80px";
	obj.style.top  = "253px";
	obj.style.left ="150px";
}	
//弹出移动层

function showSinglePopAdd_div(user_id,ioda_track_id)
{
	if (navigator.appName.indexOf("Microsoft") != -1) {
         var XX=event.clientX;
		var YY=event.clientY;
     } else {
         var XX=350;
		var YY=250;
     }
	service.panduan(function(aaa){
	if(aaa=="yes"){
		service.getCollectionList(user_id,ioda_track_id,function(vvv)
		{
		   if(vvv!="")
		   {
		   		document.getElementById("shcplay_list"+ioda_track_id).innerHTML=vvv;
		   		var width  = 100;  //弹出框的宽度
				var height = 80;  //弹出框的高度
				var obj    = document.getElementById("PopAdd_div"+ioda_track_id);
				
				obj.style.position = "absolute";
				obj.style.zindex   = "999";
				obj.style.width    = width + "px";
				obj.style.height   = height + "px";
			    obj.style.top=
			    (document.documentElement.scrollTop+(document.documentElement.clientHeight-obj.offsetHeight)/2)+"px";
			    obj.style.left=
			    (document.documentElement.scrollLeft+(document.documentElement.clientWidth-obj.offsetWidth)/2)+"px";				
				obj.style.display  = "block";
		   }else{
		   		document.getElementById("chenggong222").innerHTML="没有自建列表，无法移动！";
				ssss12(XX,YY);
		   }
		}
		); 
		
	}else{
				showLoginDiv();
		}
	}
	);
}
//弹出添加自建列表层

function PopNewLst_div(user_id)
{
	service.panduan(function(aaa){
	if(aaa=="yes"){
		document.getElementById("PopNewLst_div").style.top  = "167px";
		document.getElementById("PopNewLst_div").style.left = "300px";
		document.getElementById("PopNewLst_div").style.position = "absolute";
		document.getElementById("PopNewLst_div").style.display="block";	
	}else{
				showLoginDiv();
		}
	}
	);
	
}
function checkAddListForm(thisform)
{
	var a="1";
	DWREngine.setAsync(false);	
	var bb=document.getElementById("list_name").value;
	var userid=document.getElementById("Userid").value;
	service.panduan(function(aaa){
	if(aaa=="yes"){
		if(thisform.list_name.value=="")
		{
			document.getElementById("ListName").innerHTML="<font color=\"red\">请输入列表名称</font>";
			thisform.list_name.focus();
			a="1";
			//return false;
		}else if(thisform.list_name.value.length>20)
		{
			document.getElementById("ListName").innerHTML="<font color=\"red\">不能超过20个字符</font>";
			thisform.list_name.focus();
			a="2";
			//return false;
		}else{
			service.chongming(bb,userid,function(vvv){
				if(vvv=="yes"){
					document.getElementById("ListName").innerHTML="<font color=\"red\">您已有同名列表</font>";
					thisform.list_name.focus();
					a="2";
				}else{
					a="3";
				}
			});
			//return true;
		}
	}else{
				showLoginDiv();
		}
	}
	);
	if(a!="3"){
		return false;
	}else{
		return true;
	}
}	



//允许下载单曲层

function showAllowDiv(download_track_id)
{
	var width  = 376;  //弹出框的宽度
	var height = 293;  //弹出框的高度
	var obj    = document.getElementById("allow_download_div"+download_track_id);
	obj.style.display  = "block";
	obj.style.position = "absolute";
	obj.style.zindex   = "999";
	obj.style.width    = width + "px";
	obj.style.height   = height + "px";
	var Position = getPosition();
	leftadd = (Position.width-width)/2;
	topadd  = (Position.height-height)/2;
	obj.style.top  = (Position.top  + topadd)  + "px";
	obj.style.left = (Position.left + leftadd) + "px";
	//setBackground();
	document.body.appendChild(obj);
	window.onscroll = function (){
	var Position   = getPosition();
	obj.style.top  = (Position.top  + topadd)  +"px";
	obj.style.left = (Position.left + leftadd) +"px";
	};
}	

//打开层


function showDownDiv(div_id)
{
	var width  = 376;  //弹出框的宽度
	var height = 293;  //弹出框的高度
	var obj    = document.getElementById(div_id);
	obj.style.display  = "block";
	obj.style.position = "absolute";
	obj.style.zindex   = "999";
	obj.style.width    = width + "px";
	obj.style.height   = height + "px";
	var Position = getPosition();
	leftadd = (Position.width-width)/2;
	topadd  = (Position.height-height)/2;
	obj.style.top  = (Position.top  + topadd)  + "px";
	obj.style.left = (Position.left + leftadd) + "px";
	//setBackground();
	document.body.appendChild(obj);
	window.onscroll = function (){
	var Position   = getPosition();
	obj.style.top  = (Position.top  + topadd)  +"px";
	obj.style.left = (Position.left + leftadd) +"px";
	};
	
}	

function getPosition() {
var top    = document.body.scrollTop;
var left   = document.body.scrollLeft;
var height = document.body.clientHeight;
var width  = document.body.clientWidth;
return {top:top,left:left,height:height,width:width};
}
//打开层

function showDiv(div_id)
{
	var width  = 376;  //弹出框的宽度
	var height = 293;  //弹出框的高度
	var obj    = document.getElementById(div_id);
	obj.style.display  = "block";
	obj.style.position = "absolute";
	obj.style.zindex   = "999";
	obj.style.width    = width + "px";
	obj.style.height   = height + "px";
	if(parent.window.location.href.toLowerCase().indexOf('infocenter') != -1)
	{
    document.getElementById(div_id).style.top=
    (parent.document.documentElement.scrollTop+(parent.document.documentElement.clientHeight-document.getElementById(div_id).offsetHeight)/2)+"px";
    document.getElementById(div_id).style.left=
    (parent.document.documentElement.scrollLeft+(parent.document.documentElement.clientWidth-document.getElementById(div_id).offsetWidth)/2)+"px";	
	}else{	
    document.getElementById(div_id).style.top=
    (document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById(div_id).offsetHeight)/2)+"px";
    document.getElementById(div_id).style.left=
    (document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById(div_id).offsetWidth)/2)+"px";    
    }
	//setBackground();
	document.body.appendChild(obj);
	window.onscroll = function (){
    document.getElementById(div_id).style.top=
    (document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById(div_id).offsetHeight)/2)+"px";
    document.getElementById(div_id).style.left=
    (document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById(div_id).offsetWidth)/2)+"px";    
	};
}	
function showShcDiv(div_id,val1,val2)
{
	var width  = 100;  //弹出框的宽度
				var height = 80;  //弹出框的高度
	var obj    = document.getElementById(div_id);
	obj.style.position = "absolute";
				obj.style.zindex   = "999";
				obj.style.width    = width + "px";
				obj.style.height   = height + "px";
			    obj.style.top=
			    (document.documentElement.scrollTop+(document.documentElement.clientHeight-obj.offsetHeight)/2)+"px";
			    obj.style.left=
			    (document.documentElement.scrollLeft+(document.documentElement.clientWidth-obj.offsetWidth)/2)+"px";				
				obj.style.display  = "block";
	
	document.body.appendChild(obj);
	obj.style.display  = "block";
	obj.style.position = "absolute";
}
function show1ShcDiv(div_id)
{
	var width  = 200;  //弹出框的宽度
	var height = 300;  //弹出框的高度
	var obj    = document.getElementById(div_id);
	obj.style.display  = "block";
	obj.style.position = "absolute";
	obj.style.zindex   = "999";
	obj.style.width    = width + "px";
	obj.style.height   = height + "px";
	var Position = getPosition();
	leftadd = (Position.width-width)/2;
	topadd  = (Position.height-height)/2;
	obj.style.top  = (Position.top  + topadd-80)  + "px";
	obj.style.left = (Position.left + leftadd-100) + "px";
}


function getPosition() {
var top    = document.body.scrollTop;
var left   = document.body.scrollLeft;
var height = document.body.clientHeight;
var width  = document.body.clientWidth;
return {top:top,left:left,height:height,width:width};
}
//关闭层

function closeDiv(div_id)
{
	window.document.getElementById(div_id).style.display="none";
}	



//弹出收藏层

function showSHCPopAdd_div(user_id,ioda_track_id)
{
	if (navigator.appName.indexOf("Microsoft") != -1) {
         var XX=event.clientX;
		var YY=event.clientY;
     } else {
         var XX=350;
		var YY=250;
     }
	service.panduan(function(aaa){
	if(aaa=="yes"){
		service.getSHCList(user_id,ioda_track_id,function(vvv)
		{
		   if(vvv!=""){
		   		if(vvv!="have"){
			   		document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"shcSong('"+user_id+"','"+ioda_track_id+"')\" NAME=\"newlist_btn\">";
			   		document.getElementById("shcplay_list").innerHTML=vvv;
			   		document.getElementById("sccg").innerHTML="请选择要收藏的歌曲";
					showShcDiv("PopAdd_div",XX,YY);
				}else{
					document.getElementById("sccg").innerHTML="";
					document.getElementById("shcplay_list").innerHTML="歌曲已存在收藏列表中";
					document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"closeDiv(\'PopAdd_div\')\" NAME=\"newlist_btn\">";
					showShcDiv("PopAdd_div",XX,YY);
				}
		   }else{
		   		document.getElementById("shcplay_list").innerHTML="";
		   }
		}
		); 
		
	}else{
				showLoginDiv();
		}
	}
	);
}
//弹出收藏层-试听记录处


function showSHCPopAdd_listen_div(user_id,ioda_track_id)
{
	if (navigator.appName.indexOf("Microsoft") != -1) {
         var XX=event.clientX;
		var YY=event.clientY;
     } else {
         var XX=350;
		var YY=250;
     }
	service.panduan(function(aaa){
	if(aaa=="yes"){
		service.getSHCList(user_id,ioda_track_id,function(vvv)
		{
		   
		   if(vvv!=""){
		   		if(vvv!="have"){
			   		document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"shcSong1('"+flag+"','"+user_id+"','"+ioda_track_id+"')\" NAME=\"newlist_btn\">";
			   		document.getElementById("shcplay_list").innerHTML=vvv;
			   		document.getElementById("sccg").innerHTML="请选择要收藏的歌曲";
			   		document.getElementById("PopAdd_div").style.top=(200+parseInt(flag)*25)+"px";
					showShcDiv("PopAdd_div",XX,YY);
				}else{
					document.getElementById("sccg").innerHTML="";
					document.getElementById("shcplay_list").innerHTML="歌曲已存在收藏列表中";
					document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"closeDiv(\'PopAdd_div\')\" NAME=\"newlist_btn\">";
					showShcDiv("PopAdd_div",XX,YY);
				}
		   }else{
		   		document.getElementById("shcplay_list").innerHTML="";
		   }
		}
		); 
		
	}else{
				showLoginDiv();
		}
	}
	);
}
function yidong(track_id,old){
	
			var list_id=document.getElementById("list_id"+track_id).value;
			service.yidong(track_id,list_id,old,function(vvv){
				if(vvv=="ok"){
					window.location.reload();
				}else{
					return false;
				}
			});
}
//收藏歌曲
function shcSong(user_id,ioda_track_id)
{
	service.panduan(function(aaa){
	if(aaa=="yes"){
		
		var list_id=document.getElementById("list_id").value;
		service.shcSong(user_id,ioda_track_id,list_id,function(vvv)
		{
		   if(vvv=="success")
		   {
				//v MessageBox("收藏成功","收藏结果",515+64,0);
				document.getElementById("sccg").innerHTML="";
				document.getElementById("shcplay_list").innerHTML="收藏成功";
				document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"closeDiv(\'PopAdd_div\')\" NAME=\"newlist_btn\">";
		   }else if(vvv=="have")
		   {
		   		document.getElementById("sccg").innerHTML="";
				document.getElementById("shcplay_list").innerHTML="歌曲已存在收藏列表中";
				document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"closeDiv(\'PopAdd_div\')\" NAME=\"newlist_btn\">";
		   }else{
		   		alert("服务器问题，请稍后重试");
		   }
		}
		); 
		
	}else{
				showLoginDiv();
		}
	}
	);
}
//收藏试听歌曲
function shcSong1(flag,user_id,ioda_track_id)
{
	service.panduan(function(aaa){
	if(aaa=="yes"){
		var list_id=document.getElementById("list_id").value;
		service.shcSong(user_id,ioda_track_id,list_id,function(vvv)
		{
		   if(vvv=="success")
		   {
		   		document.getElementById("sccg").innerHTML="";
				document.getElementById("shcplay_list").innerHTML="收藏成功";
				document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"closeDiv(\'PopAdd_div\')\" NAME=\"newlist_btn\">";
		   }else if(vvv=="have")
		   {
		   		document.getElementById("sccg").innerHTML="";
				document.getElementById("shcplay_list").innerHTML="歌曲已存在收藏列表中";
				document.getElementById("guanbi").innerHTML="<input id=\"newlist_btn\" type=\"button\" value=\"确定\" onclick=\"closeDiv(\'PopAdd_div\')\" NAME=\"newlist_btn\">";

		   }else{
		   		alert("服务器问题，请稍后重试");
		   }
		}
		); 
		
	}else{
				showLoginDiv();
		}
	}
	);
}
//收藏个歌手

function shcArtist(user_id,ioda_artist_id)
{
	if (navigator.appName.indexOf("Microsoft") != -1) {
         var XX=event.clientX;
		var YY=event.clientY;
     } else {
         var XX=350;
		var YY=250;
     }
	service.panduan(function(aaa)
	{
	if(aaa=="yes"){
		service.shcArtist(user_id,ioda_artist_id,function(vvv)
		{
		   if(vvv=="success")
		   {
		   		document.getElementById("chenggong222").innerHTML="收藏成功";
		   		document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"closeDiv('chenggong')\"/>";
		   }else if(vvv=="have")
		   {
		   		document.getElementById("chenggong222").innerHTML="该艺人已经收藏过";
		   }else{
		   
		   		document.getElementById("chenggong222").innerHTML="服务器问题，请稍后重试";
		   }
		   ssss12(XX,YY);
		}
		); 
		
	}else{
				showLoginDiv();
		}
	}
	);
}
//收藏个专辑

function shcRelease(user_id,ioda_release_id)
{
	if (navigator.appName.indexOf("Microsoft") != -1) {
         var XX=event.clientX;
		var YY=event.clientY;
     } else {
         var XX=350;
		var YY=250;
     }
	service.panduan(function(aaa){
	if(aaa=="yes"){
		service.shcRelease(user_id,ioda_release_id,function(vvv)
		{
		  if(vvv=="success")
		   {
		   		document.getElementById("chenggong222").innerHTML="收藏成功";
		   		document.getElementById("chenga").innerHTML="<input type=\"button\" value=\"确定\" onclick=\"closeDiv('chenggong')\"/>";
		   }else if(vvv=="have")
		   {
		   		document.getElementById("chenggong222").innerHTML="该专辑已经收藏过";
		   }else{
		   		document.getElementById("chenggong222").innerHTML="服务器问题，请稍后重试";
		   }
		   ssss12(XX,YY);
		}
		); 
		
	}else{
				showLoginDiv();
		}
	}
	);
}

				//全选

function checkAllRecord(val1)
{
	
	var e=document.getElementsByTagName("input");  
	for (var i=0;i<e.length;i++)
	{
		if(e[i].type=="checkbox"){
			if (e[i].disabled==false&&e[i].name==val1)
			e[i].checked = true;
		}
		
	}
}

//取消
function unselectall(val1)
{
	var e=document.getElementsByTagName("input");  
	for (var i=0;i<e.length;i++)
	{
		if(e[i].type=="checkbox"){
			if (e[i].disabled==false&&e[i].name==val1)
		     e[i].checked = false;
		}
	}
}
//试听全选
	function checkAllRecord1()
{
	
	var e=document.getElementsByTagName("input");  
	for (var i=0;i<e.length;i++)
	{
		if(e[i].type=="checkbox"){
			if (e[i].disabled==false)
			e[i].checked = true;
		}
		
	}
}
//试听取消
function unselectall1()
{
	var e=document.getElementsByTagName("input");  
	for (var i=0;i<e.length;i++)
	{
		if(e[i].type=="checkbox"){
			if (e[i].disabled==false)
		     e[i].checked = false;
		}
	}
}

//判断点击选中下载时显示哪个层
function checkSelectDownDiv(cd,form)
{
	var trackids="trackDown.do?";
	//trackids=trackid+"?";
	service.panduan(function(aaa){
		if(aaa=="no"){
			showLoginDiv();
		}else{
				var e=document.getElementsByTagName("input");  
				var trackid="";
				for (var i=0;i<e.length;i++)
				{
					if(e[i].checked==true&&e[i].name==cd)
					{
						trackid=trackid+"trackID="+e[i].value+"&";
					}
				}
				if(trackid!="")
				{
				document.getElementById(form).action=trackids+trackid;
				document.getElementById(form).submit();
				}
				else
				{
					alert("请选择歌曲");
						return;
				}
		}
	});
}

//全选购买

function checkAllDownDiv(cd,form)
{
	var trackid="trackDown.do";
	trackid=trackid+"?";
	service.panduan(function(aaa){
		if(aaa=="no"){
			showLoginDiv();
		}else{
				var e=document.getElementsByTagName("input");  
				for (var i=0;i<e.length;i++)
				{
					if (e[i].name==cd)
					{
						e[i].checked = true;
						trackid=trackid+"trackID="+e[i].value+"&";
					}
					
				}
				document.getElementById(form).action=trackid;
				document.getElementById(form).submit();
		}
	});
}
function downConfirmer(userid,track_id){
	DWREngine.setAsync(false);	
	var flag=1;
	service.getDownTimes(userid,track_id,function(vvv)
	{
	   if(vvv>1&&vvv%2==0)
	   {
			if(!confirm("一次付费限下载2次，你确定再次付费购买该歌曲吗？")){
				flag=0;
			}
	   }
	}
	); 
	if(flag==1)
	{
		return true;
	}else{
		return false;
	}
	DWREngine.setAsync(true); 
}