﻿var info1objexample=null;

function Createinfo1obj(objname,infocontent,startruncode,runingcode,endruncode,url,isimage,loadwait){
	this.name="";
	this.info1ie=(document.all)?true:false;
	this.info1ns4=(document.layers)?true:false;
	this.infobackgroundobj=null;
	this.infobackgroundobjstyle=null;
	this.infomessageobj=null;
	this.infomessageobjstyle=null;
	this.infogroupobj=null;
	this.infogroupobjstyle=null;
	this.infogrouphtmlobj=null;
	this.infoloadmessageobj=null;
	this.infoopened=false;
	this.infocontent="";
	this.runingcode="";
	this.endruncode="";
	this.url="";
	this.isimage=false;
	this.loadwait=false;
	this.infowidth=0;
	this.infoheight=0;
	this.infowidthstep=0;
	this.infoheightstep=0;
	this.valueleft=0;
	this.valuetop=0;
	this.setselect=function(state){
		if (this.info1ie){
			var objl=document.getElementsByTagName("select");
			for(var i=0;i<objl.length;i++){
				objl[i].style.visibility=state
			}
		}
	}
	this.infodelobj=function(obj){
		if (obj!=null){
			while (obj.hasChildNodes()){
				obj.removeChild(obj.lastChild)
			}
			obj.removeNode();
			obj=null
		}
	}
	this.infoclose=function(){
		if (this.endruncode != ""){
			var codetext=endruncode.split("^");
			for (var i=0;i<codetext.length;i++){
				eval(codetext[i])
			}
			this.endruncode=""
		}
		if (this.infoloadmessageobj!=null){
			this.infodelobj(this.infoloadmessageobj)
		}
		if (this.infogrouphtmlobj!=null){
			this.infogrouphtmlobj=null
		}
		if (this.infogroupobj!=null){
			this.infogroupobjstyle=null;
			this.infodelobj(this.infogroupobj)
		}
		if (this.infomessageobj!=null){
			this.infomessageobjstyle=null;
			this.infodelobj(this.infomessageobj)
		}
		if (this.infobackgroundobj!=null){
			this.infobackgroundobjstyle=null;
			this.infodelobj(this.infobackgroundobj)
		}
		this.infocontent="";
		this.runingcode="";
		this.url="";
		this.isimage=false;
		this.loadwait=false;
		this.infowidth=0;
		this.infoheight=0;
		this.infowidthstep=0;
		this.infoheightstep=0;
		this.valueleft=0;
		this.valuetop=0;
		this.setselect("");
		this.infoopened=false
	}
	this.infobackgroundreset=function(){
		if (this.infoopened){
			this.infobackgroundobjstyle.top=document.body.scrollTop;
			this.infobackgroundobjstyle.left=document.body.scrollLeft;
			this.infobackgroundobjstyle.width=document.body.clientWidth;
			this.infobackgroundobjstyle.height=document.body.clientHeight;
			window.Obj=this;
			setTimeout("Obj.infobackgroundreset()",20)
		}
	}
	this.infoexpandx=function(){
		if (this.infoopened){
			var infonowwidth=parseInt(this.infomessageobjstyle.width);
			if (infonowwidth+this.infowidthstep<this.infowidth){
				this.infomessageobjstyle.width=infonowwidth+this.infowidthstep;
				if (document.body.clientWidth>this.infomessageobj.offsetWidth){
					this.infomessageobjstyle.left=this.valueleft+parseInt((document.body.clientWidth-this.infomessageobj.offsetWidth)/2)
				}
				else{
					this.infomessageobjstyle.left=this.valueleft
				}
				window.Obj=this;
				setTimeout("Obj.infoexpandx()",5)
			}
			else{
				this.infomessageobjstyle.width=this.infowidth;
				if (document.body.clientWidth>this.infomessageobj.offsetWidth){
					this.infomessageobjstyle.left=this.valueleft+parseInt((document.body.clientWidth-this.infomessageobj.offsetWidth)/2)
				}
				else{
					this.infomessageobjstyle.left=this.valueleft
				}
				this.infogroupobjstyle.display="block";
				if (this.runingcode != ""){
					codetext=this.runingcode.split("^");
					for (var i=0;i<codetext.length;i++){
						eval(codetext[i])
					}
				}
			}
		}
	}
	this.infoexpandy=function(){
		if (this.infoopened){
			var infonowheight=parseInt(this.infomessageobjstyle.height);
			if (infonowheight+this.infoheightstep<this.infoheight){
				this.infomessageobjstyle.height=infonowheight+this.infoheightstep;
				if (document.body.clientHeight>this.infomessageobj.offsetHeight){
					this.infomessageobjstyle.top=this.valuetop+parseInt((document.body.clientHeight-this.infomessageobj.offsetHeight)/2)
				}
				else{
					this.infomessageobjstyle.top=this.valuetop
				}
				window.Obj=this;
				setTimeout("Obj.infoexpandy()",5)
			}
			else{
				this.infomessageobjstyle.height=this.infoheight;
				if (document.body.clientHeight>this.infomessageobj.offsetHeight){
					this.infomessageobjstyle.top=this.valuetop+parseInt((document.body.clientHeight-this.infomessageobj.offsetHeight)/2)
				}
				else{
					this.infomessageobjstyle.top=this.valuetop
				}
				this.infoexpandx()
			}
		}
	}
	this.infoloaddata=function(obj){
		if (this.infoopened){
			this.infogroupobj.style.cssText="";
			this.infogroupobj.removeAttribute("width");
			this.infogrouphtmlobj.removeAttribute("height");
			this.infowidth=this.infomessageobj.offsetWidth;
			this.infoheight=this.infomessageobj.offsetHeight;
			if (obj != null){
				if (((this.infowidth>(document.body.clientWidth-20))||(this.infoheight>(document.body.clientHeight-20)))&&(this.infowidth>20)&&(this.infoheight>20)){
					if (((this.infowidth-20)/(this.infoheight-20))>((document.body.clientWidth-40)/(document.body.clientHeight-40))){
						this.infoheight=parseInt((document.body.clientWidth-40)/(this.infowidth-20)*(this.infoheight-20))+20;
						this.infowidth=document.body.clientWidth-20
					}
					else{
						this.infowidth=parseInt((document.body.clientHeight-40)/(this.infoheight-20)*(this.infowidth-20))+20;
						this.infoheight=document.body.clientHeight-20
					}
				}
				if (this.info1ns4){
					obj.width=this.infowidth-20;
					obj.height=this.infoheight-20;
				}
				else{
					obj.style.width=this.infowidth-20;
					obj.style.height=this.infoheight-20;
				}
			}
			this.infodelobj(this.infoloadmessageobj);
			this.infogroupobjstyle.display="none";
			this.valueleft=document.body.scrollLeft;
			this.valuetop=document.body.scrollTop;
			this.infowidthstep=parseInt(this.infowidth/30);
			this.infoheightstep=parseInt(this.infoheight/30);
			this.infomessageobjstyle.width=10;
			this.infomessageobjstyle.height=10;
			this.infomessageobjstyle.overflowX="hidden";
			this.infomessageobjstyle.overflowY="hidden";
			this.infomessageobjstyle.left=this.valueleft+parseInt((document.body.clientWidth-10)/2);
			this.infomessageobjstyle.top=this.valuetop+parseInt((document.body.clientHeight-10)/2);
			this.infomessageobjscrollLeft=parseInt((this.infowidth-10)/2);
			this.infomessageobjscrollTop=parseInt((this.infoheight-10)/2);
			this.infomessageobjstyle.visibility="";
			this.infomessageobj.nowrap=true;
			window.Obj=this;
			setTimeout("Obj.infoexpandy()",5)
		}
	}
	this.infowait=function(){
		if (this.loadwait){
			window.Obj=this;
			setTimeout("Obj.infowait()",5)
		}
		else{
			this.infoloaddata(null)
		}
	}
	this.infoload=function(){
		if (this.infoopened){
			this.infomessageobj=document.createElement("div");
			this.infomessageobj.style.cssText="background:#FFFFFF;position:absolute;top:-1000px;left:-1000px;z-index:1002;visibility:hidden";
			document.body.appendChild(this.infomessageobj);
			if (this.info1ns4){
				this.infomessageobjstyle=this.infomessageobj
			}
			else{
				this.infomessageobjstyle=this.infomessageobj.style
			}
			this.infogroupobj=document.createElement("table");
			this.infogroupobj.border="0";
			this.infogroupobj.cellSpacing="10";
			this.infogroupobj.cellPadding="0";
			this.infogroupobj.align="center";
			this.infogrouphtmlobj=this.infogroupobj.insertRow(0).insertCell(0);
			this.infogrouphtmlobj.align="center";
			this.infogroupobj.style.cssText="word-break:break-all;table-layout:fixed";
			this.infogroupobj.width=21;
			this.infogrouphtmlobj.height=1;
			if (this.info1ns4){
				this.infogroupobjstyle=this.infogroupobj
			}
			else if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)>=5){
				this.infogroupobjstyle=this.infogroupobj.style
			}
			else{
				this.infogroupobjstyle=this.infogroupobj.style
			}
			this.infomessageobj.appendChild(this.infogroupobj);
			this.infoloadmessageobj=document.createElement("div");
			this.infoloadmessageobj.id="infoloadmessage";
			this.infoloadmessageobj.style.cssText="background:#FFFFFF;position:absolute;top:"+(document.body.scrollTop+parseInt((document.body.clientHeight-120)/2))+"px;left:"+(document.body.scrollLeft+parseInt((document.body.clientWidth-150)/2))+"px;width:150px;height:110px;z-index:1001";
			document.body.appendChild(this.infoloadmessageobj);
			this.infoloadmessageobj.innerHTML="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"150\" align=\"center\"><tr height=\"20\"><td></td></tr><tr height=\"60\"><td align=\"center\"><img src=\""+this.url+"loading.gif\" border=\"0\" width=\"32\" height=\"32\" align=\"center\"></td></tr><tr height=\"20\"><td align=\"center\" style=\"color:#000000\">正在加载...</td></tr><tr height=\"20\"><td></td></tr></table>";
			this.infogrouphtmlobj.innerHTML=this.infocontent;
			if (!this.isimage){
				window.Obj=this;
				setTimeout("Obj.infowait()",1000)
			}

		}
	}
	this.infobackgroundset=function(){
		if (this.infoopened){
			if (this.info1ie){
				this.infobackgroundobj.filters.alpha.opacity+=10; 
				if(this.infobackgroundobj.filters.alpha.opacity<80){
					window.Obj=this;
					setTimeout("Obj.infobackgroundset()",50)
				}
				else{
					this.infoload()
				}
			}
			else{
				var al=parseFloat(this.infobackgroundobj.style.opacity);
				al+=0.1;
				this.infobackgroundobj.style.opacity=al;
				if (al<0.8){
					window.Obj=this;
					setTimeout("Obj.infobackgroundset()",50)
				}
				else{
					this.infoload()
				}
			}
		}
	}
	this.infoinit=function(objname,infocontent,startruncode,runingcode,endruncode,url,isimage,loadwait){
		this.name=objname;
		if (this.infoopened){
			this.infoclose()
		}
		if (isimage){
			this.infocontent="<img src=\""+infocontent+"\" border=\"0\" align=\"0\" onload=\"javascript:" + objname + ".infoloaddata(this)\">"
		}
		else{
			this.infocontent=infocontent
		}
		this.runingcode=runingcode;
		this.endruncode=endruncode;
		this.url=url;
		this.isimage=isimage;
		this.loadwait=loadwait;
		this.setselect("hidden");
		this.infoopened=true;
		if (startruncode != ""){
			var codetext=startruncode.split("^");
			for (var i=0;i<codetext.length;i++){
				eval(codetext[i])
			}
		}
	}
	this.infoinit(objname,infocontent,startruncode,runingcode,endruncode,url,isimage,loadwait)
}

function info1obj(infocontent,startruncode,runingcode,endruncode,url,isimage,loadwait){
	if (info1objexample==null){
		info1objexample = new Createinfo1obj("info1objexample",infocontent,startruncode,runingcode,endruncode,url,isimage,loadwait)
	}
	else{
		info1objexample.infoinit("info1objexample",infocontent,startruncode,runingcode,endruncode,url,isimage,loadwait)
	}
	info1objexample.infobackgroundobj=document.createElement("div");
	info1objexample.infobackgroundobj.id="infobackground";
	var styleStr="background:#000000;position:absolute;top:0px;left:0px;width:"+document.body.clientWidth+"px;height:"+document.body.clientHeight+"px;z-index:1000;";
	styleStr+=(info1objexample.info1ie)?"filter:alpha(opacity=0)":"opacity:0";
	info1objexample.infobackgroundobj.style.cssText=styleStr;
	document.body.appendChild(info1objexample.infobackgroundobj);
	info1objexample.infobackgroundobj.attachEvent("onclick",function(){info1objexample.infoclose()},true);
	if (info1objexample.info1ns4){
		info1objexample.infobackgroundobjstyle=info1objexample.infobackgroundobj
	}
	else{
		info1objexample.infobackgroundobjstyle=info1objexample.infobackgroundobj.style
	}
	info1objexample.infobackgroundreset();
	info1objexample.infobackgroundset()
}

function info1show(){
	info1objexample.loadwait=false
}