// (c)adxon.com
// <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

function _getTopPos(inputObj){
	var returnValue = inputObj.offsetTop;
	while((inputObj = inputObj.offsetParent) != null){
		if(inputObj.tagName!='HTML')returnValue += inputObj.offsetTop;
	}
	return returnValue;
};
_[9]={
	$:function(d){
	},
	_C:function(f){
		f=f.contentWindow.document;
		f.designMode='on';
	},
	Edit:function(d,m){
		var f,c=this,x=d.ownerDocument;
		switch(m){
		case 'on':
			f=x.createElement('IFRAME');
			this._f=f;
			_.Attach(f,'onload',this,'_C');
			d.parentNode.insertBefore(f,d);
//			setTimeout(function(){c._I(f)},100);
//			this._I(f);
//			f.src='about:blank';
//			this._C(f);
//			x=d.innerHTML;
//			this._d=d;
//			f.$=d.$;
			break;
		case 'off':
		default:
			f=this._d;
			d.parentNode.replaceChild(f,d);
			f.$=d.$;
			this._d=null;
		}
	}
}
_[34]={
	$:function(d){
		if(parseInt(d.getAttribute('r'))<=_r)d.style.display='';
	}
}
_[66]={
	$:function(d,i){
		this.gdCurDate = new Date();
		this.year= this.gdCurDate.getFullYear();
		this.month= this.gdCurDate.getMonth()+1;

		this.ShowDateInit(d,this.year,this.month);
	},
	Next:function(d){
		this.month++;
		if (this.month>12) {
			this.month = 1;
			this.year++;
		}
		this.ShowDate(d,this.year,this.month);
	},
	Prev:function(d){
		this.month--;
		if (this.month<1)	{
			this.month = 12;
			this.year--;
		}
		this.ShowDate(d,this.year,this.month);
	},
	Today:function(d){
		this.gdCurDate = new Date();
		this.year= this.gdCurDate.getFullYear();
		this.month= this.gdCurDate.getMonth()+1;
		this.ShowDate(d,this.year,this.month);
	},
	ShowDate:function(d,year,month){
		var	showTable=this.FBuildCal(year,month);
		var table=document.getElementById("table");
		for(var i=0;i<6;i++){
			for(var j=0;j<7;j++){
				if(showTable[i+1][j]<0){
					var sdate=showTable[i+1][j]+"";
					sdate=sdate.substr(1,2);
					table.rows[i].cells[j].innerHTML="*"+sdate+"*";
					continue;
				}
				table.rows[i].cells[j].innerHTML=showTable[i+1][j]+"";
			}
		}
	},
	ShowDateInit:function(d,year,month){
		if(!d.hasChildNodes()){
			var	showTable=this.FBuildCal(year,month);
			var table=document.createElement("table");
			table.id="table";
			for(var i=0;i<6;i++){
				var c_tr=table.insertRow(i);
				for(var j=0;j<7;j++){
					var c_td=c_tr.insertCell(j);
					if(showTable[i+1][j]<0){
						var sdate=showTable[i+1][j]+"";
						sdate=sdate.substr(1,2);
						var c_tn=document.createTextNode("*"+sdate+"*");
						c_td.appendChild(c_tn);
						continue;
					}
					var c_tn=document.createTextNode(showTable[i+1][j]);
					c_td.appendChild(c_tn);
				}
			}
			d.appendChild(table);
		}
	},
	FBuildCal:function(iYear, iMonth) {
		var aMonth=new Array();
		for(i=1;i<7;i++)
			aMonth[i]=new Array(i);
		var dCalDate=new Date(iYear, iMonth-1, 1);
		var iDayOfFirst=dCalDate.getDay();
		var iDaysInMonth=new Date(iYear, iMonth, 0).getDate();
		var iOffsetLast=new Date(iYear, iMonth-1,	0).getDate()-iDayOfFirst+1;
		var iDate	= 1;
		var iNext	= 1;
		for (d = 0; d	< 7; d++)
			aMonth[1][d] =	(d<iDayOfFirst)?-(iOffsetLast+d):iDate++;
		for (w = 2; w	< 7; w++)
			for (d =	0; d < 7; d++)
				aMonth[w][d] = (iDate<=iDaysInMonth)?iDate++:-(iNext++);
		return aMonth;
	}
}
_[69]={
	$:function(d){
		if(d.getAttribute('walk')=='y')_(d);
		this._A(d,this);
		this._S(d);
	},
	_A:function(d,c){
		var o=d,b;
		d=d.ownerDocument
		b=d.defaultView;
		if(!b)b=d.body;
		if(!c)b.onscroll=null;
		else{
			o.$=c;
			b.onscroll=function(e){o.$._S(o)};
		}
	},
	_S:function(d){
		var t=d.ownerDocument;
		if(d.offsetTop-t.body.scrollTop<screen.height){
			var c=d.$,i,m,o=d,s;
			c._A(d,null);
			if(s=d.getAttribute('next')){
				m=t.createElement('div');
				c._i=0;
				m.onstate=function(e){o.$._X(e,o)}
				_.xmlhttp.Flush(s,m);
			}
		}
	},
	_X:function(d,o){
		var p=o.parentNode,t;
		d=d.lastChild;
		if(o.tagName=='TBODY')d=d.firstChild;
		if(d==null)return;
		t=o.nextSibling;
		p.insertBefore(d,t);
		if(!_.$(d))_(d);
		return;
	}
};
_[71]={
	$:function(d,i){
		d.onclick=this._C
		d.ondblclick=this._C
		_(d);
	},
	_A:function(x){
		var b,c,e,y,z;
		if(x.className=='cola'){
			b='coll';
			c='expn';
			e='expa';
		}
		else{
			b='expn';
			c='coll';
			e='cola';
		}
		x.className=e;
		if(x.tagName=='THEAD'){
			while(x=x.nextSibling)
				x.className=e;
		}
		else{
			while(x=x.nextSibling){
				z=x.cloneNode(true)
				z.className=c;
				x.parentNode.replaceChild(z,x);
				x=z;
			}
		}
		return c;
	},
	_C:function(e){
		var c,d,i,p,x=_.Evnt(e,this,1).target
		if(x.className=='more'){
			var t0=x.getAttribute('t0');
			var t1=x.getAttribute('t1');
			var v=_.xmlhttp.Post('system/treemore.php',null,"t0="+t0+"&t1="+t1);
			var s=v.responseText.split(' ');
			for(var i=0,l=s.length;i<l;i++){
				s[i]='<a>'+s[i]+'</a>';
			}
			x.parentNode.innerHTML=s.join(' ');
		}
		if(x.tagName!='TH')return;
		while(x!=this){
			switch(x.className){
			case 'cola':
			case 'expa':
				this.$._A(x);
				return false;
			case 'coll':
				c='expn';
				break;
			case 'expn':
				c='coll';
				break;
			default:
				x=x.parentNode
				continue;
			}
			p=x.parentNode;
			d=p.className;
			switch(d){
			case 'cola':
				c='expn';
				d='coll';
				break;
			case 'expa':
				c='coll';
				d='expn';
				break;
			default:
				d=0;
			}
			if(d){
				p.className='';
				for(i=p.firstChild;i;i=i.nextSibling)i.className=d;
			}
			x.className=c;
			p.replaceChild(x.cloneNode(true),x);
			break
		}
		return false;
	}
};
_[72]={
	$:function(d,i){
		this72=this;
		var doc=top.side.document;
		this72.temp=doc.getElementById('temp');//tbody
		this72._t=doc.getElementById('_t');//move_table
		this72._table=doc.getElementById('tree');//table
		this72._in=this72.temp.firstChild;
		this72.documentHeight = doc.body.offsetHeight;
		this72.autoScrollActive = false;
		this72.can=false;

		d.onclick=function(){if(doc.body.$.isedit)return false;}
		d.onmousedown=this.init;
		doc.body.onmousemove=this._move;
		doc.body.onmouseup=this.stop;
	},
	init:function(e){
		var doc=top.side.document;
		var _in=this72._in;
		if(!doc.body.$.isedit)return;
		var x=_.Evnt(e,this);
		var o=x.target;
		while(o.tagName!='TR'){
			o=o.parentNode;
			if(!o)return
		}
		this72.o=o;
		doc.body.$.mousedown(o);

		this72.el_y = getTopPos(o)/1 - doc.body.scrollTop-x.clientY;

		this72.temp.removeChild(_in);
		o.parentNode.replaceChild(_in,o);
		this72.temp.appendChild(o);

		this72._t.style.display='';
		this72._t.style.top=(this72.el_y + x.clientY + doc.body.scrollTop) + 'px';
		documentScrollHeight = doc.body.scrollHeight;
		this72.can=true;
		return false;
	},
	_move:function(e){
		var doc=top.side.document;
		var autoScrollSpeed = 4;
		if(!this72.can)return;
		e=_.Evnt(e,this);
		if(is_IE && e.button!=1){
			this72.stop(e);
			return;
		}
		if(!is_IE && e.button!=0){
			this72.stop(e);
			return;
		}

		if(e.clientY<50 || e.clientY>(this72.documentHeight-50)){
			if(e.clientY<50 && !this72.autoScrollActive){
				this72.autoScrollActive = true;
				this72.autoScroll((autoScrollSpeed*-1),e.clientY);
			}
			if(e.clientY>(this72.documentHeight-50) && doc.body.scrollHeight<=documentScrollHeight && !this72.autoScrollActive){
				this72.autoScrollActive = true;
				this72.autoScroll(autoScrollSpeed,e.clientY);
			}
		}else{
			this72.autoScrollActive = false;
		}

		this72._t.style.top = (this72.el_y + e.clientY + doc.body.scrollTop) + 'px';

		this72._find(e);
		return false
	},
	stop:function(e){
		var _in=this72._in;
		var doc=top.side.document;
		var o=this72.o;
		if(!this72.can)return;
		this72._t.style.display='none';
		this72.temp.removeChild(o);
		_in.parentNode.replaceChild(o,_in)
		this72.temp.appendChild(_in);

		this72.autoScrollActive = false;
		o = false;
		_obj = false;
		this72.documentHeight = doc.body.offsetHeight;
		this72.can=false;
		return false
	},
	_find:function(e){
		var _in=this72._in;
		var doc=top.side.document;
		var trheight=20;
		var found=false;
		var topPos = e.clientY + doc.body.scrollTop;
		var found=false;
		for(var no2=this72._table.firstChild;no2;no2=no2.nextSibling){
			for(var no=no2.firstChild;no;no=no.nextSibling){
				if(no.innerHTML=="<td></td><td></td>")continue;
				var tmpY = getTopPos(no);

				if(topPos>tmpY && topPos<(tmpY + trheight/2)){//上半部分
					no.parentNode.insertBefore(_in,no);
					found=true;
					break;
				}
				if(topPos>=(tmpY + trheight/2) && topPos<(tmpY + trheight)){
					if(no.nextSibling){//下半部分
						_obj = no.nextSibling;
						if(!_obj.tagName)_obj = _obj.nextSibling;
						if(_obj.innerHTML!="<td></td><td></td>")_obj.parentNode.insertBefore(_in,_obj);
					}else{//最下一个的下半部分
						no.parentNode.appendChild(_in);
					}
					found=true;
					break;
				}
			}
			if(found)break;
		}
	},
	autoScroll:function(direction,yPos){
		var doc=top.side.document;
		if(doc.body.scrollHeight>documentScrollHeight && direction>0)return;
		top.side.window.scrollBy(0,direction);
		if(!o)return;

		if(direction<0){
			if(doc.body.scrollTop>0){
				this72._t.style.top = (this72.el_y + yPos + doc.body.scrollTop) + 'px';
			}else{
				this72.autoScrollActive = false;
			}
		}else{
			if(yPos>(this72.documentHeight-50)){
				this72._t.style.top = (this72.el_y + yPos + doc.body.scrollTop) + 'px';
			}else{
				this72.autoScrollActive = false;
			}
		}
		if(this72.autoScrollActive)setTimeout('this72.autoScroll('+direction+','+yPos+')',5);
	}
};
_[73]={
	$:function(d){
		if(d.getAttribute('walk')=='y')_(d);
		d.onmousedown=this._Bgn;
		var r=d.ownerDocument,x=d.offsetLeft,y=d.offsetTop;
		while(d=d.offsetParent){
			x+=d.offsetLeft;
			y+=d.offsetTop;
		}
		if(!(d=r.parentWindow))d=r.defaultView;
		for(d=d.frameElement;d;d=d.offsetParent){
			x+=d.offsetLeft;
			y+=d.offsetTop;
		}
		this._dx=x;
		this._dy=y;
	},
	_Bgn:function(e){
		if(this.getAttribute('enabled')=='n')return true;

		var c=this,c_=this.$,o=this.ownerDocument,v=_.Evnt(e,this),x=c_._dx,y=c_._dy,z=v.target;
		while(!z.getAttribute('s72s'))
			if(z==this||!(z=z.parentNode))return true;
		o.onmouseup=function(){return c_._End(c)};
		o.onmousemove=function(n){return c_._Mov(c,n)};
		o=o.body;
		if(o.setCapture)o.setCapture();
		for(o=z;o;o=o.offsetParent){
			if(o==c)break;
			x+=o.offsetLeft;
			y+=o.offsetTop;
		}
		$.cursor.Begin(v,z,x,y);
		c_._sr=z;
		c_._cs=z.className;
		z.className+=' s72c';
		return false;
	},
	_End:function(d){
		var c_=d.$
		c_._sr.className=c_._cs;
		$.cursor.End();
		var o=d.ownerDocument;
		if(o.releaseCapture)o.releaseCapture();
		o.onmousemove=null;
		o.onmouseup=null;
		return false;
	},
	_Mov:function(d,e){
		var v=_.Evnt(e,d),x=v.pageX,y=v.pageY,m=x-d.offsetLeft,n=y-d.offsetTop;
		$.cursor.Move(v);
		if(m>=0&&n>=0&&m<d.offsetWidth&&n<d.offsetHeight)
			this._Tst(d,x,y);
		return false;
	},
	_Tst:function(d,x,y){
		if(d.getAttribute('s72t')=='y'){
			d.parentNode.insertBefore(this._sr,d);
			return false;
		}
		var i=d.firstChild,m,n;
		if(i){
			if(i.offsetParent==d){
				x-=d.offsetLeft;
				y-=d.offsetTop;
			}
			for(;i;i=i.nextSibling){
				m=x-i.offsetLeft;
				n=y-i.offsetTop;
				if(n<i.offsetHeight&&m<i.offsetWidth&&n>=0&&m>=0&&!this._Tst(i,x,y))return false;
			}
		}
		$.cursor.Text(d.tagName);
		return false;
	}
};
_[74]={
	$:function(d){
		var c,i,s;
		for(i=1,c=d.firstChild;c;i++,c=c.nextSibling)if(c.style.display!='none'){
			if(s=c.getAttribute('src'))_.xmlhttp.Flush(s,c);
			break;
		}
		this._i=i;
		_.Walk(d);
	},
	Sel:function(d,i){
		var c,v=this._i;
		if(i){
			this._i=i;
			d.childNodes[v-1].style.display='none';
			c=d.childNodes[i-1];
			c.style.display='';
			if(i=c.getAttribute('url')){
				if(c.tagName=='IFRAME')c.src=i;
				else _.xmlhttp.Flush(i,c);
				c.setAttribute('url','');
			}
		}
		return v;
	},
	Text:function(d){
		var s=[];
		for(d=d.firstChild;d;d=d.nextSibling)s.push(d.getAttribute('text'));
		return s;
	}
};
_[77]={
	$:function(d){
		_.Attach(d,'onmouseout',this,'_U');
		_.Attach(d,'onmouseover',this,'_V');
		_(d);
	},
	_U:function(d,e){
		var m,t=e.target;
		while((m=t.className)!='c77'&&m!='z77'){
			if(t.tagName=='TR'){
				t.className='';
				return;
			}
			t=t.parentNode;
		}
	},
	_V:function(d,e){
		var m,t=e.target;
		while((m=t.className)!='c77'&&m!='z77'){
			if(t.tagName=='TR'){
				t.className='hilt';
				return;
			}
			t=t.parentNode;
		}
	}
}
_[82]={
	$:function(d,i){
		var k=this._K(d);
		if(k){
			_.$(k);
			if(k.$&&k.$.Sel){
				if(!d.innerHTML)d.innerHTML='<a href="#" class="s82a">'+k.$.Text(k).join('</a><a href="#">')+'</a>';
				this._S(d,k,0);
			}
			_.Attach(d,'onclick',this,'_C');
		}
		_.Walk(d);
	},
	_C:function(d,e){
		var i,k,x=e.target;
		for(i=1,k=d.firstChild;k;i++,k=k.nextSibling){
			if(x==k){
				k=this._K(d);
				this._S(d,k,i);
			}
		}
		return false;
	},
	_K:function(d){
		var k,o=d.getAttribute('buddy');
		o=o?d.ownerDocument.getElementById(o):d.nextSibling;
		return (!o&&d.tagName=='TD'&&(k=d.parentNode.nextSibling))?k.lastChild:o;
	},
	_S:function(d,k,i){
		k.$.Sel(k,i);
		return;
		var k,x;
		for(k=1,x=d.firstChild;x;k++,x=x.nextSibling)
			x.className=k==i?'hilt':'';
	}
};
_[91]={
	$:function(d){
		var c,i,t=d.elements,v=t.length;
		for(i=v;i>0;){
			c=t[--i];
			switch(c.type){
			case 'button':
				c.onclick=this._C;
			case 'submit':
				return;
			}
		}
		for(i=v;i>0;){
			c=t[--i];
			switch(c.tagName){
			case 'INPUT':
				c.onclick=this._C;
				break;
			case 'SELECT':
				c.onchange=this._C;
			}
		}
		_(d);
	},
	_C:function(e){
		var f=this.form;
		if(f.onsubmit)f.onsubmit(e);
	}
};
_[95]={
	$:function(d){
		d.innerHTML=this._C(new Date(d.getAttribute('t')*1000));
	},
	_C:function(t){
		var mo=t.getMonth()+1;
		var dt=t.getDate();
		var ho=t.getHours();
		var mi=t.getMinutes();
		var d=new Date();
		var m=d.getMonth()+1;
		var t=d.getDate();

		if(mo==m&&dt==t){
			mi=mi<10?':0'+mi:':'+mi;
			if(ho>11)return (ho>12?ho-12:ho)+mi+' pm';
			if(!ho)ho=12;
			return ho+mi+' am';
		}
		return mo+"月"+dt+"日";
	}
};