<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">//这里放的都是js对象


/*
一个个的下载图片
*/
function objShowImg()
{
	this.objectName="";          //对象的实例(变量)名称
	this.isIE = false;  //是IE，还是Firfox
	
	this.theImgIDName = "";
	this.theImgIDName_tag = "|";
	this.getIDIntervalCount_curr = 0; //当某个ID临时无效时，要过一会儿再获取ID，重新获取的开始次数
	this.getIDIntervalCount_max = 3;  //最多次数
	
	this.isScalePicWH=true;
	this.picMaxWidth=0;
	this.picMaxHeight=0;
	this.isFinished=false;
	this.whenFinishedDoFunc="";  //当这次所有图片都下载好后，要执行的外部过程名
	
	this.prevShowImgObj=null;         //上个objShowImg对象
	this.prevShowImgIsFinished=true;  //上个objShowImg是不是已全部下载完图片了


	this.interval = 200;
	this.interval_checkTheID = 500;
	this.interval_getID = 300;
	
	this.currID=0;
	this.totalID=-1;
	this.bClearTitle = true;

	this.bIsDefineDOCTYPE = false;  //当页面有定义&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...时，和没定义是不一样的，主要是documentElement.clientHeight和body.clientHeight不一样
	this.bIsStartToLoad = false;    //load在外部不管被调用多少次，但这里实际只执行1次，防止图片多次加载
	this.containerIDName = "";      //外层的容器id名称
	this.bIsNoScrollBar = false;    //判断有没滚动条，只要"外层的容器"的top小于documentElement.clientHeight就可以了
	this.loadByScroll_addTop = -200; //外层的容器top加这个addTop

	
	this.arr1=new Array();  //span's uniqueID
	this.arr2=new Array();  //status:0=not load, 1=loading, 2=load

	this.msgSpan = null;  //显示进度

	this.getAllID = function()
	{
		var arr = new Array();
		var i, obj;
		var theImgIDName = this.theImgIDName.toLowerCase();
		var coll;
//		if (this.isIE)
//		{
//			coll = document.getElementsByName(this.theImgIDName);  //ie 10不行
//			return coll;
//		}
//		else
//		{
			//这种速度慢
			coll = document.getElementsByTagName("SPAN");  //"*"  
			for (i = 0; i &lt; coll.length; i++)
			{
				obj = coll[i];
				if (obj.id.toLowerCase() == theImgIDName)
				{
					arr.push(obj);
				}
			}
		//}
		return arr;
	}
	
	this.getID = function(index)
	{
		var obj;
		var theID = null;
		var theDiv_Img_all = this.getAllID();
		if (!theDiv_Img_all) { return theID; }

		var l = theDiv_Img_all.length;
		if (l == undefined)  //only one
		{
			theID = theDiv_Img_all;
		}
		else
		{
			for (h = 0; h &lt; l; h++)
			{
				obj = theDiv_Img_all[h];
				if (this.getIndexFromTitle(obj.title) == index.toString())
				{
					theID = obj;
					break;
				}
			}
		}
		return theID;
	}

	
	this.init = function(theImgIDName)
	{
		this.theImgIDName = theImgIDName;
		//alert("this.theImgIDName=" + this.theImgIDName);

		var ua = navigator.userAgent; ua = ua.toLowerCase();
		var e1 = "MSIE".toLowerCase();
		var e2 = "Firefox".toLowerCase();
		var q1 = ua.indexOf(e1);
		var q2 = ua.indexOf(e2);
		if (q1 &gt; -1) { this.isIE = true; }
		//alert("this.isIE="+this.isIE);

		var theDiv_Img_all = this.getAllID();
		if (!theDiv_Img_all)
		{ return; }
		//alert("XX=" + typeof (theDiv_Img_all))

		var l = theDiv_Img_all.length;
		var theID;
		var h = 0;
		this.totalID = 0;
		//alert("l=" + l);

		if (l == undefined)  //only one
		{
			theID = theDiv_Img_all;
			this.init_2(theID, 0);
		}
		else
		{
			for (h = 0; h &lt; l; h++)
			{
				theID = theDiv_Img_all[h];
				this.init_2(theID, h);
			}
		}
	}
	this.init_2 = function(theID, index)
	{
		var tmpID;
		if (typeof (theID) == "object")
		{
			//alert("theID.tagName["+index+"]=" + theID.tagName);
			
			this.setTitle(theID, index);
			this.arr1[this.totalID] = index;
			this.arr2[this.totalID] = 0;
			//alert("index=" + index);

			this.totalID++;
		}
	}
	//&lt;span id="theImgSrc" title="1|http://mImg.loveinhere.com.love/21/100615.jpg"&gt;&lt;/span&gt;
	this.setTitle = function(theID, index)
	{
		theID.title = index + this.theImgIDName_tag + theID.title;
	}
	this.getTitle = function(title)
	{
		var r = title;
		var p = title.indexOf(this.theImgIDName_tag);
		if (p &gt; -1)
		{
			r = title.substr(p + this.theImgIDName_tag.length);
		}
		return r;
	}
	this.getIndexFromTitle = function(title)
	{
		var r = 0;
		var p = title.indexOf(this.theImgIDName_tag);
		if (p &gt; -1)
		{
			r = title.substr(0, p);
		}
		return r;
	}
	
	
	this.init_msgSpan=function(theMsgSpanIDName)
	{
		var theID=document.getElementById(theMsgSpanIDName);
		if(theID)
		{
			this.msgSpan=theID;
		}
	}

	//显示信息
	this.showInfo = function(idName)
	{
		var uniqueID;
		var status;
		var i, html = "";
		var theID;
		var obj;

		html = html + "&lt;br&gt;this.objectName=" + this.objectName;
		if (this.prevShowImgObj)
		{
			html = html + "&lt;br&gt;this.prevShowImgObj.objectName=" + this.prevShowImgObj.objectName;
			html = html + "&lt;br&gt;this.prevShowImgIsFinished=" + this.prevShowImgIsFinished;
		}

		for (i = 0; i &lt; this.totalID; i++)
		{
			uniqueID = this.arr1[i];
			status = this.arr2[i];
			obj = this.getID(uniqueID);

			html = html + "&lt;br&gt;[" + i + "] uniqueID=" + uniqueID + ", status=" + status;
			if (obj)
			{
				html = html + ", title=" + obj.title;
			}
		}

		var theID = document.getElementById(idName);
		if (theID)
		{
			theID.innerHTML = html;
		}
	}

	
	//当页面向下移动到图片的外容器时，才显示图片
	this.loadByScroll = function()
	{
		if (this.isFinished) { return; }
		if (this.bIsNoScrollBar) { return; }

		var obj = document.getElementById(this.containerIDName);
		if (!obj) { return; }
		var xy = getObjXY(obj);
		var objTop = xy[1];
		var t = "";
		var isDoit = false;
		if (this.bIsDefineDOCTYPE)
		{
			t = "document.documentElement.scrollTop=" + document.documentElement.scrollTop + ",document.documentElement.clientHeight=" + document.documentElement.clientHeight + ",objTop=" + objTop;
			isDoit=document.documentElement.scrollTop + document.documentElement.clientHeight &gt;= parseInt(objTop) + this.loadByScroll_addTop
		}
		else
		{
			t = "document.body.scrollTop=" + document.body.scrollTop + ",document.body.clientHeight=" + document.body.clientHeight + ",objTop=" + objTop;
			isDoit = document.body.scrollTop + document.body.clientHeight &gt;= parseInt(objTop) + this.loadByScroll_addTop
		}
		window.status = t;
		//alert(t);
		if (isDoit)
		{
			this.load();
		}
	}
	//如果没有滚动条就要直接显示图片
	this.loadByScroll_noScrollBar = function()
	{
		if (this.isFinished) { return; }

		var obj = document.getElementById(this.containerIDName);
		if (!obj) { return; }
		var xy = getObjXY(obj);
		var objTop = xy[1];
		var t = "documentElement.clientHeight=" + document.documentElement.clientHeight + ",body.clientHeight=" + document.body.clientHeight + ",objTop=" + objTop; +",objTop=" + objTop;
		var isDoit = false;
		if (this.bIsDefineDOCTYPE)
		{
			isDoit=document.documentElement.clientHeight &gt;= parseInt(objTop) + this.loadByScroll_addTop
		}
		else
		{
			isDoit = document.body.clientHeight &gt;= parseInt(objTop) + this.loadByScroll_addTop
		}
		window.status = t;
		//alert(t);
		if (isDoit)
		{
			this.bIsNoScrollBar = true;
			this.load();
		}
	}	
	this.load = function()
	{
		if (this.bIsStartToLoad == false)
		{
			this.bIsStartToLoad = true;
			this.load_do();
		}
		else
		{
			return;
		}
	}
	this.load_do = function()
	{
		if (!this.prevShowImgIsFinished)
		{
			window.setTimeout(this.objectName + ".doInterval();", this.interval);
			return;
		}



		if (this.totalID == -1) { return; }
		if (this.isFinished) { return; }

		var uniqueID = this.arr1[this.currID];
		var status = this.arr2[this.currID];
		var theID;
		var imgHtml = "";
		var imgSrc = "";

		theID = this.getID(uniqueID);

		if (!theID)
		{
			if (this.getIDIntervalCount_curr &lt; this.getIDIntervalCount_max)
			{
				window.setTimeout(this.objectName + ".doInterval_getID();", this.interval_getID);
				this.getIDIntervalCount_curr++;
				return;
			}
			//alert("uniqueID=" + uniqueID);
		}
		this.getIDIntervalCount_curr = 0;  //这里要重置

		if (!theID)
		{
			this.doNextLoad(this.currID);
			return;
		}

		if (status == 1)
		{
		}
		else if (status == 2)
		{
		}
		else  //status==0
		{
			try
			{
				imgSrc = this.getTitle(theID.title);
				//title要在下载完成再清除


				imgHtml = "&lt;img src=\"" + imgSrc + "\" class=ig";
				if (this.isIE)
				{
					imgHtml += " onreadystatechange=\"";
				}
				else
				{
					imgHtml += " onload=\"";
				}
				if (this.isScalePicWH)
				{
					imgHtml += "scalePicWH(this," + this.picMaxWidth + "," + this.picMaxHeight + ");";
				}
				imgHtml += this.objectName + ".onrsc(this," + this.currID + ");";
				imgHtml += "\" onerror=\"" + this.objectName + ".onerr(this," + this.currID + ");\"&gt;";

				//alert(imgHtml);
				theID.innerHTML = imgHtml;

				window.setTimeout(this.objectName + ".checkTheID(" + this.currID + ");", this.interval_checkTheID); //有时这个span的ID已经无效了,所有要检查一下

			}
			catch (e)
			{
				//alert("e="+e);
				this.doNextLoad(this.currID);
			}

			if (this.msgSpan)
			{
				this.msgSpan.innerHTML = "" + parseInt((this.currID + 1) * 100 / this.totalID) + "%";
			}
			window.status = "正在下载第(" + (this.currID + 1) + "/" + this.totalID + ")张图片...";
		}
	}

	


	//title清除了就没办法再获取这个ID了
	this.clearTitle = function(downImg_currID)
	{
		var theID, uniqueID;
		if (this.bClearTitle)
		{
			uniqueID = this.arr1[downImg_currID];
			theID = this.getID(uniqueID);
			if (theID)
			{
				theID.removeAttribute("title");  //theID.title="";
			}
		}
	}
	this.onrsc = function(theID, downImg_currID)
	{
		if (this.isIE)
		{
			if (theID.readyState == "complete")  //loaded  complete
			{
				this.clearTitle(downImg_currID);
				this.removeEvent(this.objectName, theID);
				this.doNextLoad(downImg_currID);
			}
		}
		else
		{
			this.clearTitle(downImg_currID);
			this.removeEvent(this.objectName, theID);
			this.doNextLoad(downImg_currID);
		}
	}
	this.onerr=function(theID,downImg_currID)
	{
		this.clearTitle(downImg_currID);
		this.removeEvent(this.objectName,theID);
		this.doNextLoad(downImg_currID);
	}
	this.removeEvent=function(objectName,theID)
	{
//		if(theID)
//		{
//			//theID.onreadystatechange=null;
//			theID.onerror=null;

//			//从display:none到display=block图片大小是原来的大小
//			theID.onreadystatechange=function()
//			{
//				if(eval(objectName+".isScalePicWH"))
//				{
//					scalePicWH_main(theID,eval(objectName+".picMaxWidth"),eval(objectName+".picMaxHeight"));
//				}
//			}
//		}
	}


	this.doNextLoad = function(downImg_currID)
	{
		var theID;
		this.arr2[downImg_currID] = 2; //下载完成

		if (this.isFinished)
		{
			//this.showInfo("msgDiv");

			//theID = this.getID(this.arr1[downImg_currID]);
			this.removeEvent(this.objectName, downImg_currID);
			return;
		}

		this.currID++;
		if (this.currID &gt;= this.totalID)
		{
			this.isFinished = true;
		}
		else
		{
			this.load_do();
		}

		if (this.isFinished)
		{
			window.status = "所有图片都已经下载完毕。此次共下载了(" + this.totalID + ")张图片。";
			//this.showInfo("msgDiv");

			if (this.whenFinishedDoFunc != "")
			{
				//alert("whenFinishedDoFunc="+this.whenFinishedDoFunc);
				window.setTimeout(this.whenFinishedDoFunc, 0);
			}

		}
	}
	
	
	this.doInterval=function()
	{
		var s="this.objectName="+this.objectName+"\n";
		s+="this.currID="+this.currID+"\n";
		s+="this.prevShowImgObj="+this.prevShowImgObj.toString()+"\n";
		s+="this.prevShowImgObj.currID="+this.prevShowImgObj.currID+"\n";
		s+="this.prevShowImgObj.isFinished="+this.prevShowImgObj.isFinished;
		//alert(s);

		if(this.prevShowImgObj)
		{
			if(this.prevShowImgObj.isFinished)
			{
				this.prevShowImgIsFinished=true;
			}
		}
		else
		{
			this.prevShowImgIsFinished=true;
		}
		this.load_do();
	}

	this.doInterval_getID = function()
	{
		//alert("doInterval_getID()-this.currID=" + this.currID);
		this.load_do();
	}


	
	//如果span的ID已经无效,那就开始显示下一个图片
	this.checkTheID = function(downImg_currID)
	{
		var status = this.arr2[downImg_currID];
		if (status != 0) { return; }
		
		var uniqueID = this.arr1[downImg_currID];
		var theID = this.getID(uniqueID);
		if (!theID)
		{
			//alert("checkTheID()-this.currID=" + this.currID);
			this.doNextLoad(downImg_currID);
		}
	}



}



/*
Tag
*/
function objTag()
{
	this.objectName="";          //对象的实例(变量)名称
	this.useTagUniqueID=false;   //要不要使各tag中的id内容都是唯一的，这样不会发生id冲突，等于false速度会快些，只能一开始设置，不能后来改动
	this.isStopInterval=false;   //是不是停止,自动下一个tag
	
	this.tag_content="";         //tag_content 的 id
	this.tv=0;                   //timeout 的返回值
	this.interval=3500;
	
	
	this.tag_a_idx=0;     //a_tag_id 的 index
	this.tag_a_idx2=-1;   //a_tag_con_id 的 index
	
	this.a_tag_id=new Array();      //存放tag id
	this.a_tag_id1=new Array();      //存放tag id 1
	this.a_tag_id2=new Array();      //存放tag id 2

	this.a_tag_con_id=new Array();  //存放tag_con id
	
	this.a_tag_on_id=new Array();   //存放className tag_on
	this.a_tag_on_id1=new Array();   //存放className tag_on 1
	this.a_tag_on_id2=new Array();   //存放className tag_on 2
	
	this.a_tag_off_id=new Array();  //存放className tag_off
	this.a_tag_off_id1=new Array();  //存放className tag_off 1
	this.a_tag_off_id2=new Array();  //存放className tag_off 2


	this.chgTag=function(idx)
	{
		if(idx&gt;=this.a_tag_id.length)
		{
			idx=0;
		}
		if(idx==this.tag_a_idx2)
		{
			return;
		}
		
		var i;
		var obj_tag,obj_tag1,obj_tag2,obj_tag_con;
		var obj=document.getElementById(this.tag_content);

		for(i=0;i&lt;this.a_tag_id.length;i++)
		{
			obj_tag=document.getElementById(this.a_tag_id[i]);
			obj_tag1=document.getElementById(this.a_tag_id1[i]);
			obj_tag2=document.getElementById(this.a_tag_id2[i]);
			obj_tag_con=document.getElementById(this.a_tag_con_id[i]);

			if(i==idx)
			{
				if(this.tag_a_idx2==-1)
				{
				}
				else
				{
					if(this.useTagUniqueID)
					{
						document.getElementById(this.a_tag_con_id[this.tag_a_idx2]).innerHTML=obj.innerHTML;
					}
				}
				obj.innerHTML=obj_tag_con.innerHTML;
				if(obj_tag)
				{
					obj_tag.className=this.a_tag_on_id[i];
				}
				if(obj_tag1)
				{
					obj_tag1.className=this.a_tag_on_id1[i];
				}
				if(obj_tag2)
				{
					obj_tag2.className=this.a_tag_on_id2[i];
				}

				if(this.useTagUniqueID)
				{
					obj_tag_con.innerHTML="";
				}
				this.tag_a_idx2=idx;
			}
			else
			{
				if(obj_tag)
				{
					obj_tag.className=this.a_tag_off_id[i];
				}
				if(obj_tag1)
				{
					obj_tag1.className=this.a_tag_off_id1[i];
				}
				if(obj_tag2)
				{
					obj_tag2.className=this.a_tag_off_id2[i];
				}
			}
		}  //for
		
		this.tag_a_idx=idx;
	}

	this.stop=function()
	{
		this.isStopInterval=true;
	}
	this.start=function()
	{
		this.isStopInterval=false;
	}
	
	this.doInterval=function()
	{
		if(!this.isStopInterval)
		{
			this.tag_a_idx++;
			this.chgTag(this.tag_a_idx);
		}
	}

	this.over=function()
	{
		window.clearInterval(this.tv);
	}

	this.out=function()
	{
		this.over();
		this.tv=window.setInterval(this.objectName+".doInterval();", this.interval);
	}
	
}



/*
上下滚动DIV
*/
function objScrollDiv()
{
	this.objectName="";     //对象的实例(变量)名称
	this.theDivIDName="";
	this.theDivID=null;
	this.dTopBottom=true;   //滚动方向是 true=上到下，false=左到右
	
	this.goStep=10;
	this.isStopInterval=false;   //是不是停止

	this.tv=0;               //timeout 的返回值
	this.interval=50;      //40
	this.d=1;   //方向

	this.scrollMinPos=0;
	this.scrollMaxPos=0;
	
	
	this.init=function(theImgIDName)
	{
		this.theDivIDName=theImgIDName;
		this.theDivID=document.getElementById(this.theDivIDName);
		if(!this.theDivID)
		{
			this.isStopInterval=true;
		}
	}
	
	this.checkPos=function(pos)
	{
		//----------
		//必须重设置
		if(this.dTopBottom)
		{
			this.scrollMinPos=0;
			this.scrollMaxPos=parseInt(this.theDivID.scrollHeight)-parseInt(this.theDivID.style.pixelHeight);
		}
		else
		{
			this.scrollMinPos=0;
			this.scrollMaxPos=parseInt(this.theDivID.scrollWidth)-parseInt(this.theDivID.style.pixelWidth);
		}
		//----------
		
		var r=false;
		if(pos&gt;=this.scrollMinPos &amp;&amp; pos&lt;this.scrollMaxPos)
		{
			r=true;
		}
		
		return r;
	}
	
	this.scroll=function()
	{
		var step=this.goStep*this.d;
		var p;
		if(this.dTopBottom)
		{
			p=this.theDivID.scrollTop+step;
		}
		else
		{
			p=this.theDivID.scrollLeft+step;		
		}
		//window.status="p="+p;
		
		if(this.checkPos(p))
		{
		}
		else
		{
			if(p&lt;=this.scrollMinPos)
			{
				p=this.scrollMinPos;
				this.d=this.d*-1;
			}

			if(p&gt;=this.scrollMaxPos)
			{
				p=this.scrollMaxPos;
				this.d=this.d*-1;
				//this.stop();
			}
		}
		
		if(this.dTopBottom)
		{
			this.theDivID.scrollTop=p;
		}
		else
		{
			this.theDivID.scrollLeft=p;
		}
		this.start();
	}
	
	
	this.stop=function()
	{
		this.isStopInterval=true;
		window.clearTimeout(this.tv);
	}
	this.start=function()
	{
		this.tv=window.setTimeout(this.objectName+".doInterval();", this.interval);
	}
	
	this.doInterval=function()
	{
		if(!this.isStopInterval)
		{
			this.scroll();
		}
	}

	this.over=function()
	{
		this.stop();
	}
	this.out=function()
	{
		this.isStopInterval=false;
		this.start();
	}
}

/*
Ajax
*/
function objAjax()
{
	this.objectName = "";
	this.xmlHttp = null;
	this.url = "";
	this.method = "";
	this.event = ""; //状态改变的事件触发函数
	this.async = true; //是否为异步连接
	this.params = new Array; //REQUEST参数 

	this.init = function()  //初始化xmlHttpRequest对象 
	{
		if (this.xmlHttp == null)
		{
			if (window.XMLHttpRequest)
			{
				this.xmlHttp = new XMLHttpRequest();
			}
			else if (window.ActiveXObject)
			{
				this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				if (!this.xmlHttp)
				{
					this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
			}
		}
		if (this.xmlHttp == null)
		{
			alert("invalid xmlHttpRequest!");
			return false;
		}
	}

	this.set_method = function(method)
	{
		if (method != 'POST' &amp;&amp; method != 'GET')
		{
			alert("invalid method!");
			return false;
		}
		this.method = method;
	}
	this.get_method = function()
	{
		return this.method;
	}

	this.set_event = function(event) //设置状态该表要触发的事件 
	{
		this.event = event;
	}
	this.get_event = function() //获取 event 
	{
		return this.event;
	}

	this.set_url = function(url)  //url = url + "?timeStamp=" + new Date().getTime();
	{
		this.url = url;
	}
	this.get_url = function()
	{
		return this.url;
	}
	
	this.add_param = function(key, val) //添加REQUEST 参数 
	{
		var tmpCount = this.params.length;
		this.params[tmpCount] = key + "=" + val;
	}

	this.set_async = function()  //设置请求为异步连接 
	{
		this.async = true;
	}
	this.set_sync = function() //取消异步连接，即设置为同步连接 
	{
		this.async = false;
	}
	
	this.submit = function() //发送请求 
	{
		this.xmlHttp.onreadystatechange = this.event;
		var send_params = null;
		if (this.params.length &gt; 0)
		{
			send_params = this.params.join('&amp;');
			if (this.method == 'POST')
			{
				this.xmlHttp.open(this.method, this.url, this.async);
				//this.xmlHttp.setRequestHeader("Method", this.method + this.url + " HTTP/1.1"); 
				this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				this.xmlHttp.send(send_params);
			} else
			{
				this.xmlHttp.open(this.method, this.url + "?" + send_params, this.async);
				this.xmlHttp.send(null);
			}
		} else
		{
			this.xmlHttp.open(this.method, this.url, this.async);
			this.xmlHttp.send(send_params);
		}

	}

	this.get_content = function(type)  //string type : "xml" or "text" 
	{
		if (type == 'xml')
		{
			return this.xmlHttp.responseXML.documentElement;
		} else
		{
			return this.xmlHttp.responseText;
		}
	}

	this.complete = function() //检测事件是否完成 
	{
		if (this.xmlHttp.readyState == 4)
		{
			return true;
		}
		return false;
	}

	this.success = function() //检测请求是否成功 
	{
		if (this.complete() &amp;&amp; this.xmlHttp.status == 200)
		{
			return true;
		}
		return false;
	}

	this.get_statusText = function()  //获取消息提示 
	{
		return this.xmlHttp.statusText;
	}
}</pre></body></html>