﻿var objnum = 1;

function getnum()
{
	objnum++;
	return objnum;
}

// 上下移动窗口
function scrollDiv(oObj, uObj, dObj)
{
	var self = this;
	this.init = function()
	{
		this.pos = 0;
		this.spd = 250;
		this.tim = null;		
		this.Obj = document.getElementById(oObj);
		this.Obj1 = document.getElementById(uObj);
		this.Obj2 = document.getElementById(dObj);
		if (this.Obj == null || this.Obj1 == null || this.Obj2 == null)
		{
			alert("初始化失败!");
			return null;
		}
		this.Obj.SourceObj = this.Obj1.SourceObj = this.Obj2.SourceObj= this;
		this.Obj1.onmouseover = new Function("this.SourceObj.Move(this.SourceObj, -1);");
		this.Obj1.onmouseout = new Function("this.SourceObj.Move(this.SourceObj, 0);");
		this.Obj2.onmouseover = new Function("this.SourceObj.Move(this.SourceObj, 1);");
		this.Obj2.onmouseout = new Function("this.SourceObj.Move(this.SourceObj, 0);");		
	}
	this.Move = function(obj, step)
	{		
		if (step == 0) { clearTimeout(obj.tim); }
		else if (step == 1)
		{
			obj.stp = 2;
			obj.tim = setTimeout(obj.Scroll, this.spd);	
		}
		else if (step == -1)
		{
			obj.stp = -2;
			obj.tim = setTimeout(obj.Scroll, this.spd);	
		}
	}
	this.Scroll = function()
	{
		var height = self.Obj.scrollHeight-self.Obj.offsetHeight;
		self.pos = self.pos + self.stp;
		if (self.pos<=0) self.pos = 0;
		if (self.pos>=height) self.pos = height;
		self.Obj.scrollTop = self.pos;
		//window.status = self.pos+"  "+self.Obj.scrollHeight+"  "+self.Obj.offsetHeight+"  "+height;
		self.tim = setTimeout(self.Scroll, this.spd);	
	}
	this.init();
}


// 播放图片
function Slide(sObj, sPic)
{
	this.imgUrl=new Array();
	this.imgLink=new Array();
	var tArr = sPic.split(";");
	var f=0;
	for(var t=0; t<tArr.length; t++)
	{
		if (tArr[t].indexOf(",")>0)
		{
			var fArr = tArr[t].split(",");
			this.imgUrl[f] = fArr[0];
			this.imgLink[f] = fArr[1];
			f++;
		}
	}
	this.adNum=0;
	this.count=0;
	this.key=0;
	this.Obj = document.getElementById(sObj);
	this.count = this.imgUrl.length;	
	var self = this;
	
	this.playTran = function()
	{
		if (document.all) self.Obj.filters.revealTrans.play();
	}

	this.nextAd = function()
	{
		if(self.adNum<self.count-1)self.adNum++ ;
		else self.adNum=0;
	
		if( self.key==0 ){ self.key=1;} 
		else if (document.all)
		{
			self.Obj.filters.revealTrans.Transition=Math.random()*23;
			self.Obj.filters.revealTrans.apply();
			self.playTran();
		}
		self.Obj.src=self.imgUrl[self.adNum];
		setTimeout(self.nextAd, 3000); //控制时间
	}
	this.goUrl = function() { window.open(this.imgLink[adNum],'_blank'); }
	this.nextAd();
}



// 移动图片
function MovePic(sFile, sUrl, sTitle, sType, sSpeed, sWidth, sHeight)
{
	var self = this;
	this.init = function ()
	{
		var tNum = getnum();
		var sFileType = sFile.toLowerCase().substring(sFile.length-3, sFile.length);
		var sHtml = "<div id='mObj"+tNum+"' style='position:absolute;'>";
		if (sFileType =="jpg" || sFileType=="gif") { sHtml = sHtml +"<a href='"+sUrl+"' target='_blank' title='"+sTitle+"'><img src='"+sFile+"' border='0' alt='"+sTitle+"' width='"+ sWidth+"' height='"+sHeight+"'></a>"; }
		else if (sFileType =="swf") { sHtml = sHtml +"<embed src='"+sFile+"' quality=high type='application/x-shockwave-flash' width='"+sWidth+"' height='"+sHeight+"'></embed>"; }
		else { sHtml = sHtml +"<a href='"+sFile+"'>下载该文件</a>"; }	
		if (sUrl!="") {sHtml = sHtml +"</a>";}
		sHtml = sHtml +"</div>";
		document.write(sHtml);
		this.oObj = document.getElementById("mObj"+tNum);
		this.oObj.visibility = "visible";
		this.movetype = sType;
		this.xPos = 20;
		this.yPos = 0;
		this.step = 1;
		this.delay = 30;
		this.height = 0;
		this.Hoffset = 0;
		this.Woffset = 0;
		this.yon = 0;
		this.xon = 0;
		this.pause = true;		
		this.timer=setInterval(this.move, sSpeed);
	}

	this.move = function()
	{
		var width = (document.documentElement.clientHeight == 0) ? document.body.clientWidth : document.documentElement.clientWidth;
		var height = (document.documentElement.clientHeight == 0) ? document.body.clientHeight : document.documentElement.clientHeight;
		var Hoffset = self.oObj.offsetHeight;
		var Woffset = self.oObj.offsetWidth;
		if (self.movetype == "1")
		{
			self.oObj.style.pixelTop=document.body.scrollTop+(height/3);
			self.oObj.style.pixelLeft=10;
		}
		else if (self.movetype == "2")
		{
			self.oObj.style.pixelTop=document.body.scrollTop+(height/3);
			self.oObj.style.pixelLeft=width-Woffset-10;
		}
		else
		{
			self.oObj.style.left = self.xPos + document.body.scrollLeft;
			self.oObj.style.top = self.yPos + document.body.scrollTop;
			if (self.yon){	self.yPos = self.yPos + self.step; }
			else { self.yPos = self.yPos - self.step; }
			if (self.yPos < 0) { self.yon = 1; self.yPos = 0;}
			if (self.yPos >= (height - Hoffset)) 
			{
				self.yon = 0;
				self.yPos = (height - Hoffset);
			}
			if (self.xon) { self.xPos = self.xPos + self.step; }
			else { self.xPos = self.xPos - self.step; }
			if (self.xPos < 0) { self.xon = 1; self.xPos = 0; }
			if (self.xPos >= (width - Woffset)) { self.xon = 0; self.xPos = (width - Woffset); }
		}
	}
	this.init();
}

// 打开窗体
function OpenWnd(wd,hd) 
{
	var turl = "open.asp";
	var tt=(screen.height-hd)/2;
	var ll=(screen.width-wd)/2;
	var winn=window.open(turl,"","scrollbars=no,resizable=no,status=no,width="+wd+",height="+hd+",top="+tt+",left="+ll);
	winn.focus();
	return false;
}

// 多张图片轮流显示
function switchpic(sObj, sPic, sLink)
{
	this.init = function()
	{		
		oObj			= document.getElementById(sObj);
		this.Obj		= oObj;
		oObj.SourceObj 	= this;
		this.picArr	 	= sPic.split("|");
		this.urlArr		= sLink.split("|");
		this.picObj		= new Array();
		this.adNum		= 0;
		this.theTimer	= null;
		this.Obj.onclick = new Function("this.SourceObj.openUrl();");	
	
	}
	
	this.setTransition = function()
	{
		if (document.all)
		{
			this.Obj.filters.revealTrans.Transition=Math.floor(Math.random()*23); 
			this.Obj.filters.revealTrans.apply(); 
		}
	}
	
	this.playTransition = function()
	{
		if (document.all) this.Obj.filters.revealTrans.play() 
	}
	this.playAd = function(n)
	{
		clearInterval(this.theTimer);
		if (n<this.picArr.length)
		{
			this.setTransition(); 
			this.Obj.src=this.picArr[n]; 
			this.playTransition();
		}		
		this.theTimer=setInterval("oObj.SourceObj.nextAd(oObj.SourceObj)", 5000);
	}
	this.nextAd = function(cur)
	{
		if(cur.adNum<cur.picArr.length-1) { cur.adNum++;  }
		else { cur.adNum=0; }
		cur.playAd(cur.adNum);
	} 

	this.openUrl = function()
	{
		sUrl=this.urlArr[this.adNum]; 
		if (sUrl != "") { window.open(sUrl, "_blank"); }
	}
	this.init();
	this.nextAd(oObj.SourceObj);
}

function mTab(tArr, tMore, tIndex, tClass)
{
	this.curHead = null;
	this.curBody = null;
	this.curMore = null;
	this.curData = tArr;
	if (tClass == "" || tClass == null) tClass = "mtab_open,mtab_close";
	this.curClass= tClass.split(",");
	this.MoreObj = document.getElementById(tMore);
	if (tIndex == "" || tIndex == null) tIndex = 0;
	this.curIndex= tIndex;
	
	this.init = function()
	{
		for (var i=0; i<this.curData.length; i++)
		{
			var dHead = document.getElementById(this.curData[i][0]);
			var dBody = document.getElementById(this.curData[i][1]);
			if (dHead && dBody)
			{
				dHead.SourceObj = dBody.SourceObj = this;
				dHead.onmouseover = new Function("this.SourceObj.SelectTab(" + i + ")");
				if (i == tIndex)
				{
					dHead.className = this.curClass[0];
					dBody.style.display = "";
					this.curHead = dHead;
					this.curBody = dBody;
					dHead.click();
				}
				else
				{
					dHead.className = this.curClass[1]
					dBody.style.display == "none";
				}
			}
		}
	}
	this.SelectTab = function(curIndex)
	{
		this.curHead.className = this.curClass[1];
		this.curBody.style.display = "none";
		var dHead = document.getElementById(this.curData[curIndex][0]);
		var dBody = document.getElementById(this.curData[curIndex][1]);
		var dMore = this.curData[curIndex][2];
		if (this.MoreObj != null) this.MoreObj.href=dMore;   
		dHead.className = this.curClass[0];
		dBody.style.display = "";
		this.curHead = dHead;
		this.curBody = dBody;
	}	
	this.init();
}

// 切换动态
function switchnew(name, total, class1, class2, isauto, speed)
{
	var self = this;
	this.init = function()
	{
		if (isauto == null) isauto = false;
		if (speed == null) speed = 6000;
		this.name = name;
		this.total = total;
		this.isauto = isauto;
		this.speed = speed;
		this.classname1 = class1;
		this.classname2 = class2;
		this.cur = 1;
		this.disp();
	}
	this.open = function(n) { this.curid = n; this.disp(); }
	this.auto = function()
	{
		if (this.curid>this.total) this.curid = 1;	
		this.disp();
		this.curid++;				
	}
	this.disp = function()
	{
		for(var t=1; t<=self.total; t++)
		{
			var tPic = document.getElementById(self.name+"p"+t);
			var tList = document.getElementById(self.name+"n"+t);
			if (tPic != null && tList != null)
			{
				if (t == this.curid) { tPic.classname=self.class1; tList.style.display = ''; }	
				else { tPic.classname=self.class2; tList.style.display = 'none'; }
			}
		}			
	}
	if (this.isauto) { this.timer=setTimeout(self.disp, this.speed); }
	this.init();
	return this;
}


/* 滚动 样式类
创建实例:
		//参数直接赋值法
		new Marquee("marquee")
		new Marquee("marquee","top")
		......
		new Marquee("marquee",0,1,760,52)
		new Marquee("marquee","top",1,760,52,50,5000)
		......
		new Marquee("marquee",0,1,760,104,50,5000,3000,52)
		new Marquee("marquee",null,null,760,104,null,5000,null,-1)

		//参数动态赋值法
		var marquee1 = new Marquee("marquee")	*此参数必选
		marquee1.Direction = "top";	或者	marquee1.Direction = 0;
		marquee1.Step = 1;
		marquee1.Width = 760;
		marquee1.Height = 52;
		marquee1.Timer = 50;
		marquee1.DelayTime = 5000;
		marquee1.WaitTime = 3000;
		marquee1.ScrollStep = 52;
		marquee1.Start();

	参数说明:
		ID		"marquee"	容器ID		(必选)
		Direction	(0)		滚动方向	(可选,默认为0向上滚动) 可设置的值包括:0,1,2,3,"top","bottom","left","right" (0向上 1向下 2向左 3向右)
		Step		(1)		滚动的步长	(可选,默认值为2,数值越大,滚动越快)
		Width		(760)		容器可视宽度	(可选,默认值为容器初始设置的宽度)
		Height		(52)		容器可视高度	(可选,默认值为容器初始设置的高度)
		Timer		(50)		定时器		(可选,默认值为30,数值越小,滚动的速度越快,1000=1秒,建议不小于20)
		DelayTime	(5000)		间歇停顿延迟时间(可选,默认为0不停顿,1000=1秒)
		WaitTime	(3000)		开始时的等待时间(可选,默认或0为不等待,1000=1秒)
		ScrollStep	(52)		间歇滚动间距	(可选,默认为翻屏宽/高度,该数值与延迟均为0则为鼠标悬停控制,-1禁止鼠标控制)

　使用建议:
		1、建议直接赋予容器的显示区域的宽度和高度，如(<div id="marquee" style="width:760px;height:52px;">......</div>)
		2、建议为容器添加样式overflow = auto，如(<div id="marquee" style="width:760px;height:52px;overflow:auto;">......</div>)
		3、为了更准确的获取滚动区域的宽度和高度，请尽可能将各滚动单位直接赋予正确宽高度
		4、对于TABLE标记的横向滚动，需要对TABLE添加样式display = inline，如(<div id="marquee" style="width:760px;height:52px;overflow:auto;"><table style="display:inline">......</table></div>)
		5、对于翻屏滚动或间歇滚动，要注意各滚动单位间的间距，同时需要对容器的可视高度和可视宽度做好准确的设置，对于各滚动单位间的间距可以通过设置行间距或者单元格的高宽度来进行调整
		6、对于LI自动换行的问题暂时没有更好的解决办法，建议将其转换成表格(TABLE)的形式来达到同等的效果
		7、针对横向滚动的文字段落，如果最末端是以空格" "结束的，请将空格" "转换成" "
		8、鼠标悬停滚动思想源自Flash，所以有一定的局限性（容器内仅允许用图片<img>或者带链接的图片<a><img></a>的形式，并需要禁止其自动换行）
制)
****/
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.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":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.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + "px";
	this.ID.style.height = this.Height + "px";
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
	var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
	var msobj = this;
	msobj.tempHTML = msobj.ID.innerHTML;
	if(msobj.Direction <= 1)
	{
		msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
	}
	else
	{
		if(msobj.ScrollStep == 0 && msobj.DelayTime == 0)
		{
			msobj.ID.innerHTML += msobj.ID.innerHTML;
		}
		else
		{
			msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
		}
	}
	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 / 2 : msobj.ID.scrollHeight / 2;
			if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step))			{
				msobj.ID.innerHTML = msobj.tempHTML;
				delete(msobj.tempHTML);
				return;
			}
			delete(msobj.tempHTML);
			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 RollingPic(sObj, sObj1, sObj2, sSpeed, sDirection)
{
	var self = this;	
	this.init = function()
	{
		this.speed = sSpeed;
		this.Obj	= document.getElementById(sObj);
		this.Obj1	= document.getElementById(sObj1);
		this.Obj2	= document.getElementById(sObj2);
		this.Obj2.innerHTML = this.Obj1.innerHTML;
		this.timer=setInterval(this.move, this.speed);		
		this.Obj.onmouseover=function() {clearInterval(self.timer)};
		this.Obj.onmouseout=function() {self.timer=setInterval(self.move, self.speed)};
	}
	
	this.move = function()
	{
		if (sDirection == 1) //向上
		{
			if(self.Obj2.offsetTop-self.Obj.scrollTop<=0) { self.Obj.scrollTop-=self.Obj1.offsetHeight; }
			else{self.Obj.scrollTop++; }
		}
		else if (sDirection == 2) // 向下
		{
			if(self.Obj1.offsetTop-self.Obj.scrollTop>=0) { self.Obj.scrollTop+=self.Obj2.offsetHeight; }
			else{self.Obj.scrollTop--; }

		}
		else if (sDirection == 3) // 向左
		{
			if(self.Obj2.offsetWidth-self.Obj.scrollLeft<=0) { self.Obj.scrollLeft-=self.Obj1.offsetWidth; }
			else{self.Obj.scrollLeft++;}
		}
		else if (sDirection == 4) // 向右
		{
			if(self.Obj.scrollLeft<=0) { self.Obj.scrollLeft+=self.Obj2.offsetWidth; }
			else{ self.Obj.scrollLeft--; }
		}
	}
	this.init();
}

/* 光标跟随文字*/
function MouseTxt(sText, sColor)
{
	var self = this;
	this.init = function()
	{
		this.name = "mousetext";
		this.xpos = new Array();
		this.ypos = new Array();
		this.x = 0;
		this.y = 0;
		this.timer = 0;
		this.step=20;
		this.flag=0;		
		if (sColor.length<6) sColor = "#ff8040";
		this.message = sText.split("");	
		for (var i=0;i<this.message.length;i++){ this.xpos[i]=-50 }
		for (var i=0;i<this.message.length;i++){ this.ypos[i]=-50 }
		for (var i=0;i<this.message.length;i++) 
		{
			document.write("<span id='"+this.name+"_"+i+"'class='movetxtstyle' style='COLOR: "+sColor+"; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; FONT-WEIGHT: bold; POSITION: absolute; TOP: -50px; VISIBILITY: visible'>")
			document.write(this.message[i])
			document.write("</span>")
		}
		if (document.layers) {	document.captureEvents(Event.MOUSEMOVE); }
		document.onmousemove = this.move;
		this.make();
	}
	
	this.move = function(e)
	{
		self.x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX;
		self.y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY;
		self.flag=1;
	}

	this.make = function()
	{
		if (self.flag==1 && document.all) 
		{
			for (var i=self.message.length; i>=1; i--) 
			{
				self.xpos[i]=self.xpos[i-1]+self.step;
				self.ypos[i]=self.ypos[i-1];
			}
			self.xpos[0]=self.x+self.step
			self.ypos[0]=self.y
			for (var i=0; i<self.message.length; i++) 
			{
				var thisspan = eval(""+self.name+"_"+(i)+".style")
				thisspan.posLeft=self.xpos[i];
				thisspan.posTop=self.ypos[i];
			}   
		}
		else if (self.flag==1 && document.layers) 
		{
			for (var i=self.message.length; i>=1; i--) 
			{
				self.xpos[i]=self.xpos[i-1]+self.step;
				self.ypos[i]=self.ypos[i-1];
			}
			self.xpos[0]=self.x+self.step;
			self.ypos[0]=self.y;
			for (i=0; i<self.message.length; i++) 
			{
				var thisspan = eval("document."+self.name+"_"+i)
				thisspan.left=self.xpos[i]
				thisspan.top=self.ypos[i]
			}   
		}
		self.timer=setTimeout(self.make, 30)
	}
	this.init();
}

// 自动显示时间
function disptime(sID)
{
	var self = this;
	this.init = function()
	{
		this.oObj = document.getElementById(sID);
	}
	this.disp = function()
	{
		var thistime= new Date();
		var hours=thistime.getHours();
		var minutes=thistime.getMinutes();
		var seconds=thistime.getSeconds();
		if (eval(hours) <10) {hours="0"+hours; }
		if (eval(minutes) < 10) {minutes="0"+minutes; }
		if (eval(seconds) < 10) {seconds="0"+seconds; }
		self.oObj.innerHTML = hours+":"+minutes+":"+seconds;		
	}
	this.timer=setTimeout(this.disp, 1000)
	this.init();
}

// 添加文字复制信息

var copyText = "";
function copyAddText()
{ 
	event.returnValue=false; 
	var txt_cr=document.selection.createRange().text; 
	var copy_cr="本文来自："+document.URL+"， "+copyText;
	clipboardData.setData("Text","\r\n"+txt_cr+"\r\n"+copy_cr+"\r\n"); 
} 

