var web_path="/";
function getObject(idname) {if (document.getElementById){return document.getElementById(idname);}else if (document.all){return document.all[idname];}else if (document.layers){return document.layers[idname];}else{return null;}}function getTags(parentobj, tag){if (parentobj == null){return new Array();}else if (typeof parentobj.getElementsByTagName != 'undefined'){return parentobj.getElementsByTagName(tag);}else if (parentobj.all && parentobj.all.tags){return parentobj.all.tags(tag);}else{return new Array();}}function clk(act,id){var v = "";var o;var a = getTags(getObject(id),"input");for(var i=0; i<a.length; i++){o = a[i];if(act=="all"){o.checked = true;}else if(act=="un"){if(o.checked){o.checked = false;}else{o.checked = true;}}else{var n = a[i].value;if(n>0 && a[i].checked){v = v + a[i].value + "&id=";}}}if(act=="play"){v = v.substring(0,v.length-4);if(v.length==0){alert("请选择歌曲后再播放！");}else{window.open(""+web_path+"play.asp?id="+v+"","players");}}}

function CheckOthers(formname)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = formname.elements[i];
//		if (e.name != 'chkall')
			if (e.checked==false)
			{
				e.checked = true;// form.chkall.checked;
			}
			else
			{
				e.checked = false;
			}
	}
}

function CheckAll(formname)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = formname.elements[i];
//		if (e.name != 'chkall')
			e.checked = true// form.chkall.checked;
	}
}

function CheckPlayer()
{
	alert(document.form.checked.value);
}

function showword(openurl)
{
var controlWindow=window.open(openurl,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=580,height=387");
//controlWindow.moveTo(200,150);
}
function plays(openurl)
{
var controlWindow=window.open(openurl,"dgplays","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=580,height=387");
//controlWindow.moveTo(200,150);
}

function playmusic() {
var Musicurl = ""+web_path+"m99url1.asp?Old="+ [Old] +"&Title="+ Title +"&Url="+ M_sid +"&Author="+ Author +"";//注入音乐Url
document.write("<object id=\"Exobud\" width=\"100%\" height=\"64\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" ");
document.write("codebase=\"http:\/\/activex.microsoft.com\/activex\/controls\/mplayer\/en\/nsmp2inf.cab#Version=6,4,7,1112\"");
document.write("align=\"baseline\" border=\"0\" standby=\"Loading Microsoft Windows Media Player components...\" ");
document.write("type=\"application\/x-oleobject\" oncontextmenu=\"return(false)\">");
document.write("<param name=\"URL\" value=\""+Musicurl+"\">");
document.write("<param name=\"autoStart\" value=\"true\">");
document.write("<param name=\"invokeURLs\" value=\"false\">");
document.write("<param name=\"volume\" value=\"100\">");
document.write("<param name=\"playCount\" value=\"100\">");
document.write("<param name=\"defaultFrame\" value=\"datawindow\">");
document.write("<embed src=\""+Musicurl+"\" align=\"baseline\" border=\"0\" width=\"340\" height=\"64\"");
document.write("type=\"application\/x-mplayer2\"");
document.write("pluginspage=\"\"");
document.write("name=\"MediaPlayer1\" showcontrols=\"1\" showpositioncontrols=\"0\"");
document.write("showaudiocontrols=\"1\" showtracker=\"1\" showdisplay=\"0\"");
document.write("showstatusbar=\"1\"");
document.write("autosize=\"0\"");
document.write("showgotobar=\"0\" showcaptioning=\"0\" autostart=\"1\" autorewind=\"0\"");
document.write("animationatstart=\"0\" transparentatstart=\"0\" allowscan=\"1\"");
document.write("enablecontextmenu=\"1\" clicktoplay=\"0\" ");
document.write("defaultframe=\"datawindow\" invokeurls=\"0\">");
document.write("<\/embed>");
document.write("<\/object>");
}

var xmlHttp;
var addNew;
function GetXmlHttpObject(handler)
{ 
	var objXmlHttp=null	
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		} 
		try
		{   
			objXmlHttp=new ActiveXObject(strName)
			objXmlHttp.onreadystatechange=handler 
			return objXmlHttp
		} 
		catch(e)
		{ 
			alert("Error. Scripting for ActiveX might be disabled") 
			return 
		} 
	}
	else
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
	}
}
/* 显示留言 */
function showre(id,no)
{   document.getElementById("list").innerHTML = "";
	var url = ""+web_path+"Ping.asp?id="+id+"&page="+no;
	xmlHttp=GetXmlHttpObject(showlist)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}
function showlist()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {   
	    document.getElementById("list").innerHTML = ""
		xmlAuthor = xmlHttp.responseXML.getElementsByTagName("Author")
		xmlContent = xmlHttp.responseXML.getElementsByTagName("Content")
		xmlNoI = xmlHttp.responseXML.getElementsByTagName("NoI")
		xmlIP = xmlHttp.responseXML.getElementsByTagName("IP")
		xmlreContent = xmlHttp.responseXML.getElementsByTagName("reContent")
		//输出评论
		for (i=0;i<xmlContent.length;i++) {  
		    var Content = xmlContent[i].firstChild.data;
            var div = document.createElement("DIV");   
            div.id = i; 
			if (Content == "没有评论") {
			    //alert(1)
			    div.innerHTML = "<div style='margin:15px;color:#ff0000;'>还没有评论，就等您了~~</div>"
			}
			else {
			    var Author = xmlAuthor[i].firstChild.data;
			    var PostTime = xmlAuthor[i].getAttribute('PostTime');
			    var NoI = xmlNoI[i].firstChild.data;
			    var IP = xmlIP[i].firstChild.data;
				var reContent = xmlreContent[i].firstChild.data;
			    div.innerHTML = "<div class='plun' style='clear:both;'><div class='ptitle'><div class='pnoi'>"+NoI+"楼.</div><div class='pname'>"+Author+"</div><div class='pIP'>来自："+IP+"</div><div class='pltime'>"+PostTime+"</div></div><div class='pings'>"+Content+"<div class='repings'>"+reContent+"</div></div></div>"
			}
            document.getElementById("list").appendChild(div);
		}
		 //输出分页信息
		P_Nums = xmlHttp.responseXML.getElementsByTagName("data")[0].getAttribute('P_Nums');
		if (P_Nums>1) {
	    	var page = xmlHttp.responseXML.getElementsByTagName("data")[0].getAttribute('page');
	    	var ID = xmlHttp.responseXML.getElementsByTagName("data")[0].getAttribute('ID');
		var D_Nums = xmlHttp.responseXML.getElementsByTagName("data")[0].getAttribute('D_Nums');
		    var l1 = "<a class='total'>&nbsp;"+D_Nums+"&nbsp;</a><a class='pages'>&nbsp;"+page+"/"+P_Nums+"&nbsp;</a>"
			l1 = (page>1)?l1+"<a href='javascript:showre("+ID+",1)' class='redirect'><img src='"+web_path+"images/first.gif' width='9' height='8' />&nbsp;</a>":l1;
			var l2 = "";
			for (var i =1;i<=P_Nums;i++) {
			     l2 += (i == page)?"<a class='curpage'>"+i+"</a>":"<a href='javascript:showre("+ID+","+i+")' class='num'>"+i+"</a>"
			}
			l2 = (page == P_Nums)?l2:l2+"<a href='javascript:showre("+ID+","+P_Nums+")' class='redirect'><img src='"+web_path+"images/last.gif' width='9' height='8' />&nbsp;</a>"
			document.getElementById("MultiPage").innerHTML = l1+l2;
		}
	}
	
}
/* 发送留言 */
function AddNew() {
    document.getElementById("sendGuest").disabled = true;
    var Author = escape(document.getElementById("memAuthor").value);
    var Content = escape(document.getElementById("memContent").value);
	var MusicID = escape(document.getElementById("MusicID").value);
    if (Author == "" || Content == "") {
	    alert("请填写完整！");
		document.getElementById("sendGuest").disabled = false;
		return false;
	}
    addNew = GetXmlHttpObject(sendGuest);
    var GuestInfo = "Author="+Author+"&MusicID="+MusicID+"&Content="+Content;
    addNew.open("POST",""+web_path+"AddNew.asp",false); 
    addNew.setRequestHeader("Content-Type","application/x-www-form-urlencoded") 
    addNew.send(GuestInfo); 
} 
function sendGuest() {
    if (addNew.readyState==4 || addNew.readyState=="complete") {
       alert(unescape(addNew.responseText));
	   document.getElementById("sendGuest").disabled = false;
	   document.getElementById("memAuthor").value = "";
	   document.getElementById("memContent").value = "";
	   showre(document.getElementById("MusicID").value,1);
	} 
}
function reSet() {
     document.getElementById("memAuthor").value = "";
	 document.getElementById("memContent").value = "";
}

function Marquee()
{
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID)
	{
		//alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.Correct = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "bottom":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8]
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}


Marquee.prototype.Start = function()
{
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width;
	this.ID.style.height = this.Height;
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var msobj = this;
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function()
				{
					if(msobj.MouseOver == 1)
					{
						setTimeout(msobj.Continue,delaytime);
					}
					else
					{	clearInterval(msobj.TimerID);
						msobj.CTL = msobj.Stop = 0;
						msobj.TimerID = setInterval(msobj.StartID,timer);
					}
				}

	msobj.Pause = function()
			{
				msobj.Stop = 1;
				clearInterval(msobj.TimerID);
				setTimeout(msobj.Continue,delaytime);
			}

	msobj.Begin = function()
		{
			msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth : msobj.ID.scrollHeight;
			if((msobj.Direction <= 1 && msobj.ClientScroll <msobj.Height) || (msobj.Direction > 1 && msobj.ClientScroll <msobj.Width))return;
			msobj.ID.innerHTML += msobj.ID.innerHTML;
			msobj.TimerID = setInterval(msobj.StartID,timer);
			if(msobj.ScrollStep < 0)return;
			msobj.ID.onmousemove = function(event)
						{
							if(msobj.ScrollStep == 0 && msobj.Direction > 1)
							{
								var event = event || window.event;
								if(window.event)
								{
									if(msobj.IsNotOpera)
									{
										msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
									}
									else
									{
										msobj.ScrollStep = null;
										return;
									}
								}
								else
								{
									msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
								}
								msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
								msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
								msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
							}
						}
			msobj.ID.onmouseover = function()
						{
							if(msobj.ScrollStep == 0)return;
							msobj.MouseOver = 1;
							clearInterval(msobj.TimerID);
						}
			msobj.ID.onmouseout = function()
						{
							if(msobj.ScrollStep == 0)
							{
								if(msobj.Step == 0)msobj.Step = 1;
								return;
							}
							msobj.MouseOver = 0;
							if(msobj.Stop == 0)
							{
								clearInterval(msobj.TimerID);
								msobj.TimerID = setInterval(msobj.StartID,timer);
							}
						}
		}
	setTimeout(msobj.Begin,waittime);
}

Marquee.prototype.Scroll = function()
{
	switch(this.Direction)
	{
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop >= this.ClientScroll)
				{
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop <= 0)
				{
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft >= this.ClientScroll)
				{
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft <= 0)
				{
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}

//加入收藏
function addfavorite()
{
 if (document.all)
 {
 window.external.addFavorite('http://www.7ting8.cn','去听吧音乐网www.7ting8.cn');
 }
 else if (window.sidebar)
 {
 window.sidebar.addPanel('去听吧音乐网', 'http://www.7ting8.cn', "");
 }
} 

function sc1(){ 
 document.getElementById("light").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("light").offsetHeight)/2)+"px"; 
 document.getElementById("light").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("light").offsetWidth)/2)+"px"; 
}
function sc2(){ 
 document.getElementById("uservip").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("uservip").offsetHeight)/2)+"px"; 
 document.getElementById("uservip").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("uservip").offsetWidth)/2)+"px"; 
}
function scall(){
 sc1();sc2();
}
window.onscroll=scall;
window.onresize=scall;
//window.onload=scall;
document.writeln("<div id=\"light\" class=\"white_content\"> ");
document.writeln("	<h5><span><a href=\"#\" onClick=\"document.getElementById(\'light\').style.display=\'none\';document.getElementById(\'fade\').style.display=\'none\'\"><img src=\"\/images\/close.gif\" \/><\/a><\/span>签写留言<\/h5>");
document.writeln("<iframe id=\"link\" src=\"\/Guestbook.asp?action=add\" width=\"100%\" height=\"170\" SCROLLING=\"NO\" FRAMEBORDER=\"0\"><\/iframe>");
document.writeln("<\/div> ");
document.writeln("<div id=\"fade\" class=\"black_overlay\"><\/div> ")

document.writeln("<div id=\"uservip\" class=\"white_content\"> ");
document.writeln("	<h5><span><a href=\"#\" onClick=\"document.getElementById(\'uservip\').style.display=\'none\';document.getElementById(\'fade\').style.display=\'none\'\"><img src=\"\/images\/close.gif\" \/><\/a><\/span>会员升级需知<\/h5>");
document.writeln("<\/div> ");
document.writeln("<div id=\"fade\" class=\"black_overlay\"><\/div> ")
