﻿<!--
var moveObject;
var targetObject;
var titleObject;
var titleMove;
var player_installed = true;
var Effect = document.getElementsByTagName("body");
var SoftRoot = "/ActiveX/SeenSong_Install.exe"
/* 显示错误信息(如果读入之后发生错误，则认为客户端没有安装播放器(保存到设置的变量里) */
function ShowError()
{
	player_installed = false;
}
/* 执行函数 */
function SeenSong_Play(u, v, p, d) 
{
	 if (TOPSeenSong.CheckInstall()!=="install")
	 {
			Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
			if (confirm(" 请安装SeenSong播放器，\n\n 点击确定马上下载安装！ "))
			{
				window.open( SoftRoot );
				Effect[0].style.filter = "";
			}
			else
			{
				Effect[0].style.filter = "";
			}
	  }
	 else
	 {
		 	//alert(u+"\n\n"+v+"\n\n"+p+"\n\n"+d);
			TOPSeenSong.RunTOPSeenSong(u,v,p,d); //通过RunTOPDigioke函数把数据传送到播放器
		  	return;
	 }
}
////完成与Seensong Player的连接///////////////////////////////////////////////////
function scrollStart(obj)
{  
	if(targetObject==obj)
	return;
	if(moveObject!=null)
	clearInterval(moveObject);  
	targetObject = obj;
	moveObject = setInterval("objectScroll()",40);
}
function scrollStopTitle()
{
	clearInterval(titleMove);
	titleObject.style.posLeft = 0;
}
function scrollStop(obj)
{  
	if(targetObject!=obj)    return; 
	//alert(event.toElement);
	if(event.toElement== obj || event.toElement==obj.parentElement) return;

	clearInterval(moveObject);
	obj.style.posLeft = 0;
	targetObject = null;
}
function objectScroll(){
    var posx = targetObject.style.posLeft;
    posx= posx-1;
    var w = targetObject.offsetWidth;
    if((posx+w)<0)
    posx = 100;
    targetObject.style.posLeft = posx;
}
function waitSongTitle(title,addScript)
{
	document.write("<div style=\"width:100%;height:14;overflow-x:hidden;cursor:hand;background-color:transparent\" onmouseover=\"scrollStart(this.firstChild)\" onmouseout=\"scrollStop(this.firstChild)\" onClick=\""+addScript+"\"><div style=\"position:absolute;white-space:nowrap;height:14;background-color:transparent\">"+title+"</div></div>");
}
function writesortTitle(title,addScript)
{
	document.write("<div style=\"width:100%;height:14;overflow-x:hidden;cursor:hand;background-color:transparent\" onmouseover=\"scrollStart(this.firstChild)\" onmouseout=\"scrollStop(this.firstChild)\" onClick=\""+addScript+"\"><div style=\"position:absolute;white-space:nowrap;height:14;background-color:transparent\">"+title+"</div></div>");
}
function playSongTitle(title,addScript)
{
	document.write("<div style=\"width:100%;height:14;overflow-x:hidden;cursor:default\"><div id='titlediv' style=\"position:absolute;white-space:nowrap\" onClick=\""+addScript+"\">"+title+"</div></div>");
	titleObject = document.getElementById("titlediv");
	clearInterval(titleMove);
	titleMove = setInterval("titleScroll()",50);
}
function titleScroll()
{
	var posx = titleObject.style.posLeft;
	posx= posx-1;
	var w = titleObject.offsetWidth;
	if((posx+w)<0)
	posx = 97;
	titleObject.style.posLeft = posx;
}
function dis(val) 
{
	if (val == "a") 
	{
		document.all.Ta.className = "right_on";
		document.all.Tb.className = "right_off";
		document.all.Tc.className = "right_off";
		document.all.show_a.style.display = "block";
		document.all.show_b.style.display = "none";
		document.all.show_c.style.display = "none";
		linkmore.target='_blank';
	    linkmore.action="CommendMR.asp";
	} else if (val == "b") 
	{
		document.all.Ta.className = "right_off";
		document.all.Tb.className = "right_on";
		document.all.Tc.className = "right_off";
		document.all.show_a.style.display = "none";
		document.all.show_b.style.display = "block";
		document.all.show_c.style.display = "none";
		linkmore.target='_blank';
	    linkmore.action="SeenSong.asp";
	} else if (val == "c")
	{
		document.all.Ta.className = "right_off";
		document.all.Tb.className = "right_off";
		document.all.Tc.className = "right_on";
		document.all.show_a.style.display = "none";
		document.all.show_b.style.display = "none";
		document.all.show_c.style.display = "block";
		linkmore.target='_blank';
	    linkmore.action="Special.asp";
	}
}
function check()
{
	if(document.login.Username.value=="")
	{
		document.login.Username.focus();
		alert(" 管理帐号不能为空！ ");
		return false;
	}
	if(document.login.Password.value=="")
	{
		document.login.Password.focus();
		alert(" 管理密码不能为空！ ");
		return false;
	}
}
function checkuserlogin()
{
	if(document.login.Username.value=="")
	{
		document.login.Username.focus();
		alert(" 用户帐号不能为空！ ");
		return false;
	}
	if(document.login.Password.value=="")
	{
		document.login.Password.focus();
		alert(" 登录密码不能为空！ ");
		return false;
	}
}
function show(no)
{
	if(no!=="")
	var showtr=eval(document.getElementById("show"+no));
	{
		if(showtr.style.display!="block")
		{
			showtr.style.display="block";
		}
		else
		{
			showtr.style.display="none";
		}
	}
}
function showadd()
{
  	var l=event.clientX;//(document.body.clientWidth-AddChannel.offsetWidth)/2   
  	var t=event.clientY+15;//(document.body.clientHeight-AddChannel.offsetHeight)/2 
 	with(AddChannel.style)
	{   
  		left=l   
  		top=t   
  		display="block"   
	}   	
}
function unshowadd()
{
	AddChannel.style.display="none";
}
function showadds()
{
  	var l=event.clientX-120;  
  	var t=event.clientY+15;
 	with(AddChannels.style)
	{   
  		left=l   
  		top=t   
  		display="block"   
	}   	
}
function unshowadds()
{
	AddChannels.style.display="none";
}
function showrepass(uid)
{
  	var l=event.clientX-240;
  	var t=event.clientY+10;
	if(uid!=="")
	{
		document.newpassword.uid.value=eval(uid);
	}
 	with(Repass.style)
	{   
  		left=l   
  		top=t   
  		display="block"   
	}   	
}
function unshowrepass()
{
	Repass.style.display="none";
}
function startMove(objDiv)
{
	document.attachEvent("onmousemove",moveDiv);
	document.attachEvent("onmouseup",endMove);
	document.attachEvent("onselectstart",selectNo);
	document["moveDiv"] = objDiv;
	document["startX"] = event.x;
	document["startY"] = event.y;
	document["oldX"] = objDiv.getBoundingClientRect().left;
	document["oldY"] = objDiv.getBoundingClientRect().top;
}
function moveDiv()
{
	//try{
	var obj = document["moveDiv"];
	if(obj)
	{
		var l = document["oldX"];
		var t = document["oldY"];
		obj.style.position = "absolute";
		obj.style.left = l + (event.x-document["startX"]);
		obj.style.top = t + (event.y-document["startY"]);
	}
//}catch(e){endMove();}
}
function endMove()
{
	document.detachEvent("onmousemove",moveDiv);
	document.detachEvent("onmouseup",endMove);
	document.detachEvent("onselectstart",selectNo);
	document["moveDiv"] = null;
	document["startX"] = null;
	document["startY"] = null;
}
function selectNo()
{
	return false; 
}
function CheckFormToChannel()
{
	  var must = /^[\+\-]?\d*?\d*?$/;
	  if (document.myform.CName.value=="")
	  {
			alert(" 栏目名称不能为空！ ");
			document.myform.CName.focus();
			return false;
	  }
	  if (document.myform.Values.value=="")
	  {
			alert(" 属性值不能为空！ ");
			document.myform.Values.focus();
			return false;
	  }
	  if (!must.test(document.myform.Values.value))
	  {
			alert(" 属性值只能填写数字！ ");
			document.myform.Values.focus();
			return false;
	  }
	  if (document.myform.Orders.value=="")
	  {
			alert(" 排序值不能为空！ ");
			document.myform.Orders.focus();
			return false;
	  }
	  if (!must.test(document.myform.Orders.value))
	  {
			alert(" 排序值只能填写数字！ ");
			document.myform.Orders.focus();
			return false;
	  }
	  return true;  
}
function CheckForms()
{
	  var must = /^[\+\-]?\d*?\d*?$/;
	  if (document.myforms.CName.value=="")
	  {
			alert(" 栏目名称不能为空！ ");
			document.myforms.CName.focus();
			return false;
	  }
	  if (document.myforms.Values.value=="")
	  {
			alert(" 属性值不能为空！ ");
			document.myforms.Values.focus();
			return false;
	  }
	  if (!must.test(document.myforms.Values.value))
	  {
			alert(" 属性值只能填写数字！ ");
			document.myforms.Values.focus();
			return false;
	  }
	  if (document.myforms.Orders.value=="")
	  {
			alert(" 排序值不能为空！ ");
			document.myforms.Orders.focus();
			return false;
	  }
	  if (!must.test(document.myforms.Orders.value))
	  {
			alert(" 排序值只能填写数字！ ");
			document.myforms.Orders.focus();
			return false;
	  }
	  return true;  
}
function CheckFormMagager()
{
	  if (document.myform.username.value=="")
	  {
			alert(" 管理员名称不能为空！ ");
			document.myform.username.focus();
			return false;
	  }
	  if (document.myform.password.value=="")
	  {
			alert(" 管理员密码不能为空！ ");
			document.myform.password.focus();	
			return false;
	  }
	  return true;  
}
function CheckRepass()
{
	  if (document.newpassword.newpass.value=="")
	  {
			alert(" 密码不能为空！ ");
			document.newpassword.newpass.focus();
			return false;
	  }
	  return true;  
}
function showform()
{ 
	var oDiv = document.createElement('div'); 
	oDiv.id='OverLayDiv'; 
	with(oDiv.style)
	{ 
		width = '100%'; 
		height = '100%'; 
		position = 'absolute'; 
		left = '0px'; 
		top = '0px'; 
		zIndex = 1; 
	} 
	document.body.appendChild(oDiv); 
	var l=(document.body.clientWidth-demo.offsetWidth)/2 
	var t=(document.body.clientHeight-demo.offsetHeight)/2 
	with(demo.style)
	{ 
		left=l 
		top=t 
		visibility="visible" 
		zIndex = 2; 
	} 
} 
function NoLogin()
{
	Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm(" 请登录后再进行本操作！\n\n 点确认按钮登录本系统。"))
	{
		location.href="Index.asp"
	}
	else
	{
		Effect[0].style.filter = "";
		return false;
	}
}
function GoLogin()
{
	Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm(" 请登录后再进行本操作！\n\n 点确认按钮登录本系统。"))
	{
		location.href="Index.asp";
	}
	else
	{
		Effect[0].style.filter = "";
		location.href="Index.asp";
		return false;
	}
}
function NoLoginAndBack()
{
	Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm(" 请登录后再进行本操作！\n\n 点确认按钮登录本系统。"))
	{
		location.href="Index.asp"
	}
	else
	{
		Effect[0].style.filter = "";
		location.href="Index.asp"
		return false;
	}
}
function LogOut()
  {
	Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm(" 您确认要退出登录？ "))
	{
		location.href="LogOut.asp"
	}
	else
	{
		Effect[0].style.filter = "";
		return false;
	}
  }
function CheckSearch()
{
	if(document.Search.SearchTy.value!=="2")
	{
		Search.action="Search.asp";	
	}
	else
	{
		Search.action="SearchSpecial.asp";	
	}
	if(document.Search.SearchKey.value=="")
	{
		alert("请填写您想查找的关键字！");
		document.Search.SearchKey.focus();
		return false;
	}
}
function goChg(arg){
	if(arg =="tap01"){
		document.images.img01.src="/images/main/tab_01_o.gif";
		document.images.img02.src="/images/main/tab_02.gif";
		document.all.tap01.style.display = "block";
		document.all.tap02.style.display = "none";
	}else{
		document.images.img01.src="images/main/tab_01.gif";
		document.images.img02.src="images/main/tab_02_o.gif";
		document.all.tap01.style.display = "none";
		document.all.tap02.style.display = "block";
	}
		
}
function Get_My_Pass() 
{
      var left, top, width, height, theURL
	  width = 280;
	  height = 157;
	  theURL = "Search_Password.asp";
      left = (window.screen.availWidth - width) / 2;
      top = (window.screen.availHeight - height) / 2;
      var per = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
      window.open(theURL,'',per);
}
function CreateXHR()
{
	try{
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	}catch(e){
		try{
		xhr = new ActiveXObject("Msxm12.XMLHTTP");
		}catch(E){
		    xhr = false;
		}
	}
	if(!xhr && typeof XMLHttpRequest != 'undefined')
	{
	 xhr =new XMLHttpRequest();
	}
	else
	{
		
	}	
	return xhr;
}
function GoTrySing(SingID)
{
	if(SingID!=="")
	{
		 xhr = CreateXHR();
		 var url = "SingSong.asp?";
		 xhr.open("POST",url+"MovID="+SingID);
		 xhr.send(null);
	 }
}
function ListenMusicBack()
{
	if(xhr.readyState == 4)
	{
	    var Data = xhr.responseText;
		var info = Data.split(',');
		if( info[0] == 1)
		{
			if (TOPSeenSong.CheckInstall()!=="install")
			{
				Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
				if (confirm(" 请安装SeenSong播放器，\n\n 点击确定马上下载安装！ "))
				{
					window.open( SoftRoot );
					Effect[0].style.filter = "";
				}
				else
				{
					Effect[0].style.filter = "";
				}
			 }
			 else
			 {
				  //alert(info[1]+','+info[2]+','+info[3]+','+info[4])
				  SeenSong_Play(info[1],info[2],info[3],info[4])
			 }
		}
		else if( info[0] == 2 )
		{
			Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
			if (confirm(" 您还没有购买此伴奏，点击确定现在购买！ "))
			{
				 xhr = CreateXHR();
				 xhr.onreadystatechange=ListenMusicBack;
				 var url = "Operation.asp?Act=BuyMr&";
				 xhr.open("POST",url+"MovID="+info[1]);
				 xhr.send(null);
				 Effect[0].style.filter = "";
			}
			else
			{
				Effect[0].style.filter = "";
				return false;
			}
		}
		else if( info[0] == 3 )
		{
			NoLogin()//未登录
		}
		else if( info[0] == 4 )
		{
			alert("参数传递错误！") //参数错误
			return false
		}
		else if( info[0] == 5 )
		{
			Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
			if (confirm(" 您的余额不足，是否马上充值？ "))
			{
				window.open("Payment.asp");
				Effect[0].style.filter = "";
			}
			else
			{
				Effect[0].style.filter = "";
				return false;
			}
		}
		else if( info[0] == 6 )
		{
			alert("您已经购买成功！") //购买成功
			if (TOPSeenSong.CheckInstall()!=="install")
			{
				Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
				if (confirm(" 请安装SeenSong播放器，\n\n 点击确定马上下载安装！ "))
				{
					window.open( SoftRoot );
					Effect[0].style.filter = "";
				}
				else
				{
					Effect[0].style.filter = "";
				}
			 }
			 else
			 {
				document.getElementById("UserMoney").innerHTML=info[2];
				SeenSong_Play(info[1],info[2],info[3],info[4]);
			 }
		}
	}
}
function ListenMusic(SongID)
{
	 if (TOPSeenSong.CheckInstall()!=="install")
	 {
			Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
			if (confirm(" 请安装SeenSong播放器，\n\n 点击确定马上下载安装！ "))
			{
				window.open( SoftRoot );
				Effect[0].style.filter = "";
			}
			else
			{
				Effect[0].style.filter = "";
			}
	 }
	 else
	 {
			if(SongID!=="")
			{
				 xhr = CreateXHR();
				 xhr.onreadystatechange=ListenMusicBack;
				 var url = "Operation.asp?Act=Listen&";
				 xhr.open("POST",url+"MovID="+SongID);
				 xhr.send(null);
			}
	 }
}
function DownMusic(MusicID)
{
//	alert("对不起，网站试运行阶段，暂时不提供下载功能！\n\n下载开放时间，请关注本站公告，谢谢合作！")
//	return false
	if(MusicID!=="")
	{
		var left, top, width, height, theURL
		width = 360;
		height = 160;
		theURL = "Download.asp?Act=DownMusic&MovID="+MusicID;
		left = (window.screen.availWidth - width) / 2;
		top = (window.screen.availHeight - height - 80) / 2;
		var per = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
		window.open(theURL,'',per);
	}
}
function Open_Window(w,h,u)
{
		var left, top, width, height, theURL
		width = w;
		height = h;
		theURL = u;
		left = (window.screen.availWidth - width) / 2;
		top = (window.screen.availHeight - height - 80) / 2;
		var per = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
		window.open(theURL,'',per);
}
function FavoriteBack()
{
	if(xhr.readyState == 4)
	{
	    var Data = xhr.responseText;
		var info = Data.split(',');
		if( info[0] == 1)
		{
			if (confirm(" 收藏音乐操作成功！\n\n 点确定转到收藏夹！ "))
			{
				location.href="UserCenter.asp?Mov=MyFavorite";
			}
			else
			{
				return false
			}
		}
		else if( info[0] == 2 )
		{
			alert("此作品您已经收藏过了！不能重复收藏！")
			return false
		}
		else if( info[0] == 3 )
		{
			NoLogin()//未登录
		}
		else if( info[0] == 4 )
		{
			alert("参数传递错误！") //参数错误
			return false
		}
	}
}
function FavoriteMusic(MusicID)
{
	if(MusicID!=="")
	{
		xhr = CreateXHR();
		xhr.onreadystatechange=FavoriteBack;
		var url = "Operation.asp?Act=Favorite&";
		xhr.open("POST",url+"MovID="+MusicID);
		xhr.send(null);
	}
}
function BuyMusicBack()
{
	if(xhr.readyState == 4)
	{
	    var Data = xhr.responseText;
		var info = Data.split(',');
		if( info[0] == 6)
		{
			if (confirm(" 购买音乐成功！\n\n 点确定转到购买列表！ "))
			{
				location.href="UserCenter.asp?Mov=BuyMusic";
			}
			else
			{
				return false
			}
		}
		else if( info[0] == 2 )
		{
			alert("此作品您已经购买过了！不能重复购买！")
			return false
		}
		else if( info[0] == 3 )
		{
			NoLogin()//未登录
		}
		else if( info[0] == 4 )
		{
			alert("参数传递错误！") //参数错误
			return false
		}
		else if( info[0] == 5 )
		{
			Effect[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
			if (confirm(" 您的余额不足，是否马上充值？ "))
			{
				window.open("Payment.asp");
				Effect[0].style.filter = "";
			}
			else
			{
				Effect[0].style.filter = "";
				return false;
			}
		}
	}
}
function BuyMusic(MusicID)
{
	if(MusicID!=="")
	{
		xhr = CreateXHR();
		xhr.onreadystatechange=BuyMusicBack;
		var url = "Operation.asp?Act=BuyMr&";
		xhr.open("POST",url+"MovID="+MusicID);
		xhr.send(null);
	}
}
function GoTrySing(SingID)
{
	if(SingID!=="")
	{
		 xhr = CreateXHR();
		 var url = "Sing.asp?";
		 xhr.open("POST",url+"MovID="+SingID);
		 xhr.send(null);
	 }
}
function GiveMusic(MusicID)
{
	 if(MusicID!=="")
	 {
		  Open_Window("280","157","GiveGift.asp?GID="+MusicID);
		  return false
	 }
}
//-->