﻿//全选函数
function SelectAll(oForm){
	for(var i=0;i<oForm.url.length;i++){
		oForm.url[i].checked=true;
	}
}

//反选函数
function TurnOver(oForm){
	for(var i=0;i<oForm.url.length;i++){
		oForm.url[i].checked=!oForm.url[i].checked;
	}
}

//播放选择列表
function PlaySelected(oForm){                               //创建一个选择播放列表
	var arrPlayList = [];                                   //定义播放列表
	var intPlayNum = 0;                                     //定义初始值
	var strSongFolder = "dunhua/Music/player.asp?To=Player&";//定义打开文件的路径(可定义文件夹或者文件名称)

	if(oForm.url.length){
	for(var i=0;i<oForm.url.length;i++){                    //当i=0或者i<获取过来的值,则将i累加()
		if(oForm.url[i].checked==true){
			arrPlayList[arrPlayList.length] = oForm.url[i].value
		}
	}
	}
	else{
		if(oForm.url.checked==true)arrPlayList[0] = oForm.url.value//如果从表单选中的值在播放列表中，则将值付给播放列表
	}
	if (arrPlayList.length>0){
		CleanPlayList('PlayList');                          //清除播放列表cookies值
		var objWindow = window.open('','dj99play')
		for (var j=0;j<arrPlayList.length ;j++ )
		{
			intPlayNum = intPlayNum + setCookies('PlayList',arrPlayList[j]+"$$");
		}

		var setTime = 1000;                                       //设置时间为1000毫秒
		if (setTime)
		{
			var date = new Date();                                //创建一个时间函数,获取当天
			date.setTime(date.getTime()+(setTime*60*60*24));      //将date转换成具体的时间
			var expires = "; expires="+date.toGMTString();        //定义个失效日期：toGMTString根据GMT格林时间，将date转换为字符串，并返回结果
		}
		else
			var expires = "";
		document.cookie = "[playAuto]=1" +expires+";path=/";
		document.cookie = "[playOrder]=2"+expires+";path=/";
		document.cookie = "[playNumber]="+intPlayNum+";path=/";
		var aSong = arrPlayList[0].split("||")
		if(aSong.length==5)
			if (aSong[4]!="0")
				objWindow.location = "/"+strSongFolder+"/"+aSong[4]+"/"+aSong[3]+".htm";
			else
				objWindow.location = "/"+strSongFolder+"/"+aSong[3]+".htm"
		else
			objWindow.location = "/"+strSongFolder+"/"+aSong[3]+".htm"
	}
	else{
		alert("还没有选择一首歌曲呀");
	}
}

function LyricSee(ID){
	window.open('/Lyric/html/'+ID+'.htm','TT79','scrollbars=yes,resizable=no,width=500,height=369,menubar=no,top=66,left=116');
}
