﻿function showItem(o1,o2){
	$("itemtHIS").className="";
	$("itemtTOPa").className="";
	$("itemtTOPb").className="";
	$("itemtTOPc").className="";
	$("history").style.display = "none";
	$("classTop").style.display = "none";
	o2.className="this";
	$(o1).style.display = "block";
};
getCookie=function(_Name){
	var Res=eval('/'+_Name+'=([^;]+)/').exec(document.cookie);
	return Res==null?'':unescape(Res[1]);
};
setCookie=function(musicName,id,djcat,asphtml){
	var strCookie=musicName+"#"+id+"#"+djcat+"#"+asphtml+"*Ylmv*";
	var Cookie_info=getCookie("YlmvHistory");
	var deal_Cookie=Cookie_info;
	if(Cookie_info!=null){
		Cookie_info=Cookie_info.split("*Ylmv*");
		if(Cookie_info.length>=51) var N=50; else var N=Cookie_info.length-2;
		for(var i=0;i<=N;i++)
			if(Cookie_info[i].indexOf(musicName)!=-1)
				deal_Cookie=deal_Cookie.replace(strCookie,"");
	}
	strCookie+=deal_Cookie;
	var exp = new Date();
	exp.setTime (exp.getTime()+3600000000); 
	document.cookie = "YlmvHistory=" + strCookie + ";path=/; expires=" + exp.toGMTString();
};
historyShow=function(){			
	var Cookie_info = getCookie("YlmvHistory").split("*Ylmv*");
	var htmlStr = ""
	if(Cookie_info.length>=51) var N=50; else var N=Cookie_info.length-2;
	for(var i=0;i<=N;i++){
		var info=Cookie_info[i].split("#");
		if(i==0) var s=" class='f'"; else var s="";
		htmlStr += "<li"+s+" onMouseOver=\"COver(this);\" onMouseOut=\"COut(this);\"><input type='checkbox' value='"+info[1]+"'><a href='"+info[3]+"' target='_self'>"+info[0]+"</a></li>";
	}
	$("HistoryList").innerHTML = htmlStr;
};
delCookie=function(){
	var exp = new Date();
	var strCookie="";
	exp.setTime (exp.getTime()+3600000000); 
	document.cookie = "YlmvHistory=" + strCookie + ";path=/; expires=" + exp.toGMTString();
	$("HistoryList").innerHTML = "";
};
COver=function(t,act){
	if(t.className!="f")	t.className="over";
};
COut=function(t,act){
	if(t.className!="f")	t.className="out";
};
var xmlHttp;
function createXMLHttpRequest(){
	if(window.ActiveXObject){
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else if(window.XMLHttpRequest){
		xmlHttp = new XMLHttpRequest();
	}
};
function playTopLista(_id){
	$("classTopList").innerHTML = "<li class=\"tC\"><img src=\""+web_url+"Skin/Skin_02/Images/loading.gif\" /> 正在读取中....</li>";
	createXMLHttpRequest();
	xmlHttp.open("get",""+web_url+"Skin/Skin_02/Ajax.asp?action=playTopList&l=a&musicType="+_id);
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState == 4){
			if(xmlHttp.status == 200){
				$("classTopList").innerHTML = unescape(xmlHttp.responseText);
			}else alert("网络链失败!");
		}
	}
	xmlHttp.send(null);
};
function playTopListb(_id){
	$("classTopList").innerHTML = "<li class=\"tC\"><img src=\""+web_url+"Skin/Skin_02/Images/loading.gif\" /> 正在读取中....</li>";
	createXMLHttpRequest();
	xmlHttp.open("get",""+web_url+"Skin/Skin_02/Ajax.asp?action=playTopList&l=b&musicType="+_id);
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState == 4){
			if(xmlHttp.status == 200){
				$("classTopList").innerHTML = unescape(xmlHttp.responseText);
			}else alert("网络链失败!");
		}
	}
	xmlHttp.send(null);
};
function playTopListc(_id){
	$("classTopList").innerHTML = "<li class=\"tC\"><img src=\""+web_url+"Skin/Skin_02/Images/loading.gif\" /> 正在读取中....</li>";
	createXMLHttpRequest();
	xmlHttp.open("get",""+web_url+"Skin/Skin_02/Ajax.asp?action=playTopList&l=c&musicType="+_id);
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState == 4){
			if(xmlHttp.status == 200){
				$("classTopList").innerHTML = unescape(xmlHttp.responseText);
			}else alert("网络链失败!");
		}
	}
	xmlHttp.send(null);
};
function doHits(_Id,_do){
	createXMLHttpRequest();
	xmlHttp.open("post",""+web_url+"Skin/Skin_02/Ajax.asp",true);
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState == 4){
			if(xmlHttp.status == 200){
				$("doHits").innerHTML = unescape(xmlHttp.responseText);
			}else alert("网络链接失败");
		}
	}
	xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlHttp.send("action=doHits&id="+escape(_Id)+"&dowhat="+escape(_do));
};
function do1Hits(_Id){
	createXMLHttpRequest();
	xmlHttp.open("post",""+web_url+"Skin/Skin_02/Ajax.asp",true);
	xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlHttp.send("action=do1Hits&id="+escape(_Id));
};
