<%@LANGUAGE="JavaScript"%>
<%
var _DO=Request.queryString("do");
var PAGE=((begin=Request.ServerVariables("URL")(1).lastIndexOf("/"))==-1)? Request.ServerVariables("URL"):Request.ServerVariables("URL")(1).substring(begin+1);

var AUTH_USER=new Array();
AUTH_USER["username"]="admin";
AUTH_USER["password"]="777a5b155272c25b01bfd7059f0f6484";
AUTH_USER["email"]="xxx@yyy.com";
//END_AUTH_USER
var CONFIG=new Array();
CONFIG["version"]="V1.2/051228";
CONFIG["use_utf"]="undefined";
CONFIG["nLayer"]="1";
CONFIG["auth_type"]="cookie";
CONFIG["cookie_life"]="2592000";
CONFIG["session_life"]="54000";
CONFIG["realm"]="EditONE@{server_name}";
CONFIG["start_dir"]="/";
CONFIG["expand_one"]="";
CONFIG["encoding"]="GB2312";
CONFIG["wrap_word"]="undefined";
CONFIG["editor_font_family"]="宋体";
CONFIG["editor_font_height"]="14";
CONFIG["editor_line_height"]="16";
//END_CONFIG

var realm=CONFIG["realm"].replace(/\{server_name\}/, Request.ServerVariables("SERVER_NAME")(1));
var HTML_HEADER="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n"+
"<html>\r\n"+
"<head>\r\n"+
"<title>"+realm+" - Edit All in One Page!</title>\r\n"+
"<meta content='text/html; charset="+CONFIG["encoding"]+"' http-equiv='Content-Type'>\r\n"+
"<style>\r\n"+
"body,td {font-size:12px; color:#000000; background-color:#F1F1F1; margin-left:0px; margin-top:0px; margin-right:0px; margin-bottom:0px;\r\n"+
"scrollbar-face-color:#F1F1F1; scrollbar-highlight-color:#F1F1F1; scrollbar-shadow-color:#F1F1F1;\r\n"+
"scrollbar-3dlight-color:#FFC080; scrollbar-arrow-color:#000000; scrollbar-track-color:#F1F1F1;\r\n"+
"scrollbar-darkshadow-color:#FFC080; scrollbar-base-color:#F1F1F1; scrollbar-width:10px}\r\n"+
"\r\n"+
"input {font-size:12px; height:18px}\r\n"+
"input.selector {display:none}\r\n"+
"input.checkbox {font-size:12px; height:18px}\r\n"+
"select {font-size:12px; border: solid 0px #000000; vertical-align:middle; line-height:12px; font-family:\"arial\"}\r\n"+
"\r\n"+
"a {color:#0000FF; text-decoration:none;}\r\n"+
"a:hover {color:#FF3300; text-decoration:underline;}\r\n"+
"a.gray {color:#999999; text-decoration:none}\r\n"+
"a.gray:hover {color:#FF4C00; text-decoration:underline}\r\n"+
"\r\n"+
"p {margin-left:2em; font-size:12px; line-height:130%; margin-top:12px; margin-bottom:12px; text-align:center;}\r\n"+
"</style>\r\n"+
"</head>";

if (_DO=="edit")
	showEditFile();
else if (_DO=="save")
	responseSaveFile();
else if (_DO=="login")
	showLogin("");
else if (_DO=="verify")
	showVerify();
else if (_DO=="logout")
	showLogout();
else if (_DO=="frame_set")
	showFrameSet();
else if (_DO=="file_list") {
	var dir=(Request.queryString("dir")(1)!="")? Request.queryString("dir")(1):CONFIG["start_dir"];
	showFileList(dir, CONFIG["nLayer"]);
}
else if (_DO=="left_frame")
	showLeftFrame();
else if (_DO=="main_frame")
	showMainFrame();
else if (_DO=="image")
	responseImageFile("");
else if (_DO=="config")
	showConfig();
else if (_DO=="modify")
	modifyConfig();
else if (_DO=="xml")
	responseXmlFile();
else if (_DO=="download")
	downloadFile();
else if (_DO=="new")
	newFile();
else if (_DO=="paste")
	pasteFile();
else if (_DO=="rename")
	renameFile();
else if (_DO=="delete")
	deleteFile();
else if (_DO=="upload")
	uploadFile();
else if (_DO=="getad") {
	getAD();
}
else if (_DO=="debug") {
	loadConvertTable();
}
else
	showFrameSet();
Response.End();

function showAuthorize(fileType)
{
	if (CONFIG["auth_type"]=="none")
		return;
	else if (CONFIG["auth_type"]=="HTTP") {
		if (Session.contents("auth")==true)
			return;
		else if (fileType=="HTML")
			if (Request.ServerVariables("AUTH_USER")=="") {
				Response.addHeader('WWW-Authenticate", "Basic realm="'+realm+'"');
				Response.addHeader('HTTP/1.0 401 Unauthorized');
				Response.Write("抱歉，您的密码不正确，或者您没有使用此软件的权限。请联系<a href='mailto:"+AUTH_USER["email"]+"'>"+AUTH_USER["email"]+"</a>");
				Response.End();
			}
			else {
				if (AUTH_USER["password"]==MD5(Request.ServerVariables('AUTH_PW')(1)) && AUTH_USER["username"]==Request.ServerVariables("AUTH_USER"))
					Session.contents("auth")=true;
				else {
					Response.addHeader('WWW-Authenticate", "Basic realm="'+realm+'"');
					Response.addHeader('HTTP/1.0 401 Unauthorized');
					Response.Write("抱歉，您的密码不正确，或者您没有使用此软件的权限。请联系<a href='mailto:"+AUTH_USER["email"]+"'>"+AUTH_USER["email"]+"</a>");
					Response.End();
				}
			}
		else if (fileType=="XMLHTTP") {
			Response.ContentType="text/xml";
			Response.Write("<?xml version='1.0' encoding='"+CONFIG["encoding"]+"'?>\r\n<Error level='warning' message='未授权访问或会话超时，请重新登录'/>\r\n");
		}
		else if (fileType=="EMBED")
			Response.Write("操作未授权");
	}
	else if (CONFIG["auth_type"]=="cookie") {
		if (AUTH_USER["password"]==Request.Cookies("_editone_asp_hash") && AUTH_USER["username"]==Request.Cookies("_editone_asp_user"))
			return;
		else if (fileType=="HTML") {
			Response.Write("<script>if (top!=self) top.location='"+PAGE+"';</script>");
			showLogin("");
			//序列化$_REQUEST, set_cookie(Request.ServerVariables("URI"))
		}
		else if (fileType=="XMLHTTP") {
			Response.ContentType="text/xml";
			Response.Write("<?xml version='1.0' encoding='"+CONFIG["encoding"]+"'?>\r\n<Error level='warning' message='未授权访问或会话超时，请重新登录'/>\r\n");
		}
		else if (fileType=="EMBED")
			Response.Write("操作未授权");
	}
	Response.End();
}

function showLogin(message)
{
	Response.Write(HTML_HEADER);
%>
<body onLoad='document.F.username.focus()'>
<p align='center'>
<form name='F' action='<%=PAGE%>?do=verify' method='post'>
<table border='0' width='95%'>
	<!-- <tr>
		<td width='100'>　</td>
		<td><font color='#FFC080' style='font-size:14px; font-family:arial black'>EditONE</font> - Edit All in One Page! &nbsp; 更快捷、更方便、更简单<br><%=CONFIG["version"]%>. <a class='gray' href='http://editone.gaya.cn/' target='_blank'>下载最新版本</a>&nbsp; <a class='gray' href='http://forum.gaya.cn/thread.php?fid=28' target='_blank'>建议或Bug报告</a>&nbsp; <a class='gray' href='http://www.gaya.cn/' target='_blank'>加雅全能空间</a><font color='#999999' style='font-size:12px'>, Copyright reserved.</font></td>
	</tr> -->
	<tr>
		<td>　</td>
		<td>　</td>
	</tr>
	<tr>
		<td>　</td>
		<td><p style='color:red'><%=message%></p></td>
	</tr>
	<tr>
		<td align='right'>用户名：</td>
		<td><input type='text' name='username' style='width:120px'> 由中英文字符构成，长度不大于16个汉字。</td>
	</tr>
	<tr>
		<td align='right'>密码：</td>
		<td><input type='password' name='password' style='width:120px'> 长度不小于5、不大于20。</td>
	</tr>
	<tr>
		<td>　</td>
		<td>　</td>
	</tr>
	<tr>
		<td>　</td>
		<td><input type='submit' value='登 录'></td>
	</tr>
	<tr>
		<td>　</td>
		<td>　</td>
	</tr>
	<!-- <tr>
		<td align='right'>使用说明：</td>
		<td>　</td>
	</tr>
	<tr>
		<td>　</td>
		<td>1. EditONE要求使用者对HTML页面编辑，FTP文件上传下载以及其他网站架设技术有基本的了解。EditONE适合站长对使用中的网页做快速的编辑、调试和维护。</td>
	</tr>
	<tr>
		<td>　</td>
		<td>2. EditONE直接对正在运作中的网页进行编辑，因此误操作或不适当的修改可能会使网页访问出现问题，请谨慎操作！不了解网站架设基本技术的人请不要使用！</td>
	</tr>
	<tr>
		<td>　</td>
		<td>3. EditONE目前仅支持IE或基于IE内核的浏览器。</td>
	</tr>
	<tr>
		<td>　</td>
		<td>4. 初始登录用户为<b>admin</b>，初始密码为<b>admin</b>。安装后请立即登录，在“ 配置 ”中修改用户名和密码。</td>
	</tr>
	<tr>
		<td>　</td>
		<td>5. 安全提示：通过修改文件名editone.asp(editone.php)为一个复杂的、只有自己记得住的名字来避免EditONE可能存在的安全漏洞导致的网站入侵事件发生。<br>在任何情况下，对修改过的网站文件下载备份是一个减少损失的好习惯。</td>
	</tr>
	<tr>
		<td>　</td>
		<td>6. 版权声明及免责声明：使用者可以免费使用此软件，可以查看、研究、修改源代码。但未经Group Entropy IT允许，<br>不能发表此源代码或修改后发表。Group Entropy IT不对使用者因使用此软件引起的任何后果包括因软件Bug导致的意外损失负任何责任。</td>
	</tr>
	<tr>
		<td>　</td>
		<td>7. 广告安全性保证：EditOne V1.2或以上版本在登录页面放置了旗帜广告，在编辑页面放置了文字广告。这两个广告位代码均来自http://editone.gaya.cn。我们保证这两段广告代码是安全的，不会搜集客户端的任何信息，并负担相应责任。</td>
	</tr>
	<tr>
		<td>　</td>
		<td>  </td>
	</tr>
	<tr>
		<td colspan=2><iframe src="http://editone.gaya.cn/ad1.php" scrolling=no frameborder=0 style="width:100%; height:100px;"></iframe></td>
	</tr> -->
</table>
</form>
</p>
</body>
</html>
<%
}

function showVerify()
{
	if (AUTH_USER["password"]==MD5(Request.form("password")(1)) && AUTH_USER["username"]==Request.form("username"))
	{
		Response.cookies("_editone_asp_user")=AUTH_USER["username"]; // time()+CONFIG["cookie_life"]);
		Response.cookies("_editone_asp_hash")=AUTH_USER["password"]; // time()+CONFIG["cookie_life"]);
		Response.Write("<script>this.location.replace('"+PAGE+"');</script>");
	}
	else
		showLogin("密码不正确。请重新输入。"); // "" => d41d8cd98f00b204e9800998ecf8427e
}

function showLogout()
{
	if (CONFIG["auth_type"]=="cookie")
	{
		Response.cookies("_editone_asp_user")=""; // time()-3600);
		Response.cookies("_editone_asp_hash")=""; // time()-3600);
	}
	else if (CONFIG["auth_type"]=="HTTP")
		Session.contents("auth");
	showLogin("正常退出。Cookie被清除。会话已中止。感谢您的使用。");
}

function showFrameSet()
{
	showAuthorize("HTML");
	Response.Write(HTML_HEADER);
%>
<frameset name='FrameSet' cols='180,*' frameborder='YES' border='0' bordercolor='#DDDDDD' framespacing='3' onfocus='this.mainFrame.window.focus()'>
  <frame src='<%=PAGE%>?do=left_frame' name='leftFrame'>
  <frame src='<%=PAGE%>?do=main_frame' name='mainFrame' scrolling='no'>
</frameset>
<noframes><body bgcolor='#FFFFFF' text='#000000'>
请使用支持Frame的浏览器。
</body></noframes>
</html>
<%;
}

function showLeftFrame()
{
	showAuthorize("HTML");
	var START_DIR=CONFIG["start_dir"];
	var useUTF=CONFIG["use_utf"]=="checked"? 1:0;
	var CURRENT_DIR=Request.ServerVariables("SERVER_NAME")(1)+Request.ServerVariables("SCRIPT_NAME")(1).substring(0, Request.ServerVariables("SCRIPT_NAME")(1).lastIndexOf("/")+1);
	Response.Write(HTML_HEADER);
%>
<style>
div.body {color:#000000; background-color:#F1F1F1; font-size:12px; margin-left:6px; margin-top:6px; margin-right:0px; margin-bottom:5px;}
#menuSwitch {overflow:hidden; height:17px; font-family:Webdings; text-align:center; background-color:#DDDDDD; margin-left:-4px; margin-top:-5px; vertical-align:bottom; font-size:16px; color:#000000; cursor:hand;}

.xtree {padding:0px; }
.TreeNode {width:100%; height:20px;}
.TreeNode img {cursor:hand; margin-left:2px;}
.TreeNode span {font-family:Verdana; font-size:12px; height:17px; border:0px solid #E0E0E0; padding:2; cursor:hand}
.TreeNode span a {color:#000000; text-decoration:none}
span.MouseOver {background-color:#AAAAAA; border:1px solid #888888;}
span.HighLight {background-color:#FFFFFF; border:1px solid #0000FF;}
span.load {margin:-3px -4px; color:#000000; background-color:#E0E0E0; filter:alpha(opacity=50)}
.container {padding-left:15; height:22; width:100%;}
</style>
<script language="VBScript">
Function charCode(char)
	v=Asc(char)
	If v<0 Then
		v=v+&H10000
	End If
	charCode=v
End Function

Function replaceStr(str, find, rep)
	replaceStr=Replace(str, find, rep)
End Function

Function vbEncodeCHN(s)
	Dim i, str, lStr
	str=""
	lStr=Len(s)
	For i=1 To lStr
		theChr=Mid(s, i, 1)
		code=Asc(theChr)
		If code=38 or code=37 or code=43 or code=32 Then
			str=str & "%" & Hex(code)
		Elseif code>0 and code<16 Then
			str=str & "%0" & Hex(code)
		Elseif Abs(code)<&HFF Then
			uniCode=AscW(theChr)
			If uniCode>255 or uniCode<0 Then
				str=str & "%u" & uniCode & ";"
			Else
				str=str & theChr
			End If
		Else
			If code<0 Then
				code=code+&H10000
			End If
			H8=(code And &HFF00)\ &HFF
			L8=code And &HFF
			str=str & "%" & Hex(H8) &  "%" & Hex(L8)
		End If
	Next
	vbEncodeCHN=str
End Function
</script>
<script language="javascript">
var panelOpened=true;
var curColumns=parent.FrameSet.cols;
function switch_menu()
{
	if (panelOpened) {
		curColumns=parent.FrameSet.cols;
		parent.FrameSet.cols="10,*";
		document.all.menuSwitch.innerHTML="4";
		document.body.style.overflowX="visible";
		document.all.menuPanel.style.display="none";
		document.all.menuSwitch.style.height=document.body.clientHeight+5+"px";
		panelOpened=false;
	}
	else {
		document.all.menuSwitch.style.height="17px";
		document.all.menuSwitch.innerHTML="3<font style='font-size:12px; font-family:宋体'>关闭面板</font>";
		parent.FrameSet.cols=curColumns;
		document.body.style.overflowX="auto";
		document.all.menuPanel.style.display="block";
		panelOpened=true;
	}
}

window.document.onclick=leftClick;
window.document.oncontextmenu=rightClick;
parent.document.onkeydown=function(){return keyHandler(parent.window.event);}
document.onkeydown=function(){return keyHandler(window.event);}
function keyHandler(event)
{
	if (!event) return true;
	if (event.ctrlKey && (event.keyCode==83||event.keyCode==81))
	{ // Ctrl+S
		parent.mainFrame.document.M.save.disabled=true;
		flag=saveFile();
		//    parent.mainFrame.editor.blur();
		parent.mainFrame.document.M.save.disabled=false;
		return false;
	}
	if (event.keyCode==114)
	{ // F3
		parent.mainFrame.findNext();
		event.keyCode+=1000;
		return false;
	}
	if (event.ctrlKey && event.keyCode==70)
	{ // Ctrl+F
		parent.mainFrame.document.M.word_find.focus();
		event.keyCode+=1000;
		return false;
	}
	if (event.ctrlKey && event.keyCode==82)
	{ // Ctrl+R
		parent.mainFrame.document.M.word_replace.focus();
		event.keyCode+=1000;
		return false;
	}
	return true;
}

// Modified the code from Fason(fason_pfx@hotmail.com)
// XmlHttpRequest Class
var registerAfterLoad=null;
function XmlHttpRequest(URL)
{
	this.remoteFile=URL;
	this.readyState=0;
	this.XmlHttp=null;
	this.XmlDom=null;
	this.TextContent=null;
	this.isXML=true;
	this.Error=false;
}
XmlHttpRequest.prototype.get=function()
{
	var o=this;
	this.initialize();
	var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	this.XmlHttp=xmlhttp;
	try {
		with(xmlhttp) {
			onreadystatechange=function(){ o.ReadyStateChange();}
			open("get",this.remoteFile+(/\?/g.test(this.remoteFile)? "&":"?")+"tmp="+Math.random(),true);
			XmlHttpStatus=2;
			send();
		}
	}
	catch (e) {
		this.Error=true;
		this.onload();
		this.dispose();
	}
}
XmlHttpRequest.prototype.post=function(str)
{
	var o=this;
	this.initialize();
	var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	this.XmlHttp=xmlhttp;
	try{
		with(xmlhttp) {
			onreadystatechange=function(){ o.ReadyStateChange();}
			open("post",this.remoteFile+(/\?/g.test(this.remoteFile)? "&":"?")+"tmp="+Math.random(),true);
			setRequestHeader("Content-Length", str.length);
			setRequestHeader("CONTENT-TYPE", "application/x-www-form-urlencoded");
			send(str);
		}
	}
	catch (e) {
		this.Error=true;
		this.onload();
		this.dispose();
	}
}
XmlHttpRequest.prototype.ReadyStateChange=function()
{
	var xmlhttp=this.XmlHttp;
	var _readystate=xmlhttp.readyState;
	this.readyState=_readystate;
	if (_readystate==4) {
		if (xmlhttp.status==200) {
			this.XmlDom=xmlhttp.responseXML;
			if (this.XmlDom.xml=="")	{
				this.isXML=false;
				this.TextContent=parent.mainFrame.Bin2Str(xmlhttp.responseBody);
			}
		}
		else
			this.Error=true;
		this.onload();
		this.dispose();
	}
}
XmlHttpRequest.prototype.dispose=function()
{
	registerAfterLoad=null;
	this.XmlDom=null;
	this.XmlHttp=null;
}
XmlHttpRequest.prototype.initialize=function()
{
}

// Globe Variables
var imgFile=new Image();imgFile.src='<%=PAGE%>?do=image&file=endnode.gif';
var imgClose=new Image();imgClose.src='<%=PAGE%>?do=image&file=folder_close.gif';
var imgOpen=new Image();imgOpen.src='<%=PAGE%>?do=image&file=folder_open.gif';

var showButton, XmlData=new Array();
var msgLoading="正在加载...";
var msgUnavaible="加载失败";
var msgVoidDir="目录为空，或权限不够。";
var XX=new ActiveXObject("Microsoft.XMLDOM");
XX.async=false;
XX.load("<%=PAGE%>?do=xml&file=xtree.xsl");

function initialize()
{
	MainDIV.selectedNode=null;
	showButton=MainDIV.showButton? true:false;
	loadChildren(MainDIV);
	parent.leftFrame.window.focus();
}

function toggle(el)
{
	if(el.type=='parent') {
		if(el.open=='true')
			collapse(el);
		else
			expand(el);
	}
}

function collapse(el)
{
	var tmp=getChild(el,"div");
	if (tmp)
		tmp.style.display='none';
	getChild(el,'img').src=imgClose.src;
	el.open='false';
	delCookie(el.uid);
}

function expand(el)
{
	var tmp=getChild(el,"div");
	if (tmp)
		tmp.style.display='';
	else
		return;
	el.open='true';
	setCookie(el.uid,1);
	getChild(el,'img').src=imgOpen.src;
	if(tmp.send=='false')
		loadChildren(tmp);
	else {
		var Children=getChildren(el);
		for(var i=0;i<Children.length;i++) {
			var ck=parseInt(getCookie(Children[i].uid))
			if( ck==1 && Children[i].type=="parent") {
				expand(Children[i]);
			}
			if(Children[i].uid==getCookie("selected"))
				focus(Children[i],true);
		}
		if (showButton)
			checkedChildren(el);
	}
}

function FindXY(obj){
	var x=0,y=0;
	while (obj!=null){
		x+=obj.offsetLeft-obj.scrollLeft;
		y+=obj.offsetTop-obj.scrollTop;
		obj=obj.offsetParent;
	}
	return {x:x,y:y};
}
function FindXYWH(obj){
	var objXY=FindXY(obj);
	return objXY?{ x:objXY.x, y:objXY.y, w:obj.offsetWidth, h:obj.offsetHeight }:{ x:0, y:0, w:0, h:0 };
}
function ScrollIntoView(el)
{
	var objOffset=FindXY(el);
	var iY=objOffset.y-window.document.body.clientHeight/2;
	var iX=objOffset.x-15;
	window.scrollTo(0,iY);//(iX+35,iY);
}

function loadChildren(oDiv)
{
	oDiv.send="true";
	var x=new XmlHttpRequest("<%=PAGE%>?do=file_list&dir="+escape(oDiv.uid));
	var ick=getCookie(oDiv.parentElement.uid);
	if(!ick) setCookie(oDiv.parentElement.uid,1);
	x.initialize=function()
	{
		oDiv.innerHTML='<div type="leaf" class="TreeNode"><img type="img" align="absmiddle" src="'+imgFile.src+'"><span type="label"><span class="loading">'+msgLoading+'</span></span></div>';
	}
	x.onload=function()
	{
		var load=getChild(oDiv.firstChild,'span');
		if (x.Error||!x.isXML)
			load.firstChild.innerHTML=msgUnavaible;
		else {
			XmlData[oDiv.uid]=x.XmlDom.documentElement.selectSingleNode("/TreeNode");
			renderDiv(oDiv);
		}
		if (registerAfterLoad)
			registerAfterLoad();
	}
	x.get();
}
function renderDiv(oDiv)
{
	dom=XmlData[oDiv.uid];
	if (dom.hasChildNodes()) {
		oDiv.innerHTML=dom.transformNode(XX);
		if (showButton)
			checkedChildren(oDiv.parentElement);
		else {
			cc=oDiv.getChildsByTagName("input");
			for(var i=0;i<cc.length;i++)
				cc[i].style.display="none";
		}
		var Children=oDiv.childNodes;
		for(var i=0;i<Children.length;i++) {
			var ck=parseInt(getCookie(Children[i].uid));
			if(ck==1 && Children[i].type=="parent")
				expand(Children[i]);
			if(String(Children[i].uid)==String(getCookie("selected")))
				focus(Children[i],true);
		}
	}
	else {
		oDiv.innerHTML="";
		setStatus(msgVoidDir,"AUTO");
	}
}

function checkedButton(objNode)
{
	var button=getChild(objNode,"input");
	if(button.checked)
		return true;
	else
		return false;
}

function checkedChildren(objNode)
{
	var Children=getChildren(objNode);
	var Button=getChild(objNode,"input");
	if(Children && Button) {
		var isCheck=Button.checked;
		for(var i=0;i<Children.length;i++) {
			var _button=getChild(Children[i],"input")
			if(_button) {
				_button.checked=isCheck;
				if(getChild(Children[i],"div"))
					if(getChild(Children[i],"div").send=="true")
						checkedChildren(Children[i]);
			}
		}
	}
}

function checkedParent(objNode)
{
	var Parent=getParentNode(objNode);
	var Button=getChild(objNode,"input");
	if(Parent) {
		var Children=getChildren(Parent);
		for(var i=0;i<Children.length;i++)
			if(!getChild(Children[i],"input").checked)break;
		getChild(Parent,"input").checked =(i==Children.length);
		checkedParent(Parent);
	}
}

function getChildren(el){
	var Ctmp=getChild(el,"div");
	if (Ctmp)
		return Ctmp.children;
	return null;
}

function getChild(el,T)
{
	var ol=null;
	var Children=el.children;
	for(var i=0;i<Children.length;i++)
		if(Children[i].tagName.toUpperCase()==T.toUpperCase()) {
			ol=Children[i];
			break;
		}
	return ol;
}

function focus(el,isScroll)
{
	if (MainDIV.selectedNode&&(e=getChild(MainDIV.selectedNode,'span'))!=null)
		e.className='';
	if (el == null)
		return;
	getChild(el,'span').className='HighLight';
	MainDIV.selectedNode=el;
	setCookie("selected",el.uid);
	if (isScroll)
		ScrollIntoView(el);
}

function getParentNode(el){
	var tmp=el.parentElement;
	if(tmp.type=="container")return tmp.parentElement;
	return null;
}

function setCookie(name,value)
{
	var Days=30;
	var exp=new Date();
	exp.setTime(exp.getTime()+Days*24*60*60*1000);
	MainDIV.document.cookie=name+"="+ escape (value)+";expires="+exp.toGMTString();
}
function getCookie(name)
{
	var arr=MainDIV.document.cookie.split("; ");
	for(i=0;i<arr.length;i++)
		if (arr[i].split("=")[0]==name)
			return unescape(arr[i].split("=")[1]);
	return null;
}
function delCookie(name)
{
	var exp=new Date();
	exp.setTime(exp.getTime()-1);
	var cval=getCookie(name);
	if(cval!=null) MainDIV.document.cookie= name+"="+cval+";expires="+exp.toGMTString();
}
function getFileType(filename)
{
	if (filename.charAt(filename.length-1)=='/')
		return "dir";
	n=filename.lastIndexOf(".");
	suffix=n>=0? filename.substr(n+1).toLowerCase():"";
	switch (suffix) {
		case "asp": case "aspx": case "php": case "jsp": case "cgi": case "pl": case "js": return "script";
		case "htm": case "html": case "shtml": return "htm";
		case "js": case "css": case "xml": case "xsl": return "config";
		case "jpg": case "gif": case "bmp": case "psd": case "ico": return "pic";
		case "java": case "c": case "cpp": case "cs": case "h": case "hpp": return "source";
		case "mp3": case "mpga": case "wav": case "mid": case "avi": case "mpg": case "rm": case "wmv": case "wma": case "swf": return "media";
		case "rar": case "zip": case "gz": case "tar": return "rar";
		default: return "default";
	}
}

var InRename=false;
var CurNode=null;
var OldFileName, OldFileID, OldFileLength, OldFileTime;
function editName()
{
	focus(null,false);
	OldFileName=CurNode.innerText;
	OldFileID=CurNode.file;
	OldFileLength=OldFileID.charAt(OldFileID.length-1)=='/'? null:CurNode.length;
	OldFileTime=CurNode.time;
	CurNode=CurNode.parentNode;
	CurNode.innerHTML="<input id='fileName' name='fileName' type='text' value='"+OldFileName+"' size='15' onKeyUp='javascript:if (InRename&&window.event.keyCode==13) return rename();'>";
	InRename=true;
	document.all("fileName").focus();
	document.all("fileName").select();
}
function rename()
{
	NewFileName=document.all("fileName").value;
	InRename=false;
	if (NewFileName==OldFileName) {
		CurNode.innerHTML="<a file='"+OldFileID+"' "+(OldFileLength==null? "":"length='"+OldFileLength+"' ")+" time='"+OldFileTime+"' href='javascript:void(0)' onClick='javascript:return dispose(this)' onMouseOver='javascript:return showDetail(this)' onMouseOut='javascript:return closeDetail(this)'>"+OldFileName+"</a>";
		return true;
	}
	var x=new XmlHttpRequest("<%=PAGE%>?do=rename&file="+escape(OldFileID)+"&name="+escape(NewFileName));
	x.onload=function()
	{
		title="重命名"+(OldFileLength==null? "目录":"文件");
		if (x.Error||!x.isXML||getNode(x,"Status")!="true") {
			if (x.Error)
				alert(title+"出错。\n\n没有返回信息。");
			else {
				if (!x.isXML)
					alert(title+"出错。\n\n返回未格式化信息：\n"+x.TextContent);
				else
					alert(title+"出错。\n\n原因：\n"+getNode(x,"Reason")+"\n\n建议：\n"+getNode(x,"Advice"));
			}
			CurNode.innerHTML="<a file='"+OldFileID+"' "+(OldFileLength==null? "":"length='"+OldFileLength+"' ")+" time='"+OldFileTime+"' href='javascript:void(0)' onClick='javascript:return dispose(this)' onMouseOver='javascript:return showDetail(this)' onMouseOut='javascript:return closeDetail(this)'>"+OldFileName+"</a>";
			setStatus(title+"出错。", "AUTO");
		}
		else {
			var UID;
			if (OldFileID.charAt(OldFileID.length-1)=='/')
				UID=OldFileID.substring(0, OldFileID.length-OldFileName.length-1)+NewFileName+'/';
			else
				UID=OldFileID.substring(0, OldFileID.length-OldFileName.length)+NewFileName;
			CurNode.innerHTML="<a file='"+UID+"' "+(OldFileLength==null? "":"length='"+OldFileLength+"' ")+" time='"+OldFileTime+"' href='javascript:void(0)' onClick='javascript:return dispose(this)' onMouseOver='javascript:return showDetail(this)' onMouseOut='javascript:return closeDetail(this)'>"+NewFileName+"</a>";
			CurNode.parentNode.uid=UID;
			getChild(CurNode.parentNode,"INPUT").value=UID;
			if (OldFileLength!=null) {
				getChild(CurNode.parentNode,"IMG").src="<%=PAGE%>?do=image&file="+getFileType(NewFileName)+".gif";
			}
			else
				getChild(CurNode.parentNode,"DIV").uid=UID;
			setStatus(title+"“ "+OldFileName+" ”为“ "+NewFileName+" ”成功。", "AUTO");
		}
		focus(CurNode.parentNode,false);
	}
	x.get();
	return true;
}
function delete0()
{
	OldFileName=CurNode.innerText;
	OldFileID=CurNode.file;
	warning=OldFileID.charAt(OldFileID.length-1)=='/'? "您确认要删除目录“ "+OldFileName+" ”吗？\n\n警告：\n您删除的是一个目录。如果删除此目录，也将删除此目录下的所有文件和目录！":"您确认要删除文件“ "+OldFileName+" ”吗？";
	if (!confirm(warning))
		return false;
	var x=new XmlHttpRequest("<%=PAGE%>?do=delete&file="+escape(OldFileID));
	x.onload=function()
	{
		if (x.Error||!x.isXML||getNode(x,"Status")!="true") {
			if (x.Error)
				alert("删除文件出错。\n\n没有返回信息。");
			else {
				if (!x.isXML)
					alert("删除文件出错。\n\n返回未格式化信息：\n"+x.TextContent);
				else
					alert("删除文件出错。\n\n原因：\n"+getNode(x,"Reason")+"\n\n建议：\n"+getNode(x,"Advice"));
			}
			setStatus("删除文件出错。", "AUTO");
		}
		else {
			CurNode.parentNode.parentNode.style.display="none";
			setStatus("删除文件“ "+OldFileName+" ”成功。", "AUTO");
		}
	}
	x.get();
	return false;
}

var fileName="";
var closeTag="";
function edit(obj)
{
	fileName=obj.file;
	var x=new XmlHttpRequest("<%=PAGE%>?do=edit&file="+escape(fileName));
	x.onload=function()
	{
		if (x.Error||!x.isXML||getNode(x,"Status")!="true") {
			if (x.Error)
				alert("加载出错。\n\n没有返回信息。");
			else {
				if (!x.isXML)
					alert("加载出错。\n\n返回未格式化信息：\n"+x.TextContent);
				else
					alert("加载出错。\n\n原因：\n"+getNode(x,"Reason")+"\n\n建议：\n"+getNode(x,"Advice"));
			}
			setStatus("加载文件出错。", "AUTO");
		}
		else {
			setStatus("加载文件“ "+fileName+" ”成功。", "AUTO");
			parent.mainFrame.gotoEditMode();
			parent.mainFrame.document.M.editor.innerText=getNode(x,"Content");
			parent.mainFrame.isNeedSave=false;
			if (registerAfterLoad)
				registerAfterLoad();
		}
	}
	x.get();
	return false;
}
function runScript()
{
}
function download()
{
	loader.location="<%=PAGE%>?do=download&file="+escape(CurNode.file);
	return false;
}
var InUpload, UpNameHandler, OldFileList, UploadName, UploadDir;
function uploadFile()
{
	focus(null,false);
	loaddoc=loader.document;
	loaddoc.open();
	loaddoc.write("<html><head><style>body{font-size:12px; color:#000000; background-color:#F1F1F1; margin-left:0px; margin-top:0px; margin-right:0px; margin-bottom:0px;} input {font-size:12px; height:18px}</style></head><body><form id='F' name='F' action='<%=PAGE%>?do=upload' enctype='multipart/form-data' method='post' onSubmit='parent.upload()'><input type='hidden' name='dir' value='"+CurNode.parentNode.uid+"'><input id='fileName' name='fileName' type='text' value='' size='12'><input type='file' name='fileUpload' value='' id='fileUpload' style='width:0px' onChange='nm=this.value;fileName.value=nm.substring(nm.lastIndexOf(\"\\\\\")+1,nm.length);'></form></body></html>");
	loaddoc.close();
	mark=CurNode.innerHTML+"</DIV>";
	CurNode=CurNode.parentNode;
	OldFileList=CurNode.innerHTML;
	CurNode.innerHTML=CurNode.innerHTML.replace(mark,mark+"\n<DIV class=TreeNode noWrap type='leaf' xmlns:user='http://editone.gaya.cn' xmlns:msxsl='urn:schemas-microsoft-com:xslt' open='false' uid=''><INPUT type=checkbox value='' name='itemSel' class='selector'><IMG src='<%=PAGE%>?do=image&amp;file=default.gif' align=absMiddle><SPAN type='label'><input type='hidden' id='posUpload'></SPAN></DIV>");
	InUpload=true;
	s=FindXYWH(document.all("posUpload"));
	loaderDIV.style.left=document.body.scrollLeft+s.x;
	loaderDIV.style.top=document.body.scrollTop+s.y-1;
	loaderDIV.style.display="block";
	loader.document.all("fileUpload").focus();
	loader.document.all("fileUpload").select();
}
function upload()
{
	InUpload=false;
	loaderDIV.style.display="none";
	if (loader.document.all("fileUpload").value=="") {
		CurNode.innerHTML=OldFileList;
		return false;
	}
	UploadName=loader.document.all("F").fileName.value;
	UploadDir=loader.document.all("F").dir.value;
	loader.document.all("F").action="<%=PAGE%>?do=upload&name="+escape(UploadName)+"&dir="+escape(UploadDir);
	loader.document.all("F").submit();
	return false;
}
function reportUpload(status,param,advice)
{
	if (status==true) {
		div=document.all("posUpload").parentNode.parentNode;
		div.uid=UploadDir+UploadName;
		getChild(div,"INPUT").value=div.uid;
		getChild(div,"IMG").src="<%=PAGE%>?do=image&file="+getFileType(UploadName)+".gif";
		getChild(div,"SPAN").innerHTML="<a file='"+div.uid+"' length='"+param+"' time='"+Math.floor(new Date().getTime()/1000)+"' href='javascript:void(0)' onClick='javascript:return dispose(this)' onMouseOver='javascript:return showDetail(this)' onMouseOut='javascript:return closeDetail(this)'>"+UploadName+"</a>";
	}
	else {
		CurNode.innerHTML=OldFileList;
		alert("文件上传失败。\n\n原因："+param+"\n\n建议：\n"+"错误编号:"+advice+"; 请查阅相关文档。");
	}
}
function browse(type)
{
	if (parent.mainFrame.isNeedSave&&confirm("内容已被修改，是否保存？"))
		saveFile();
	if (type=="editafterbrowse") {
		edit(CurNode);
		registerAfterLoad=parent.mainFrame.gotoPreviewMode;
		return;
	}
	parent.mainFrame.document.M.editor.innerText="";
	parent.mainFrame.gotoPreviewMode();
	if (type=="htm"||type=="pic")
		parent.mainFrame.previewer.location=CurNode.file;
	else if (type=="media") {
		file=CurNode.innerText;
		n=file.lastIndexOf(".");
		suffix=n>=0? file.substr(n+1).toLowerCase():"";
		var str;
		switch (suffix) {
			case "mp3": case "mpga": case "wav": case "mid":
			str="<object id='media' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' height='66' width='310'><param name='FileName' value='"+CurNode.file+"'><param name='autostart' value='true'><embed value='"+CurNode.file+"' type='application/x-mplayer2' pluginspage='http://www.microsoft.com/isapi/redir.dll?prd=windows&amp;sbp=mediaplayer&amp;ar=media&amp;sba=plugin&amp;' height='66' width='310' autostart='1'></object>"; break;
			case "avi": case "mpg": case "wmv": case "wma":
			str="<EMBED src='"+CurNode.file+"' HEIGHT='256' WIDTH='314' AutoStart=1></EMBED>"; break;
			case "rm":
			str="<object id='media' classid='CLSID:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' height='275' width='316'><param name='controls' value='ImageWindow,StatusBar,ControlPanel'><param name='console' value='Clip1'><param name='autostart' value='true'><param name='LOOP' value='1'><param name='src' value='"+CurNode.file+"'><embed value='"+CurNode.file+"' type='audio/x-pn-realaudio-plugin' console='Clip1' controls='ImageWindow,ControlPanel,StatusBar' height='275' width='316' autostart='true'></object>"; break;
			case "swf":
			str="<object id='media' classid='CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='400' height='400'><param name=movie value='"+CurNode.file+"'><param name=quality value=high><embed src='"+CurNode.file+"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed></object>";
		}
		editdoc=parent.mainFrame.document.all("previewer").contentWindow.document;
		editdoc.open();
		editdoc.write(str);
		editdoc.close();
	}
}
var InAddName=false;
var NewType=null;
var OldDirContent;
function addName(type)
{
	focus(null,false);
	if (CurNode.type!="container") { // 空目录
		mark=CurNode.innerHTML+"</DIV>";
		CurNode=CurNode.parentNode;
	}
	else
		mark=CurNode.innerHTML;
	NewType=type;
	OldDirContent=CurNode.innerHTML;
	CurNode.innerHTML=CurNode.innerHTML.replace(mark,mark+"\n<DIV class=TreeNode noWrap type='"+(type=="dir"? "parent":"leaf")+"' xmlns:user='http://editone.gaya.cn' xmlns:msxsl='urn:schemas-microsoft-com:xslt' open='false' uid=''><INPUT type=checkbox value='' name='itemSel' class='selector'><IMG src='<%=PAGE%>?do=image&amp;file="+(type=="dir"? "folder_close":"default")+".gif' align=absMiddle><SPAN type='label'><input id='fileName' name='fileName' type='text' value='"+(type=="dir"? "新建目录名":"新建文件名")+"' size='15' onKeyUp='javascript:if (InAddName&&window.event.keyCode==13) return newFile();'></SPAN></DIV>");
	InAddName=true;
	document.all("fileName").focus();
	document.all("fileName").select();
}
function addChild(type)
{
	focus(null,false);
	CurNode=CurNode.parentNode.parentNode;
	mark="<DIV class=container uid=\""+CurNode.uid+"\" send=\"true\" type=\"container\">";
	if (getChild(CurNode,"DIV").send=="false") {
		registerAfterLoad=addChildExecute;
		toggle(CurNode);
	}
	else if (CurNode.open=="false") {
		toggle(CurNode);
		addChildExecute();
	}
	else
		addChildExecute();
	function addChildExecute() {
		NewType=type;
		OldDirContent=CurNode.innerHTML;
		CurNode.innerHTML=CurNode.innerHTML.replace(mark,mark+"\n<DIV class=TreeNode noWrap type='"+(type=="dir"? "parent":"leaf")+"' xmlns:user='http://editone.gaya.cn' xmlns:msxsl='urn:schemas-microsoft-com:xslt' open='false' uid=''><INPUT type=checkbox value='' name='itemSel' class='selector'><IMG src='<%=PAGE%>?do=image&amp;file="+(type=="dir"? "folder_close":"default")+".gif' align=absMiddle><SPAN type='label'><input id='fileName' name='fileName' type='text' value='"+(type=="dir"? "新建目录名":"新建文件名")+"' size='15' onKeyUp='javascript:if (InAddName&&window.event.keyCode==13) return newFile();'></SPAN></DIV>");
		InAddName=true;
		document.all("fileName").focus();
		document.all("fileName").select();
	}
}
function newFile()
{
	NewFileName=document.all("fileName").value;
	content=encodeCHN(parent.mainFrame.document.M.editor.innerText);
	InAddName=false;

	var x=new XmlHttpRequest("<%=PAGE%>?do=new&dir="+escape(CurNode.uid)+"&name="+escape(NewFileName)+"&type="+NewType);
	x.onload=function()
	{
		title="新建"+(NewType=="dir"? "目录":"文件");
		if (x.Error||!x.isXML||getNode(x,"Status")!="true") {
			if (x.Error)
				alert(title+"出错。\n\n没有返回信息。");
			else {
				if (!x.isXML)
					alert(title+"出错。\n\n返回未格式化信息：\n"+x.TextContent);
				else
					alert(title+"出错。\n\n原因：\n"+getNode(x,"Reason")+"\n\n建议：\n"+getNode(x,"Advice"));
			}
			CurNode.innerHTML=OldDirContent;
			setStatus(title+"出错。", "AUTO");
		}
		else {
			e=document.all("fileName").parentNode.parentNode;
			UID=CurNode.uid+NewFileName+(NewType=="dir"? "/":"");
			e.innerHTML="<INPUT type='checkbox' value='"+UID+"' name='itemSel' class='selector'><IMG src='<%=PAGE%>?do=image&amp;file="+(NewType=="dir"? "folder_close":getFileType(NewFileName))+".gif' align=absMiddle><SPAN type='label'><A file='"+UID+"' "+(NewType=="dir"? "":"length='"+content.length+"' ")+" time='"+Math.floor(new Date().getTime()/1000)+"' href='javascript:void(0)' onClick='javascript:return dispose(this)' onMouseOver='javascript:return showDetail(this)' onMouseOut='javascript:return closeDetail(this)'>"+NewFileName+"</A></SPAN>"+(NewType=="dir"? "\n<DIV class=container uid='"+UID+"' send='false' type='container' style='display:none'></DIV>":"");
			e.uid=UID;
			focus(e,false);
			setStatus(title+"“ "+NewFileName+" ”成功。", "AUTO");
		}
		OldDirContent=null;
	}
	x.post("content="+content);
	return true;
}

var FileCopied=null;
function copyFile()
{
	FileCopied=CurNode;
}

function pasteFile(obj)
{
	var NewFileName, UID, NewType, NewLength, mark, title, dir, type;
	if (obj=="dir")
		CurNode=CurNode.parentNode.parentNode;
	dir=CurNode.uid.substring(0,CurNode.uid.lastIndexOf('/')+1);
	type=getFileType(FileCopied.file);

	var x=new XmlHttpRequest("<%=PAGE%>?do=paste&file="+escape(FileCopied.file)+"&dir="+escape(dir)+"&name="+escape(FileCopied.innerText)+"&type="+type);
	x.onload=function()
	{
		title="粘贴"+(type=="dir"? "目录":"文件");
		if (x.Error||!x.isXML||getNode(x,"Status")!="true") {
			if (x.Error)
				alert(title+"出错。\n\n没有返回信息。");
			else {
				if (!x.isXML)
					alert(title+"出错。\n\n返回未格式化信息：\n"+x.TextContent);
				else
					alert(title+"出错。\n\n原因：\n"+getNode(x,"Reason")+"\n\n建议：\n"+getNode(x,"Advice"));
			}
			setStatus(title+"出错。", "AUTO");
		}
		else {
			NewFileName=getNode(x,"FileName");
			if (CurNode.type=="leaf") {
				mark=">"+CurNode.innerText+"</A></SPAN></DIV>";
				CurNode=CurNode.parentNode;
				pasteFileExecute();
			}
			else if (CurNode.type=="parent") {
				mark="<DIV class=container uid=\""+CurNode.uid+"\" send=\"true\" type=\"container\">";
				if (getChild(CurNode,"DIV").send=="false") {
					registerAfterLoad=pasteFileExecute;
					toggle(CurNode);
				}
				else if (CurNode.open=="false") {
					toggle(CurNode);
					pasteFileExecute();
				}
				else
					pasteFileExecute();
			}
			else if (CurNode.type=="container") { //空目录
				mark=CurNode.innerHTML;
				pasteFileExecute();
			}
			function pasteFileExecute() {
				if (type=="dir")
					UID=dir+NewFileName+'/';
				else {
					UID=dir+NewFileName;
					NewType=getFileType(NewFileName);
					NewLength=FileCopied.length;
				}
				focus(null,false);
				CurNode.innerHTML=CurNode.innerHTML.replace(mark,mark+"\n<DIV id='"+UID+"' class=TreeNode noWrap type='"+(type=="dir"? "parent":"leaf")+"' xmlns:user='http://editone.gaya.cn' xmlns:msxsl='urn:schemas-microsoft-com:xslt' open='false' uid='"+UID+"'><INPUT type=checkbox value="+UID+" name='itemSel' class='selector'><IMG src='<%=PAGE%>?do=image&amp;file="+(type=="dir"? "folder_close":NewType)+".gif' align=absMiddle><SPAN type='label'><A file='"+UID+"' "+(type=="dir"? "":"length='"+NewLength+"' ")+" time='"+Math.floor(new Date().getTime()/1000)+"' href='javascript:void(0)' onClick='javascript:return dispose(this)' onMouseOver='javascript:return showDetail(this)' onMouseOut='javascript:return closeDetail(this)'>"+NewFileName+"</A></SPAN>"+(type=="dir"? "\n<DIV class=container uid='"+UID+"' send='false' type='container' style='display:none'></DIV>":"")+"</DIV>");
				focus(document.all(UID),false);
				setStatus(title+"“ "+FileCopied.file+" ”为“ "+UID+" ”成功。", "AUTO");
			}
		}
	}
	x.get();
	return true;
}

function order(type)
{
	CurNode=CurNode.parentNode.parentNode.parentNode;
}

function dispose(obj)
{
	CurNode=obj;
	FileID=obj.file;
	ep=obj.parentNode;
	if(ep.type=="label") {
		obj.blur();
		ep=ep.parentNode;
		focus(ep,false);
	}
	if (FileID.charAt(FileID.length-1)=='/') { //目录
		toggle(ep);
		return false;
	}
	cmd=_mi[getFileType(obj.file)][0][1];
	eval(cmd);
	return false;
}

function showDetail(obj)
{
	if (contextmenu.style.display=="block")
		return false;
	detailDIV.style.left=document.body.scrollLeft+20;
	detailDIV.style.top=document.body.scrollTop+event.clientY+25;
	var sLen, sTime;
	if (obj.length>1024&&obj.length<1048576)
		sLen=Math.floor(obj.length/102.4)/10+" KB<br>&nbsp; &nbsp; &nbsp;("+obj.length+" 字节)";
	else if (obj.length>=1048576)
		sLen=Math.floor(obj.length/104857.6)/10+" MB<br>&nbsp; &nbsp; &nbsp;("+obj.length+" 字节)";
	else
		sLen=obj.length+" 字节";
	D=new Date(obj.time*1000);
	sTime=D.getFullYear()+"年"+(D.getMonth()+1)+"月"+D.getDate()+"日<br>&nbsp; &nbsp; &nbsp; "+D.getHours()+":"+D.getMinutes()+":"+D.getSeconds();
	fileDetail.innerHTML=(typeof(obj.length)=="undefined"? "":"长度: "+sLen+"<br>")+"修改: "+sTime+"<br>";
	detailDIV.style.display="block";
	return false;
}
function closeDetail(obj)
{
	detailDIV.style.display="none";
	return false;
}

function leftClick()
{
	if (window.event.srcElement.name!="fileName"&&window.event.srcElement.name!="fileUpload") {
		if (InRename)
			rename();
		else if (InAddName)
			newFile();
		else if (InUpload)
			upload();
	}
	contextmenu.style.display="none";
	return true;
}
function rightClick()
{
	if (window.event.srcElement.name!="fileName"&&window.event.srcElement.name!="fileUpload") {
		if (InRename)
			rename();
		else if (InAddName)
			newFile();
		else if (InUpload)
			upload();
	}
	detailDIV.style.display="none";
	CurNode=window.event.srcElement;

	var ep=CurNode.parentNode;
	if(ep.type=="label") {
		CurNode.blur();
		ep=ep.parentNode;
		focus(ep,false);
		fileType=getFileType(CurNode.file);
		menu=_mi[fileType];
		if (FileCopied!=null)
			menu[3][3]=true;
		str="<table border='0' width='100%' cellspacing='1'>";
		for (var n in menu)
			if (menu[n].length>3&&menu[n][3]==false)
				str+="<tr><td>"+menu[n][2]+"</td><td><font color='gray'>"+menu[n][0]+"</font></td></tr>";
			else
				str+="<tr><td>"+menu[n][2]+"</td><td><a href="+menu[n][1]+">"+menu[n][0]+"</a></td></tr>";
		str+="</table>";
		menuzone.innerHTML=str;
	}
	else {
		menu=_mi["body"];
		if (FileCopied!=null)
			menu[3][3]=true;
		str="<table border='0' width='100%' cellspacing='1'>";
		for (var n in menu)
			if (menu[n].length>3&&menu[n][3]==false)
				str+="<tr><td>"+menu[n][2]+"</td><td><font color='gray'>"+menu[n][0]+"</font></td></tr>";
			else
				str+="<tr><td>"+menu[n][2]+"</td><td><a href="+menu[n][1]+">"+menu[n][0]+"</a></td></tr>";
		str+="</table>";
		menuzone.innerHTML=str;
	}
	contextmenu.style.left=document.body.scrollLeft+46;
	contextmenu.style.top=document.body.scrollTop+event.clientY-5;
	contextmenu.style.display="block";
	return false;
}

var _mi=new Array(), _p;
_p="script";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("编辑","javascript:edit(CurNode);void(0)","");
//_mi[_p][_mi[_p].length]=new Array("运行...","javascript:runScript();void(0)","",false);
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="htm";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("浏览/编辑","javascript:browse('editafterbrowse');void(0)","");
_mi[_p][_mi[_p].length]=new Array("浏览","javascript:browse('"+_p+"');void(0)","");
_mi[_p][_mi[_p].length]=new Array("编辑","javascript:edit(CurNode);void(0)","");
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="config";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("编辑","javascript:edit(CurNode);void(0)","");
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="pic";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("浏览","javascript:browse('"+_p+"');void(0)","");
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="source";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("编辑","javascript:edit(CurNode);void(0)","");
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="media";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("播放","javascript:browse('"+_p+"');void(0)","");
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="rar";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="default";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("下载","javascript:download();void(0)","");
_mi[_p][_mi[_p].length]=new Array("编辑","javascript:edit(CurNode);void(0)","");
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");
_p="body";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("新建文件...","javascript:addName('file');void(0)","");
_mi[_p][_mi[_p].length]=new Array("新建目录...","javascript:addName('dir');void(0)","");
_mi[_p][_mi[_p].length]=new Array("上传文件...","javascript:uploadFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("粘贴","javascript:pasteFile();void(0)","",false);
//_mi[_p][_mi[_p].length]=new Array("按名称排序","javascript:order('name')","");
//_mi[_p][_mi[_p].length]=new Array("按大小排序","javascript:order('size')","");
//_mi[_p][_mi[_p].length]=new Array("按类型排序","javascript:order('type')","");
//_mi[_p][_mi[_p].length]=new Array("按时间排序","javascript:order('time')","");
_p="dir";
_mi[_p]=new Array();
_mi[_p][_mi[_p].length]=new Array("打开/关闭","javascript:toggle(CurNode.parentNode.parentNode);void(0)","");
_mi[_p][_mi[_p].length]=new Array("新建子文件...","javascript:addChild('file');void(0)","");
_mi[_p][_mi[_p].length]=new Array("新建子目录...","javascript:addChild('dir');void(0)","");
_mi[_p][_mi[_p].length]=new Array("粘贴","javascript:pasteFile('dir');void(0)","",false);
_mi[_p][_mi[_p].length]=new Array("复制","javascript:copyFile();void(0)","");
_mi[_p][_mi[_p].length]=new Array("删除","javascript:delete0();void(0)","");
_mi[_p][_mi[_p].length]=new Array("重命名","javascript:editName()","");

function getNode(x,node)
{
	var str=x.XmlDom.documentElement.selectSingleNode("/File/"+node).xml;
	if (node=="Content") {
		str=str.substring(18, str.length-13);
		closeTag=getNode(x,"CloseTag");
		str=replaceStr(str, "]]"+closeTag, "]]>");
	}
	else
		str=str.substring(node.length+2, str.length-node.length-3);
	return str;
}
function saveFile()
{
	if (fileName=="")
		return false;
	setStatus("正在保存文件 “ "+fileName+" ” ...", "WAIT");
	var x=new XmlHttpRequest("<%=PAGE%>?do=save&unicode="+useUTF+"&file="+escape(fileName));
	var is_success=true;
	x.onload=function()
	{
		if (x.Error||!x.isXML||getNode(x,"Status")!="true")
		{
			if (x.Error)
				alert("保存失败。\n\n没有返回信息。");
			else
			{
				if (!x.isXML)
					alert("保存失败。\n\n返回未格式化信息：\n"+x.TextContent);
				else
					alert("保存失败。\n\n原因：\n"+getNode(x,"Reason")+"\n\n建议：\n"+getNode(x,"Advice"));
			}
			setStatus("保存文件失败。", "AUTO");
			is_success=false;
		}
		else {
			setStatus("文件已保存。", "AUTO");
			parent.mainFrame.isNeedSave=false;
		}
	}
	parent.mainFrame.gotoEditMode();
	content=encodeCHN(parent.mainFrame.document.M.editor.innerText);
	x.post("content="+content);
	return is_success;
}

var useUTF=<%=useUTF%>;
function encodeCHN(s)
{
	var version=navigator.userAgent.match(/MSIE\s((\d)\.(\d))/i);
	if (useUTF) {
		if (version!=null && version[2]==5 && version[3]<5) //IE5.0x
			return vbEncodeCHN(s);
		else
			return s.replace(/(.|\s)/g, function(s,n){c=n.charCodeAt(0); return c>255||c<0? "%u"+c.toString(16):((c==38||c==37||c==43||c==32)? '%'+c.toString(16):(c<16? "%0"+c.toString(16):n));});
	}
	else {
		if (version!=null && version[2]==5 && version[3]<5)
			return vbEncodeCHN(s);
		else
			return s.replace(/(.|\s)/g, function(s,n){c=charCode(n.charAt(0)); return c>127? '%'+c.toString(16).substring(0,2)+'%'+c.toString(16).substring(2,4):((c==38||c==37||c==43||c==32)? '%'+c.toString(16):(c<16? "%0"+c.toString(16):n));});
	}
}

var intervalHandler=null;
var timeoutHandler=null;
var previousStatus=null;
var alwaysHandler=null;
function setStatus(message, type)
{
	if (intervalHandler!=null)
		 clearInterval(intervalHandler);
	if (timeoutHandler!=null)
		 clearTimeout(timeoutHandler);
	previousStatus=parent.window.status;
	parent.window.status=message;
	switch (type)
	{
		case "WAIT": intervalHandler=setInterval(function(){parent.window.status=parent.window.status+".";}, 500); break;
		case "AUTO": timeoutHandler=setTimeout(function(){parent.window.status="";}, 5000); break;
		case "ALWAYS": if (alwaysHandler!=null) clearInterval(alwaysHandler);
		alwaysHandler=setInterval(function(){parent.window.status+=message;}, 100); break;
	}
}
</script>
<body onLoad="initialize()">
<div id="menuSwitch" onClick="switch_menu()">3<font style='font-size:12px; font-family:宋体'>关闭面板</font></div>
<div id="menuPanel" class="body">
<a class="gray" href="<%=PAGE%>?do=config" target="mainFrame">配置</a>&nbsp;
<a class="gray" href="<%=PAGE%>?do=left_frame">刷新</a>&nbsp;
<a class="gray" href="<%=PAGE%>?do=logout" target="_top">退出</a><br>
当前位置：<%=CURRENT_DIR%>
<div id="MainDIV" class="xtree" showButton="1" uid="<%=START_DIR%>"></div>
<div id="contextmenu" style="position:absolute; width:100px; z-index:1; display: none">
<div style="height:0px"></div>
<span id="menuzone" class="HighLight">
</span>
<div style="height:0px"></div>
</div>
<div id="detailDIV" style="position:absolute; width:125px; z-index:1; display: none">
<div style="height:0px"></div>
<span class="HighLight">
	<table border="0" width="100%" cellspacing="1">
		<tr>
			<td id="fileDetail">文件详细信息</td>
		</tr>
	</table>
</span>
<div style="height:0px"></div>
</div>
<div id="loaderDIV" style="position:absolute; width:200px; height:20px; z-index:2; display: none">
<iframe id="loader" scrolling=no frameborder=0 style="width:200px; height:20px;"></iframe>
</div>
<div style="height:36px"></div>
</div>
</body>
</html><%
}

function showMainFrame()
{
	showAuthorize("HTML");
	var wrap_word=(CONFIG["wrap_word"]!="checked")? " word-wrap:normal; overflow-x:auto;":"";
%><%=HTML_HEADER%>
<script language="JavaScript">
document.onkeydown=function(){return parent.leftFrame.keyHandler(window.event);}
</script>
<style>
textarea {line-height:<%=CONFIG["editor_line_height"]%>px; font-size:<%=CONFIG["editor_font_height"]%>px; font-family:'<%=CONFIG["editor_font_family"]%>';
width:100%; height:400px; <%=wrap_word%> overflow-y:auto; margin-top:-1px; margin-bottom:-1px; border: solid 1px #000000;
scrollbar-face-color:#F1F1F1; scrollbar-highlight-color:#F1F1F1; scrollbar-shadow-color:#F1F1F1;
scrollbar-3dlight-color:#FFC080; scrollbar-arrow-color:#000000; scrollbar-track-color:#F1F1F1;
scrollbar-darkshadow-color:#FFC080; scrollbar-base-color:#F1F1F1; scrollbar-width:10px}
iframe.previewer {font-size: 14px; border: solid 1px #000000;}
</style>
<body onLoad="initLayout()" onResize="initLayout()">
<form name="M" method="POST" action="<%=PAGE%>">
	<div id="INTRO">
	<font color="#FFC080" style="font-size:14px; font-family:arial black;">EditONE</font> (<%=CONFIG["version"]%>) <span id='publisher'></span>
	</div>
	<div id="EditorDIV" style="width:100%; margin-bottom:3px;">
		<textarea name='editor' onClick='getLineNum()' onKeyUp='getLineNum();' onKeyDown='editTab();'></textarea>
	</div>
	<div id="PreviewerDIV" style="display:none; margin-bottom:3px;">
		<iframe id='previewer' class='previewer' style='width:100%; height:400px;'></iframe>
	</div>
	<table border="0" width="100%" id="WorkPanel" cellspacing="0" cellpadding="0">
	<tr>
		<td width="1%"></td>
		<td width="38%"><input type="button" value="保存(Ctrl+S)" name="save" onClick="parent.leftFrame.saveFile()" style="width:180px"></td>
		<td width="36%"><input type="checkbox" class="checkbox" name="show_html" value="1" onClick="switchMode()">HTML预览</td>
		<td width="25%"><a class="gray" href="javascript:clearText()">清除</a> &nbsp; <a class="gray" href="<%=PAGE%>?do=main_frame">刷新</a> &nbsp; <span id="CurPosition"></span></td>
	</tr>
	<tr>
		<td></td>
		<td>查找： <input type="text" name="word_find" size="20"> <input type="button" name="findButton" value="查找下一个(F3)" onClick="findNext()"></td>
		<td>替换： <input type="text" name="word_replace" size="20"> <input type="button" name="replaceButton" value="替换" onClick="replaceNext()"> <input type="button" name="replaceAllButton" value="替换所有" onClick="replaceAll()"></td>
		<td><input type="checkbox" class="checkbox" name="match_case" value="1">区分大小写 <input type="checkbox" class="checkbox" name="match_whole_word" value="1">全字匹配</td>
	</tr>
	<tr>
		<td></td>
		<td>添加<a href="http://stat.gaya.cn" target="_blank">加雅统计</a>代码 - 站点号： <input type="text" name="gayastat_site" size="4"> <input type="button" name="InsertGayaStatButton" value="添加代码" onClick="insertGayaStatCode()"></td>
		<td></td>
		<td></td>
	</tr>
	</table>
</form>
<script>
function FindXY(obj){
	var x=0,y=0;
	while (obj!=null){
		x+=obj.offsetLeft-obj.scrollLeft;
		y+=obj.offsetTop-obj.scrollTop;
		obj=obj.offsetParent;
	}
	return {x:x,y:y};
}

function FindXYWH(obj){
	var objXY=FindXY(obj);
	return objXY?{ x:objXY.x, y:objXY.y, w:obj.offsetWidth, h:obj.offsetHeight }:{ x:0, y:0, w:0, h:0 };
}

function clearText()
{
	if (!isNeedSave||confirm("内容已被修改，确定要清除吗？")) {
		gotoEditMode();
		document.M.editor.innerText="";
	}
}

var editorText=null, isNeedSave=false;
function switchMode()
{
	if (editorText==null) { // in edit mode
		editorText=document.M.editor.innerText;
		EditorDIV.style.display="none";
		PreviewerDIV.style.display="block";
		editdoc=document.all("previewer").contentWindow.document;
		if (editorText.length>0) {
			editdoc.open();
			editdoc.write(editorText);
			editdoc.close();
		}
	}
	else { // in HTML preview mode
		PreviewerDIV.style.display="none";
		EditorDIV.style.display="block";
		document.M.editor.focus();
		editorText=null;
	}
}

function initLayout()
{
	IN=FindXYWH(INTRO);
	WP=FindXYWH(WorkPanel);
	EditorDIV.style.height=document.body.clientHeight-WP.h-IN.h-5;
	document.all("previewer").style.height=EditorDIV.style.pixelHeight-2;
	if (editorText==null)
		document.M.editor.style.height=EditorDIV.style.height;
	else
		document.all("previewer").style.height=EditorDIV.style.pixelHeight-2;
	//广告发布
	var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	with (xmlhttp) {
		onreadystatechange=function() {
			if (xmlhttp.readyState==4&&xmlhttp.status==200)
				eval(Bin2Str(xmlhttp.responseBody));
		}
		open("get","<%=PAGE%>?do=getad&tmp="+Math.random(),true);
		send();
	}
}

function gotoEditMode()
{
	if (document.M.show_html.checked) {
		switchMode();
		document.M.show_html.checked=false;
	}
}

function gotoPreviewMode()
{
	if (!document.M.show_html.checked) {
		switchMode();
		document.M.show_html.checked=true;
	}
}

function findNext()
{
	var word=document.M.word_find.value;
	if (word.length==0) return false;
	gotoEditMode();
	document.M.editor.focus();
	with (document.selection.createRange())
	{
		collapse(false);
		iFlag=0;
		iFlag+=(document.M.match_whole_word.checked)? 2:0;
		iFlag+=(document.M.match_case.checked)? 4:0;
		if (findText(word, 1, iFlag))
			select();
		else
		{ // Search from the beginning, if still cann't find any, popup a message box.
			moveStart("textedit", -1);
			if (findText(word, 1, iFlag))
				select();
			else {
				alert("文档搜索完毕。找不到下一处查找的字词。");
				return false;
			}
		}
	}
	return true;
}

function replaceNext()
{
	with (document.selection.createRange())
	{
		if (text.length==0)
			findNext();
		else {
			text=document.M.word_replace.value;
			move("character", text.length);
			select();
			findNext();
		}
	}
}

function replaceAll()
{
	gotoEditMode();
	var word=document.M.word_find.value;
	if (word.length==0) return false;
	document.M.editor.focus();
	with (document.selection.createRange())
	{
		collapse(false);
		iFlag=0;
		iFlag+=(document.M.match_whole_word.checked)? 2:0;
		iFlag+=(document.M.match_case.checked)? 4:0;
		n=0;
		while (findText(word, 1, iFlag)) {
			text=document.M.word_replace.value;
			n++;
		}
		parent.leftFrame.setStatus("已完成搜索并进行了 "+n+" 处替换。", "AUTO");
	}
	return true;
}

function getLineNum()
{
	document.M.editor.focus();
	s=FindXYWH(document.M.editor);
	rng=document.selection.createRange();
	nLine=Math.ceil((rng.offsetTop-s.y)/<%=CONFIG["editor_line_height"]%>);
	nColumn=Math.ceil((rng.offsetLeft-s.x)/<%=CONFIG["editor_font_height"]%>*2);
	CurPosition.innerText=nLine+"行,"+nColumn+"列";
	return true;
}

function editTab()
{
	var code, sel, tmp, r
	var tabs=""
	event.returnValue=false
	sel=event.srcElement.document.selection.createRange()
	r=event.srcElement.createTextRange()

	switch (event.keyCode) {
	case 37: case 38: case 39: case 40: event.returnValue=true; return; //isNeedSave is not modified.
	case 8 :
		if (!(sel.getClientRects().length>1))	{
			event.returnValue=true
			return
		}
		code=sel.text
		tmp=sel.duplicate()
		tmp.moveToPoint(r.getBoundingClientRect().left, sel.getClientRects()[0].top)
		sel.setEndPoint("startToStart", tmp)
		sel.text=sel.text.replace(/^\t/gm, "")
		code=code.replace(/^\t/gm, "").replace(/\r\n/g, "\r")
		r.findText(code)
		r.select()
		break
	case 9 :
		if (sel.getClientRects().length>1) {
			code=sel.text
			tmp=sel.duplicate()
			tmp.moveToPoint(r.getBoundingClientRect().left, sel.getClientRects()[0].top)
			sel.setEndPoint("startToStart", tmp)
			sel.text="\t"+sel.text.replace(/\r\n/g, "\r\t")
			code=code.replace(/\r\n/g, "\r\t")
			r.findText(code)
			r.select()
		}
		else {
			sel.text="\t"
			sel.select()
		}
		break
	default :
		event.returnValue=true
	}
	isNeedSave=true;
}

function insertGayaStatCode()
{
	document.M.editor.focus();
	with (document.selection.createRange())
	{
		collapse(false);
		moveStart("textedit", -1);
		if (findText("<head>", 1))
			text="<head>\r\n<scr"+"ipt>_time_stamp=(new Date()).getTime(); _site='"+document.M.gayastat_site.value+"';</scr"+"ipt>";
		else {
			moveStart("textedit", -1);
			text="<scr"+"ipt>_time_stamp=(new Date()).getTime(); _site='"+document.M.gayastat_site.value+"';</scr"+"ipt>";
		}
		if (findText("</body>", 1))
			text="<scr"+"ipt language='javascript' src='http://stat.gaya.cn/file/stat_client.js'></scr"+"ipt>\r\n</body>";
		else {
			//moveEnd("textedit", -1);
			//text="<scr"+"ipt language='javascript' src='http://stat.gaya.cn/file/stat_client.js'></scr"+"ipt>";
		}
	}
}
</script>
<script language="VBScript">
Function Bin2Str(ByVal sBin)
	Dim iI, iLen, iChr, iRe
	iRe=""
	If Not IsNull(sBin) Then
		iLen=LenB(sBin)
		For iI=1 To iLen
			iChr=MidB(sBin, iI, 1)
			If AscB(iChr)>127 Then
				iRe=iRe & Chr(AscW(MidB(sBin, iI+1, 1) & iChr))
				iI=iI+1
			Else
				iRe=iRe & Chr(AscB(iChr))
			End If
		Next
	End If
	Bin2Str=iRe
End Function
</script>
</body>
</html>
<%
}

function showFileList(dir, layer)
{
	showAuthorize("XMLHTTP");
	var space="";
	for (i=0; i<layer; i++)
		space+="  ";

	if (layer==1) {
	   Response.ContentType="text/xml";
	   Response.Charset=CONFIG["encoding"];
	   Response.Write("<?xml version=\"1.0\" encoding=\""+CONFIG["encoding"]+"\"?>\r\n<TreeNode>\r\n");
	}
	var in_parent=dir.match(/^[\.\/]+$/)? true:false;
	var abs_path=dir.charAt(0)=='/'&&dir.length>1? getRealPath("/")+'/'+dir.substring(1, dir.length):getRealPath(dir);

	try {
		var oFso=Server.CreateObject("Scripting.FileSystemObject");
		var oFolder=oFso.GetFolder(abs_path);
		for (x=new Enumerator(oFolder.Files); !x.atEnd(); x.moveNext()) {
			var oFile=x.item();
			var lenFile=oFile.size;
			Response.Write(space+"<TreeNode time='"+(new Date(oFile.DateLastModified).getTime()/1000)+"' length='"+lenFile+"' file=\""+(dir+oFile.name).replace(/&/g,"&amp;")+"\"/>\r\n");
		}

		if (in_parent)
			Response.Write(space+"<TreeNode time='"+"0"+"' file='"+dir+"../'/>\r\n");
		for (x=new Enumerator(oFolder.SubFolders); !x.atEnd(); x.moveNext()) {
			var oDir=x.item();
			var sDir=oDir.name;
			if (layer<1)
			{
				//time=date("Y-m-d H:i:s", filemtime(abs_path.sFile));
				Response.Write(space+"<TreeNode time='"+(new Date(oDir.DateLastModified).getTime()/1000)+"' file=\""+(dir+sDir).replace(/&/g,"&amp;")+"/\">\r\n");
				layer++;
				showFileList(abs_path+sDir+'/', 1);
				layer--;
				Response.Write(space+"</TreeNode>\r\n");
			}
			else {
				//time=date("Y-m-d H:i:s", filemtime(abs_path.sFile));
				Response.Write(space+"<TreeNode time='"+(new Date(oDir.DateLastModified).getTime()/1000)+"' file=\""+(dir+sDir).replace(/&/g,"&amp;")+"/\"/>\r\n");
			}
		}
	}
	catch (e) {}

	if (layer==1)
		Response.Write("</TreeNode>");
}

function showEditFile()
{
	showAuthorize("XMLHTTP");
	Response.ContentType="text/xml";
	abs_path=getRealPath(Request.queryString("file"));
	if (!(isExist(abs_path,false)&&(fp=fopen(abs_path, "rb")))) {
		reason="无法读取文件“ "+abs_path+" ”。".replace(/&/g,"&amp;");
		advice="请检查文件是否被锁定以及所在目录的读写性。";
%><?xml version="1.0" encoding="<%=CONFIG["encoding"]%>"?>
<File>
<Status>false</Status>
<Reason><%=reason%></Reason>
<Advice><%=advice%></Advice>
</File>
<%
		return;
	}
	var str=fread(fp,-1);
	var rand_num=(new Date()).getTime();

	str=str.replace(/(\]\]\>)/g, "]]"+rand_num);
	fclose(fp);
%><?xml version="1.0" encoding="<%=CONFIG["encoding"]%>"?>
<File>
<Status>true</Status>
<Content><![CDATA[<%=str%>]]></Content>
<CloseTag><%=rand_num%></CloseTag>
</File><%
}

function responseSaveFile()
{
	showAuthorize("XMLHTTP");
	Response.ContentType="text/xml";
	Response.Write("<?xml version=\"1.0\" encoding=\""+CONFIG["encoding"]+"\"?>\r\n");

	var str=Request.form("content")(1);
	file=getRealPath(Request.queryString("file"));
	if (!(fp=fopen(file, "wb")))
	{
		reason="无法写文件“ "+file+" ”。".replace(/&/g,"&amp;");
		advice="请检查文件是否被锁定以及所在目录的读写性。";
%>
<File>
<Status>false</Status>
<Reason><%=reason%></Reason>
<Advice><%=advice%></Advice>
</File>
<%
		return;
	}
	var len=str.length;
	fwrite(fp, str);
	fclose(fp);
%>
<File>
<Status>true</Status>
<SaveBytes><%=len%></SaveBytes>
</File><%
}

function downloadFile()
{
	showAuthorize("HTML");
	file0=Request.queryString("file")(1);
	file=getRealPath(file0);
	name=file0.substring(file0.lastIndexOf('/')+1,file0.length);

	try {
		s=Server.CreateObject("ADODB.Stream");
		s.Open();
		s.Type=1;
		s.LoadFromFile(file);
		if (s.Size>0) {
			Response.ContentType="application/octet-stream";
			Response.addHeader("Content-Disposition","attachment; filename=\""+name+"\"");
			Response.BinaryWrite(s.Read());
			return;
		}
	}
	catch (e) {
		if (isExist(file,false)&&(fp=fopen(file,"rb"))) {
			str=fread(fp,-1);
			Response.ContentType="application/octet-stream";
			Response.addHeader("Content-Disposition","attachment; filename=\""+name+"\"");
			Response.Write(str);
			return;
		}
	}
	Response.ContentType="text/html";
	Response.Write("<html><head><meta content='text/html; charset="+CONFIG["encoding"]+"' http-equiv='Content-Type'></head><body><script>alert('下载文件失败。\\n\\n原因：\\n无法打开文件“ "+name+" ”。\\n\\n建议：\\n请检查文件是否存在，并有读取权限。')</script></body></html>");
}

function renameFile()
{
	showAuthorize("XMLHTTP");
	Response.ContentType="text/xml";
	Response.Write("<?xml version=\"1.0\" encoding=\""+CONFIG["encoding"]+"\"?>\r\n");

	file0=Request.queryString("file")(1);
	isDir=file0.charAt(file0.length-1)=='/'? true:false;
	file=getRealPath(file0);
	name=Request.queryString("name")(1);
	if (rename(file,name,isDir)) {
%>
<File>
<Status>true</Status>
</File>
<%
	}
	else {
		oldname=file.substr(file.lastIndexOf('/')+1);
		destfile=isDir? file.substring(0, file.length-oldname.length)+name+'/':file.substring(0, file.length-oldname.length)+name;
		if (isExist(getRealPath(destfile),isDir)) {
			reason="无法重命名文件“ "+file0+" ”为“ "+name+" ”。目标文件名已存在。".replace(/&/g,"&amp;");
			advice="请更名为其他文件名或将文件“ "+name+" ”更名。".replace(/&/g,"&amp;");
		}
		else {
			reason="无法重命名文件“ "+file0+" ”为“ "+name+" ”。".replace(/&/g,"&amp;");
			advice="请检查文件是否被锁定以及所在目录的读写性。";
		}
%>
<File>
<Status>false</Status>
<Reason><%=reason%></Reason>
<Advice><%=advice%></Advice>
</File><%
	}
}

function newFile()
{
	showAuthorize("XMLHTTP");
	Response.ContentType="text/xml";
	Response.Write("<?xml version=\"1.0\" encoding=\""+CONFIG["encoding"]+"\"?>\r\n");

	dir=getRealPath(Request.queryString("dir")(1))+'/';
	name=Request.queryString("name")(1);
	type=Request.queryString("type")(1);
	TypeName=type=="dir"? "目录":"文件";
	content=Request.Form("content")(1);
	try {
		if (isExist(dir+name,(type=="dir"))) {
			reason="无法创建"+TypeName+"“ "+name+" ”。目标"+TypeName+"名已存在。".replace(/&/g,"&amp;");
			advice="请更名为其他"+TypeName+"名或将"+TypeName+"“ "+name+" ”更名。".replace(/&/g,"&amp;");
%>
<File>
<Status>false</Status>
<Reason><%=reason%></Reason>
<Advice><%=advice%></Advice>
</File><%
			return;
		}
		if (type=="dir") {
			fso=Server.CreateObject("Scripting.FileSystemObject");
			fso.CreateFolder(dir+name);
		}
		else {
			fp=fopen(dir+name,"w");
			fp.write(content);
			fp.close();
		}
%>
<File>
<Status>true</Status>
</File>
<%
	}
	catch (e) {
		reason="无法创建"+TypeName+"“ "+name+" ”。".replace(/&/g,"&amp;");
		advice="请检查"+TypeName+"是否被锁定以及所在目录的读写性。";
%>
<File>
<Status>false</Status>
<Reason><%=reason%></Reason>
<Advice><%=advice%></Advice>
</File><%
	}
}

function pasteFile()
{
	showAuthorize("XMLHTTP");
	Response.ContentType="text/xml";
	Response.Write("<?xml version=\"1.0\" encoding=\""+CONFIG["encoding"]+"\"?>\r\n");

	dir=getRealPath(Request.queryString("dir")(1));
	file=getRealPath(Request.queryString("file")(1));
	name=Request.queryString("name")(1);
	type=Request.queryString("type")(1);
	TypeName=type=="dir"? "目录":"文件";
	var destfile;
	try {
		if (file.substring(0,file.length-name.length-1)==dir) { //当前目录粘贴
			n=name.lastIndexOf(".");
			suffix=n>=0? name.substr(n+1):"";
			prefix=n>=0? name.substring(0,n):name;
			i=0;
			do {
				i++;
				destfile=prefix+i+'.'+suffix;
			} while(isExist(dir+'/'+destfile,(type=="dir")));
		}
		else
			destfile=name;
		fso=Server.CreateObject("Scripting.FileSystemObject");
		if (type=="dir")
			fso.CopyFolder(file,dir+'/'+destfile,false);
		else
			fso.CopyFile(file,dir+'/'+destfile,false);
%>
<File>
<Status>true</Status>
<FileName><%=destfile%></FileName>
</File>
<%
	}
	catch (e) {
		reason="无法创建"+TypeName+"“ "+destfile+" ”。".replace(/&/g,"&amp;");
		advice="请检查"+TypeName+"是否被锁定以及所在目录的读写性。";
%>
<File>
<Status>false</Status>
<Reason><%=reason%></Reason>
<Advice><%=advice%></Advice>
</File><%
	}
}

function deleteFile()
{
	showAuthorize("XMLHTTP");
	Response.ContentType="text/xml";
	Response.Write("<?xml version=\"1.0\" encoding=\""+CONFIG["encoding"]+"\"?>\r\n");

	file0=Request.queryString("file")(1);
	isDir=file0.charAt(file0.length-1)=='/'? true:false;
	file=getRealPath(file0);
	if (delete0(file,isDir)) {
%>
<File>
<Status>true</Status>
</File>
<%
	}
	else {
		reason="无法删除文件“ "+file0+" ”。".replace(/&/g,"&amp;");
		advice="请检查文件是否被锁定以及所在目录的读写性。";
%>
<File>
<Status>false</Status>
<Reason><%=reason%></Reason>
<Advice><%=advice%></Advice>
</File><%
	}
}

function getAD()
{
	var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),R="  ";
	with (xmlhttp) {
		onreadystatechange=function() {
			if (xmlhttp.readyState==4&&xmlhttp.status==200)
				Response.BinaryWrite(xmlhttp.responseBody);
		}
		open("get","http://editone.gaya.cn/ad2.php?tmp="+Math.random(),false);
		send();
	}
}

function showConfig()
{
	showAuthorize("HTML");
%><%=HTML_HEADER%>
<body>
<br><br><br><br><br>
<form method="POST" action="<%=PAGE%>?do=modify" name="F" onSubmit="return check()">
	<table border="0" width="100%" id="table1">
		<tr>
			<td width="220" align="right">　</td>
			<td><span lang="zh-cn"><b>参数设置</b></span></td>
		</tr>
		<tr>
			<td width="220" align="right">　</td>
			<td>　</td>
		</tr>
		<tr>
			<td width="220" align="right"><span lang="zh-cn">登录用户名　：</span></td>
			<td height="21"><input type="text" name="username" size="20" value="<%=AUTH_USER["username"]%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">登录密码　　：</td>
			<td><input type="password" name="password" size="20"> 留空表示不作修改。</td>
		</tr>
		<tr>
			<td width="220" align="right">再次确认密码：</td>
			<td><input type="password" name="password_again" size="20"></td>
		</tr>
		<tr>
			<td width="220" align="right">　</td>
			<td height="20">　</td>
		</tr>
		<tr>
			<td width="220" align="right">登录授权方式：</td>
			<td><select size="1" name="auth_type">
	<option value="cookie">Cookie认证</option>
	<option value="HTTP">HTTP BSAIC认证</option>
	<option value="session">Session会话</option>
	<option value="none">无授权验证(不安全！)</option>
	</select> 注意：以CGI方式安装的PHP不支持HTTP BASIC认证
	<script>document.F.auth_type.value="<%=CONFIG["auth_type"]%>";</script>
			</td>
		</tr>
		<tr>
			<td width="220" align="right">使用UTF编码 ：</td>
			<td height="20"><input class="checkbox" type="checkbox" name="use_utf" value="checked" <%=CONFIG["use_utf"]%>> 如在英文操作系统上编辑中文文件，请选中此选项。其他情况下使用缺省方式可加快编辑内容的保存速度。</td>
		</tr>
		<tr>
			<td width="220" align="right">本地编码　　：</td>
			<td height="20"><input type="text" name="encoding" size="20" value="<%=CONFIG["encoding"]%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">编辑器字体　：</td>
			<td height="20"><input type="text" name="editor_font_family" size="20" value="<%=CONFIG["editor_font_family"]%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">字体大小　　：</td>
			<td height="20"><input type="text" name="editor_font_height" size="20" value="<%=CONFIG["editor_font_height"]%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">编辑器行高　：</td>
			<td height="20"><input type="text" name="editor_line_height" size="20" value="<%=CONFIG["editor_line_height"]%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">用户电子邮件：</td>
			<td><input type="text" name="email" size="20" value="<%=AUTH_USER["email"]%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">使用自动换行：</td>
			<td height="20"><input class="checkbox" type="checkbox" name="wrap_word" value="checked" <%=CONFIG["wrap_word"]%>> 如一行超长，使用自动换行将自动折行显示，而不产生滚动条。</td>
		</tr>
		<tr>
			<td width="220" align="right"></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="220" align="right">　</td>
			<td><input type="submit" value="提交" name="B1">&nbsp; &nbsp; <input type="reset" value="重置" name="B2">&nbsp; &nbsp; <input type="button" value="返回上一页" onClick="history.back(-1)"></td>
		</tr>
	</table>
</form>
<script>
function check()
{
	if (document.F.password.value!=document.F.password_again.value) {
	  alert("两次输入的密码不相同。请重设。");
	  return false;
  }
  return true;
}
</script>
</body>

</html><%
}

function modifyConfig()
{
	showAuthorize("HTML");
	AUTH_USER["username"]=Request.form("username");
	if (Request.form("password")!="")
		AUTH_USER["password"]=MD5(Request.form("password")(1));
	AUTH_USER["email"]=Request.form("email");
	CONFIG["auth_type"]=Request.form("auth_type");
	CONFIG["encoding"]=Request.form("encoding");
	CONFIG["editor_font_family"]=Request.form("editor_font_family");
	CONFIG["editor_font_height"]=Request.form("editor_font_height");
	CONFIG["editor_line_height"]=Request.form("editor_line_height");
	CONFIG["use_utf"]=Request.form("use_utf");
	CONFIG["wrap_word"]=Request.form("wrap_word");

	var sStr,src;
	try {
		src=Server.CreateObject("ADODB.Stream");
		src.Charset=CONFIG["encoding"];
		src.Type=2;
		src.Mode=3;
		src.Open();
		src.LoadFromFile(getRealPath(PAGE));
		sStr=src.ReadText();
		src.Close()
		sStr=renewConfig(sStr,"AUTH_USER",serialArray("AUTH_USER"));
		sStr=renewConfig(sStr,"CONFIG",serialArray("CONFIG"));
		src.Open();
		src.WriteText(sStr);
		src.SaveToFile(getRealPath(PAGE), 2);
	}
	catch (e) {
%><%=HTML_HEADER%>
<body>
无法打开文件 “ <%=PAGE%> ”。请确认是否有读写此文件的权限。
<input type="button" value="返回上一页" onClick="history.back(-1)">
</body>
</html><%
		return;
	}
%><%=HTML_HEADER%>
<body>
<script>
alert("设置已生效！");
this.location="<%=PAGE%>?do=main_frame";
</script>
</body>
</html><%
}

function serialArray(name)
{
	var arr=eval(name);
	var str="var "+name+"=new Array();\r\n";
	for (i in arr)
		str+=name+"[\""+i+"\"]=\""+arr[i]+ "\";\r\n";
	return str;
}

function responseImageFile()
{
	//header("Status: 304 Not Modified");
	Response.ContentType="image/gif";
	Response.addHeader("Cache-Control", "max-age=2592000");

	var name=Request.queryString("file");
	var str;
	if (name=="expanded.gif")
		str="GIF87a%0B%00%0B%00%C4%00%00%04%02%04%7C%9A%B4%D4%CE%BC%EC%EA%E4%DC%DA%CC%C4%B6%A4%B4%C2%D4%DC%D6%CC%F4%F6%F4%DC%D2%CC%C4%BE%AC%D4%D2%C4%F4%F2%EC%E4%E2%DC%C4%BA%A4%D4%CE%C4%EC%EE%E4%DC%DA%D4%CC%CA%BC%FC%FE%FC%C4%BA%AC%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%0B%00%0B%00%00%054%E0%24%8E%A4h%04h%1A%18bP%B6p%89%B8S%80%DC7%D4%D06%E0%FB%11%1E%03%02%19%0C%1A%09%5E%23%B2hJ%24%3C%89%A2%40-Ph%27%15%8A%F5%2A%85%00%00%3B";
	else if (name=="collapsed.gif")
		str="GIF87a%0B%00%0B%00%C4%00%00%04%02%04%7C%9A%B4%D4%CE%BC%EC%EA%E4%DC%DA%CC%C4%B6%A4%B4%C2%D4%DC%D6%CC%F4%F6%F4%DC%D2%CC%C4%BE%AC%D4%D2%C4%F4%F2%EC%E4%E2%DC%C4%BA%A4%D4%CE%C4%EC%EE%E4%DC%DA%D4%CC%CA%BC%FC%FE%FC%C4%BA%AC%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%0B%00%0B%00%00%057%E0%24%8E%A4h%04h%1A%18bP%B6%B0%08%88%88%3B%05H%0E%20Pc%E3%80%600%F2c%40%20%80F%E3%F0kD%16%80%85D%F2%93%28%0A%D8%02%C5vR%A1X%AFR%08%00%3B";
	else if (name=="endnode.gif")
		str="GIF89a%0B%00%0B%00%B3%00%00%00%00%00%DF%DF%DF%D6%D6%D6%FF%FF%FF%19%19%19%EF%EF%EF%0F%0F%0F%F8%F8%F8%21%21%21%E6%E6%E6%07%07%07%FE%01%02%00%00%00%00%00%00%00%00%00%00%00%00%21%F9%04%01%00%00%0B%00%2C%00%00%00%00%0B%00%0B%00%00%04%22%90%A0I%2A1F%A1%C1%7B%D7%5E%08%86%1D%40%90%E5Yz%26%CA%B5.%60%B8%83L%03J%0E%EC%FC%1E%01%00%3B";
	else if (name=="folder_close.gif")
		str="GIF87a%12%00%12%00%D5%00%00LNL%DC%AAD%9Cf%04%B4%86%1C%FC%D6l%D4%D6%D4%ACv%14%C4%96%2C%FC%F6%8C%CC%CA%CC%BC%8E%24%EC%BET%9Cn%04%AC%7E%14%84%82%84%FC%E2%7C%F4%F6%F4%D4%A2%3C%BC%86%24%CC%964%FC%FE%9C%C4%8E%2C%FC%CEd%A4n%0C%B4%7E%1C%FC%EA%84lnl%E4%B2L%9Cj%04%DC%DE%DC%ACz%14%FC%F6%94%FC%C6d%8C%8E%8C%FC%E6%84%FC%FE%FC%BC%8A%24%CC%9A4%C4%92%2C%A4r%0C%B4%82%1C%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%06%A0%C0%91pH%2C%1A%8F%C8a%A94%99t%20Ia%89XI%40%91S%8A%962%22I%24%28%14%E6%A9%FC%20%CE%E7%22%26%D4%19N2%22%D3%C4%247U%BCaT%7B4yT%92%22%23%27%21B%26%04%25%5B%89Z%20%14%17%1AB%15%16%13%14%1F%95%96%95%0B%8D%8F%23%91%26%14%19p%22%22%A0%19%1B%14%1C%9B%24%16%15%1F%0F%AE%AF%04%0F%01%A7%9B%12%16%12%14%04%BA%BB%BA%11%14%02%9B%1D%60%18%18%1E%06%06%27%17%CA%02%02%00%0EB%10%09%0E%1A%D4%D5%D6%1A%0E%09C%10%1D%05%DE%DF%E0%05dQ%E4%E5CA%00%3B";
	else if (name=="folder_open.gif")
		str="GIF87a%12%00%12%00%D5%00%00dfd%D4%BAD%FC%DE%7C%DC%DE%DC%B4%8A%1C%BC%BA%BC%F4%F2%8C%EC%BAD%CC%A2%24%FC%FA%94%A4r%0C%E4%BET%F4%E6%7C%FC%D6l%F4%F6%F4%BC%9A%2C%FC%F2%8C%8C%8A%8C%D4%D2%D4%DC%B2D%FC%FE%A4%9Cz%1C%DC%BEl%FC%E6%84%FC%D6%84%FC%FE%FC%C4%9A%1C%FC%F2%9Ctrt%CC%BE%5C%FC%E2%7C%C4%C6%C4%FC%C6%5C%FC%FE%9C%E4%C2T%FC%D6t%FC%FA%F4%FC%F6%94%E4%B2D%A4%7E%1C%FC%EA%84%C4%9E%1C%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%06%93%C0%8CpH%2C%1A%8F%C8%21b%89%18%90%92B%04Q%F3y%225%99%906%94%D1x%BF%03%C7PS%82%98%CDE%CD%E9%23%EE%A2D%DFx%9C%F0%11j0%1A%0B%12%959E%EC%0D%1A%10%5B%84%21%20%25%15%1Cv%26%08%21%09%25%8F%91%25%07%1D%0A%8A%5D%08%01%21%28%9C%9D%28%17%07%1A%00%7F%5D%1A%0C%21%1E%A9%AA%1E%02%13%15%00%05v%1A%21%0D%B5%B6%B6%0F%96%12B%03%0A%BE%BF%C0%BE%A3%03B%0E%1F%11%1C%C9%CA%CB%11UC%24%03%12%D2%D3%D4NP%D7%D8EA%00%3B";
	else if (name=="pic.gif")
		str="GIF87a%12%00%12%00%F7%00%00l6%2CD%A6%F4%A4%AA%B4%A4%D2%FC%B46%14%F4%D6%7C%B4%7ETdn%7C%D4%9Et%D4%EA%FC%7C%86%94%84%9E%C4%F4n4t%B6%EC%94%9E%C4%A4%BE%EC%8C%92%9C%EC%86%3C%DC%BA%84%EC%EE%F4%BC%BE%CC%D4%D2%DC%8C%AA%CC%9C%8E%AC%F4%8A4%CC%3A%1C%BC%DE%FC%A4%86%94t%A6%DC%F4%FA%FCTbt%8C%7E%A4%A4%CA%F4%F4%BEd%D4%DE%ECD%92%E4%FC%AAT%AC%B2%F4lj%BC%E4%EA%EC%94%A6%D4%7C%8E%C4%DC%92T%EC%F6%FC%C4%CA%CC%9C%AA%D4%94%9A%A4%FC%96L%ECZ%2C%84%AA%D4%E4%E6%EC%AC%B2%BC%B4%DA%FC%A4b%2C%FC%E6%84%BC%8A%7Ct%82%B4%EC%824%B4%C6%F4%E4%C6%84%FC%86T%C4%E2%FC%AC%92%9C%9CZ4%DC%E6%EC%FC%AET%E4%9ATdB%2C%AC%D2%F4%FC%DE%9Clv%84%84%A2%D4%FCv4%94%C6%F4%9C%A2%CC%AC%BE%EC%F4%F2%F4%94%AE%CC%FC%8ED%DCJ%24%7C%A6%DC%FC%FA%FC%5Cbt%94%82%AC%B4%CA%F4%FC%CEt%DC%DE%E4%E4%F2%FC%8C%8E%BC%E4%92%5C%BC%CA%F4%94%96%C4t%8A%BC%AC%96%AC%C4%9E%94%B4%3A4%F4%DA%7C%B4%82tdr%8C%D4%A2%7C%DC%EE%FC%84%9E%CC%94%9E%CC%8C%92%B4%E4%C2%7C%EC%F2%F4%BC%C2%C4%D4%DA%E4%8C%AA%DC%9C%92%C4%F4%8E4%D4B%1C%CC%D6%FCt%AA%E4%8C%82%B4%A4%CE%F4%FC%C2d%FC%9E%7Cl%7E%AC%E4%EA%F4%9C%A6%D4%7C%96%CC%DC%92d%F4%F6%F4%9C%AE%DC%EC%5E%2C%84%AA%DC%B4%B6%BC%BCb4%C4%92%7C%5CBD%FC%B6%5C%EC%CA%7C%B4%96%94%CC%E6%FC%9C%CA%F4%7C%8A%B4%AC%D6%FC%AC%C2%F4%DC%E2%EC%FC%FE%FC%5Cft%BC%CE%F4%94%9A%C4%FCv%3C%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%08%FF%00%F7%EC%892P%60%C1%82%04%09%16%F4%C3%86aC6G%FC%C88%A8p%0F%1BF%183Fa%D3%40%8C%805L%06%12%BC%98%11c%87%00%01F%28%A00Q%60%14%3FQ4vH%03%07N%09D.%2ATd%B3%A7%0E%03%24NH%D0%B9B%26%81%16%23%14D2a%C3%84%07%20H%2F%06%15%A9B%A2%89%16%29%7F%14%BEd%F2%05%00%81%0Co%60%C0x%B2%40%8B%87%19L%12%FA%99%90%E5G%8D%1C%18%E8%60%88%60A%87%87%3F%22%F7%1C%990%C6%C0%10%15Y%0A%80%D1%13%C3%EE%8C%8Aedx%B9%21%28%0C%82%1D%84%02A%D1%21e%86%CB%3Dy%80t%F9%60b%03%1A%1B6%0AqPt7%AD%C0%14V%B6%C8%913%C5%87%044%17%E2%2C%A9%AC%95%8B%88%04D%88%808t%28I%929K%CE%26%DC%83c%8D%21C%3Dzh%A0A%23%D1%80%07%95%11%DAi%81%07%8F%19%25%8F%1Em%D9%82%05%CB%81%AC%05Y%40%128%E0A%8A%87%F2%E8%0F%40%60aP%EBe%8A%97%03%02%00%3B";
	else if (name=="rar.gif")
		str="GIF87a%12%00%12%00%E6%00%00%04%02%04%04%82T%84%02L%84%82%04%1CN%04%C4%C6%1CT%02%04%84%CA%FC%04%DE%94%ECZ%B4T%12%1C%C4%C6%CC%04%3Ed%FC%86%D4%5C%BA%FC%9C%0Ad%8C%EE%CCl%12%24%04V%94%A4%A2%A4D%E6%AC%146%04%94%02%5C%7C%02L%FCn%CC%FC%FA%FC%04b%B4T%B2%FC%BC%BA%04%04fD%9C%D6%FC%5C%1E%04%FC%BE%F4%04V%A4%24%26%24%04%8A%5C%8C%02T%94%92%04%2C%E2%A4d%16%1C%DC%DA%E4%FC%96%DCl%BE%FC%B4%E6%FCl%1A%24t%EA%C4t%0A%3C%FCz%D4%04%86T%84%02TDBD%D4%D2%04T%0E%24%8C%D2%FC%14%DE%9C%F4b%C4%5C%16%1C%CC%CE%D4%04N%8C%A4%12lt%16%2C%04V%9C%AC%AE%B4%5C%EA%BC%042T%94%0A%5C%7C%06D%FC%FE%FC%04rL%A4%DE%FC%04Z%A4%2C%2A%2C%94%96%04%FC%A2%E4t%C6%FC%BC%F6%E4%FC%7E%D4%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%07%D3%80C%82%83%19C%19%85%85%83%83%0A8%27%27%8D%8E%27%1188%1F%8AC%13%0A%2CH3%25%2C%3C%11%A0%A0%0A%97%0B%0A%17%253H%17%02%AC%17%17B%A4%82%3EC9%0A%0F%3B%B8%BA%B9%161%27%82%229C%0B%02C%20I%29%0D%2F%2F%187%098%82%13%00%28C%11%05%24%D8%D9%D8%02%06%83%0B%D38%03%06%E3%E4%E5%B3%B5G%00%EA%EB%EC%00%83%C1%C3%1AC%2B%1E%1E5JJ%2A%0E%1B%40%D1%D3C%21%0A%84%18%D8%23D%8F%1E%3A%24%B8%13%F4%0D%85%8E%01%0C%22J%94%D8o%08%AD%1C%E9%DA%B5%1BtD%D8%82%00C%96%40h%F1%E3%07%05%136%10T%E0H%8D%08%87%110b%CA%84%11%60%A1%A0%23%28%3A%0C%20%C0%B3g%CF%95%8Adh%DCx%A9%A8%D1%21%81%00%00%3B";
	else if (name=="source.gif")
		str="GIF87a%11%00%12%00%D5%00%00lnl%D4%BEL%DC%DE%DC%AC%92l%B4%B6%B4%B4%CA%CC%84%86%84%EC%F6%F4%94j4%D4%D2%D4%94%92%94%C4%CA%CC%BC%C2%C4tvt%EC%EA%DC%9C%A6%A4%F4%FA%F4%84jD%BC%B6%D4%8Czl%C4%CE%DC%F4%EA%DC%BC%AA%94%BC%BE%BC%BC%D2%D4%AC%AA%AC%FC%FA%FC%A4%86%3Ctrt%BC%B6%BC%BC%CA%DC%E4%D6%BC%CC%CA%CC%C4%C6%E4%F4%EE%EClrt%E4%E2%E4%BC%9EL%7Cz%C4%F4%F2%F4%DC%DA%DC%9C%9A%9C%C4%CE%D4%C4%C2%CC%7C%7E%7C%EC%EA%EC%A4%A6%A4%F4%FA%FC%84nl%94%7Ed%CC%CE%E4%F4%EE%DC%AC%AE%AC%FC%FE%FC%9C%82%5C%BC%BA%BC%BC%CE%D4%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%11%00%12%00%00%06%8F%C0%9ApH%2C%1A%89%8E%E4G%A41jJ%01%C4%26%10%0B%C0l%A8%26Qf2%21%2C%13%C9%A0c%CB%90%8A%A6P%E4%B0%8Eh%225%CE%99h%2A%1C%EE%F7%97%90%23%40%E3%F0%07%2FZ%7C%7E-%2C%87%17zq%7Dt%7F%80%83%8CC%26%7F%87%88%7B%91B%93%80%82%97h%1E%07%0D%95%17%9Dt%9Fx%10%8A%84%A5%07%2C7%81%8A%23%985u%80%0B%17.%0A%29sC%27%0C%0F%06%00%00%0D%06%0A.%20%22F%24747%20%09%02%24-%27G%D4EA%00%3B";
	else if (name=="media.gif")
		str="GIF87a%12%00%12%00%F7%00%00%04%0Ed%5C%8Al%9C%A6%1C%EC%C64%F42%14DVd%A4%C6%F4%D4%D2%DCd%C6d%A4%AA%B4Db%A4D%92%E4%DC%EA%FC%7C%8E%A4%FC%9A%8C%7Cv%2C%CC%AA%BC%84%AA%DCT6D%BC%D6%F4%2C2%3C%EC%EA%EC%A4%BA%DC%84%9A%CC%5C%7E%C4%2C%3A%84%8Cbd%BC%C6%DCTn%8C%EC%F6%FC%FC%D6%CC%9C%AA%E4lv%84%CC%AE%14tj%2C%D4%DE%F4%7C%9E%C44FTTbt4n%F4%C4%DE%FC%FCzddz%84%FC%FA%FC%84%EA%84%8C%AA%DCD%A6%F4%D4%FA%FC%8C%92%9C%CC%DA%EC%B4%C2%EC%84zt%BC%C6%E4dn%7C%EC%FE%FC%A4%B2%DC%E4%E6%EC%1C%22%2C4%A64%EC%8A%7C%B4%D2%F4%94%C6%BCTb%A4%2C%3ED%AC%C2%E4%D4%E6%FC%5Cf%8C%94%B6%E4%BC%9A%1C%B4%C6%F4l%DEt%AC%B2%BC4b%E4%5C%96%DC%E4%F2%FC%BC%BE%C4%2C6L%94%9A%EC%7C%86%94%F4%F6%F4%D4%BAt%3CJ%5C%5Cbt%84%82%8C%BC%CE%F4D%9ED%DC%C6%84%ECR%3CT%5Et%DC%DA%DCT%CET%E4%EA%F4t%92%BC%FC%B6%AC%C4%D6%F4%2C6%3C%EC%F2%FC%AC%BE%EC%7C%9A%F44JlTv%8C%AC%AE%FC%EC%C2%0C%DC%DE%E4%94%9A%A4Lz%C4%8C%8E%B4%CC%D6%FCdr%8C%A4%B6%F4%1C%26t%94%BE%EC%B4%B2%B4%BC%C2%C4%F4%FA%FC%5Cfl%04%12l%A4%A6%2C%EC%D6%1C%F4%3E%24LZl%A4%CA%EC%D4%D6%DC%3C%5E%BCT%8E%FC%7C%8A%B4%FC%A6%94t%B6%EC%7CFL%94%FA%94L%9E%7C%5C%9E%FC%3C%B6%3C%7C%82%8C%DC%BA%1C%94%B2%FC4F%94l%7E%ACd%92%FC%BC%96%3C%84jt%E4%FA%FC%7C%86%B4%C4%CA%CC%5Cr%7C%84%A2%D4d%82%7C%94%A2%AC%9C%AA%FC%A4%BE%EC%CC%E2%FC%84v%84%BC%CA%F4%AC%B2%F4%F4%F2%F4%3Cn%F4%F4%FE%FC%AC%C2%F4%DC%E6%FCdr%84%1C%264%BC%D2%ECT%D2%5C%E4%EE%FC%B4%B6%BC%BC%DA%F4%D4%E2%F4%FC%FE%FC%94%BA%E4%B4%CA%F44f%E4%84%86%8C4F%5C%FCzl%CC%DA%F4%BC%BE%CC%F4%F6%FC%3CJd%2C6D%8C%8E%BC%5Cft%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%08%FF%00%9F%3CY1%10%16AXr%60%0D%5CH%90%E0%93%16%11%20J%8C%D4b%CB%139%02%09jZ%11%E1%D4%299%09%3B%80%89%F0%87M%823%9A2%3E%5C%C1%29%24%18%25.%5C%2Cp%B2%04%C7BX-%12%82%D9%A9d%D4%9A5%99%1C%A19%D0%F0%09%97%29%8Cf%04%90%84%26%06%83%20A0%81%88%B3%10%0E%A3%1D%7E%BA%04b%81%40%D2%86%20%96%A8%D0%3ABP%8F%86%14%0E%3Ch%1A%D1%C3%88%16HT%2Ca2%01G%CE%8A%29WZ%BD%E0a%A9Q%90%26%A2%AA4%40%91J%CA%11%81%80%EE%40%98%80%21%CD%85Je%04%11%2A%C0%23%15%168%02%25%10%08S%04%11%00%00%3E%28%91%D1%F1%25O%11%C3%2BV%8C9Q%C4U%067%89n%1C%BA%24%80%02%AAN%26%0E%C3%AA%81D%CC%29%0B4N5j%B3%88H%89%21%9DP%3F%81%B3%87%CF%04%8F%9CLA1%24%82%03%AAJ%97%0Dn%29%94d%90%A2%0FV%06%D84%A9%C3%8A%84%81J%863f%89%A5%40%D5%263%21%1E0%11%E2H%8D%9A%1A%A4R%0B%5C%22%85B%8E%FF%B2D%81%07%16X%D4%00%C3%23%2A-%A4%A0C%0C%3E%11%10%00%3B";
	else if (name=="search.gif")
		str="GIF87a%12%00%12%00%E6%00%00LNL%CC%AED%B4%EA%FC%9Cj%04%F4%D6l%D4%AAD%DC%DA%D4%BC%8A%24%AC%AA%AC%B4%C6%C4%E4%EE%F4%AC%8A%94%AC%82d%FC%F6%8Clnl%CC%C6%CC%A4z%14%DC%C6%94%CC%964%B4%EE%FC%FC%FA%D4%FC%E2%7C%84%5E%14%B4%7E%1Cdbd%BC%C6%DC%CC%9A4%CC%FA%FC%EC%BET%E4%E2%E4%B4%B2%B4%A4%C6%DC%FC%C6d%F4%F2%F4%5CN4%FC%D6l%B4%8ET%DC%FE%FC%9Cz%3C%F4%EA%94%AC%CE%E4%D4%D6%D4%DC%DA%EC%C4%92%2C%FC%FE%9C%94%8A%84%CC%CE%B4%AC%82%1C%C4%F2%FC%B4%86%1C%DC%9E4%BC%BA%AC%F4%FE%FC%A4r%0C%E4%B2L%DC%DE%DC%A4%A2%A4%FC%EE%AC%7Cz%7C%ACz%14%EC%CA%7C%D4%92%5C%FC%E6%7C%BC%D2%DC%D4%9E%3C%D4%FE%FC%FC%BAT%FC%D2l%5CZ%5C%FC%D6%7C%EC%FE%FC%B4%D2%E4TVT%CC%B6%8C%C4%EA%FC%EC%DE%7C%DC%AAD%DC%DA%DC%C4%8E%2C%9C%B6%DC%EC%EE%EC%A4%82%8C%FC%F6%94trt%CC%CA%CC%DC%CA%94%BC%EE%FC%FC%FE%DC%94f%04%B4%82%1Cdft%CC%9E4%D4%F6%FC%E4%E6%E4%B4%B6%B4%B4%CA%DC%F4%F6%F4dR%2C%FC%DAt%E4%FE%FC%FC%EA%84%AC%CE%EC%D4%DE%EC%C4%96%2C%C4%CE%CC%C4%F6%FC%BC%86%24%BC%BE%BC%FC%FE%FC%ACv%14%B4%A6%94%AC%7E%14%DC%8EL%FC%E6%84%C4%CE%EC%FC%BET%F4%CE%84%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%07%EA%80%60%82%83%82l%83%86%85%84%88%84%8C%87%82%12%1A%12%12%1D%89%60%8B%83%40l%9AlNT%8D%96%82%1Al%2C%A4%2Cl%071jYY%17%94%83%1ARR%27ke%28%19%2A%9Bo%0E%AE%60%12d%04-%02%13V4f%24%07%AA%17%03%06%8F%15%05%1FA%1BiJ%5Cr%9A%3EKXD%82%2BC%07Gcc%25%C3%3F%A4%20%01%16%00%DC6%40_l4ci%02.%B1%1C%3B%22S%82N%2Bt%0F%0AF%25%AC%3C%89%10%87%0C%907%00%3C%08R%E3%84B%8E%2Ah%12%CCp%D3C%C8%88%1D%16%884Y%C8%84B%91%21%23%86%0C%A1%13%05%8E%90%1Aatt%11%94D%CD%85%0B%3B%DA%B4%A9Q%C3DI%19%00%10%84%10%04%05%07%06%24%40%83%22%D1%12%85%01%92%8D%83%A0tX%CAti%13%0F%0E%A6%F0%02E%15%11%9B%10%5D%28%5D%FA%C45%10%00%3B";
	else if (name=="script.gif")
		str="GIF87a%12%00%12%00%B3%00%00%04%02%04%04%82%04%84%82%04%FC%FE%04%C4%C2%C4%04%02%84%04%FE%04%F4%F6%F4%04%82%84%84%82%84%04%02%FC%FC%FE%FC%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%04%7D%F0%C8I%2B%5D%27%E9%CD%EFLK8%84%CB%A0YYI%8E%0B%98LX%2Ab%25%60%03%158%12HO%1C%03%02.%96%3A%F0%0C%88%00%82%B0%10%E6%04PAB%91L%04q%13%28%60%00%10%D8%0A%8AB%13%2B%11%0C%CEgo%B8p%3D%60%A0%03%AF%F9%06%60%3A%CBg%40b%1B%AF%97%EE%07pr%5C6%2C%80%0Bfh%7D%2BN1%5D%5B%8F%04%92%93d%13t%9770%121%9C%9B%9E%28%A0%13%11%00%3B";
	else if (name=="htm.gif")
		str="GIF87a%12%00%12%00%E6%00%00%2C%3E%5C%2C%A2%EC%9C%AA%BC%1Cr%9C%B4%DA%EClr%9C%7C%CE%FCt%A2%CC%DC%EA%FC%24%8A%C4%9C%C2%D4TR%84L%8A%B4%3C%BA%EC%D4%D6%D4l%C2%E4%2C%96%E4%F4%F6%F4%B4%C6%ECL%A6%E4Ln%8C%1Cb%9C%7C%7E%A4%7C%AE%C4%BC%BE%BC%E4%F2%FC4%96%EC4%B6%F4%A4%BA%CC%3Cz%B4%BC%DE%FC%84%A2%D4%CC%E6%FC%BC%CE%E4%3C%A2%DC%5C%96%BC4%8A%CC%AC%D2%ECdb%94%24Fd%C4%D6%FC%EC%EE%EC%5CZ%8CD%96%E4%84%B6%D4%FC%FE%FC4%5E%8C4%9E%EC%9C%B6%DC%C4%D2%F4dn%9C4%AA%DC4r%B4%BC%DA%FCt%82%B4l%F2%FCt%AA%DC%E4%EE%F4%AC%C6%E4T%96%C4%3C%CA%FC%CC%D6%FC%24%9E%E4%F4%FA%FCT%A6%E4%94%92%94%EC%F2%F4%3C%9A%ECL%82%AC%84%AA%DC%D4%EA%FC%B4%CE%FC4%92%DC%2CF%5C%A4%B6%DClj%94%A4%B2%BC%BC%D6%E4tz%A4%7C%A2%C4%DC%EE%FC%24%92%D4%A4%C6%E4TV%84L%8A%C4L%C2%FCl%C6%EC%F4%F6%FC%BC%CA%FCD%AA%FC%2Cn%AC%7C%82%ACt%B2%DC4%9A%ECDz%A4%C4%E2%FC%CC%EA%F4%3C%AA%F4t%96%B44%8E%DC%AC%CE%FC%24Fl%5C%5E%8C%94%B6%D4Df%8C4%AA%F4%2Cz%C4%94%EA%FC%CC%DA%FC%2C%9E%E4%EC%F6%FC%8C%AA%DC%B4%D2%F4%A4%BA%E4lj%9C%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%07%FC%80W%11%82%84%85%85%11-%11%88%8AooE%8D%8F%1F6%0E%29%87%83o-%99%9A-6%07%18%95%8A%83%11%98-BM%2C%2C%046X%2B%9F%82%89WE%3B%23%B4%23-%0D2rr%16A%8A%82%0A%23k7%3C%0D%3B-%0F9WX%BC%BE%C0%603%09%09%3EmD-nnXN%BD%119%23%11%17%03R-jYcb%089X%05%DB%DE%17iQ%13%40c%1AY%5E%21%08G2AWW-%17U%3E%2A%08%1C%88%26%84%91%23fz%5Dab%20%0D%84%0AR%40H%94%A8%03%C4%91%29%DB%18%88%E8%A0A%83%16%29%24B%A2%81%F3%85%0CFE%0C%040%D1%D21%CC%83%07%00%CE%10%F0%40f%C16%03OZ0pQ%E6%04%00%0A0b%F4%60Ss%5B%0488p%F4%88%A3D%02%0A%14l%D8%A00%B9MP%04%15%2A%A6d%D5%3A%85%AB%8A%5E%89%16%05%19K%B6%ECX_hE%A9%B5%2A%28%10%00%3B";
	else if (name=="config.gif")
		str="GIF87a%12%00%12%00%F7%00%00D%3AD%D4%9E%0C%B4%D6%F4dn%7C%DC%DA%B4%94%9E%A4%9Cn%2C%DC%D2%BC%DC%EE%FC%CC%BA%94%DC%A6%1C%F4%EE%DC%84%86%8C%C4%EE%FC%94N%14%8C%BE%ECdZD%AC%96l%DC%FE%FC%BC%9EL%D4%BE%A4%AC%8A4%8Czl%AC%AA%AC%CC%D2%EC%EC%BAD%8C%96%9C%EC%EA%E4%D4%FE%FC%BC%B2T%E4%E2%CC%BC%C6%CC%F4%FE%FC%D4%EE%FCTZltn%A4DRdlz%84%A4%AA%B4%A4z%2C%DC%F2%F4%94%86%84%C4%8A%0C%E4%E6%E4%5Cft%BC%DE%F4%BC%B6%CC%E4%B2%3C%CC%EE%FC%EC%F6%F4%D4%CA%8C%B4%B2%D4%CC%E6%F4%F4%C2T%CC%B2l%DC%DE%DCT%3E%2C%CC%9E%2C%A4%A6%AC%A4nD%F4%F2%F4%8C%8E%9C%B4%B6%D4%B4%AET%7C%7E%8C%B4%AE%AC%D4%D2%E4%94%9A%A4%FC%FA%F4%C4%C2%C4%E4%CE%A4%E4%DE%DC%C4%D2%D4tnt%FC%D2t%9C%9E%AC%ACn%14%E4%EA%EC%E4%AAD%84%8A%94%9CZ%1C%B4%96%2C%AC%AE%AC%F4%BEL%94%92%94%EC%F2%FC%C4%BAd%CC%CE%D4%D4%F2%F4%5C%5Edtz%84%E4%F2%F4%CC%92%0Clfd%BC%BA%D4%CC%F2%F4%EC%FE%FC%DC%CA%AC%5CFL%D4%AED%F4%F6%F4%84%82%84%FC%FE%FC%B4%DA%F4%A4n%24%DC%DA%DC%DC%A6%2C%84%86%94%C4%F2%FC%9C%CA%ECd%5ED%A4%96%A4%E4%FE%FC%BC%A6%7C%CC%D6%EC%EC%EE%EC%C4%B6%5C%C4%CA%CCT%5ElLN%5C%A4%AE%B4%AC%824%DC%F2%FC%94%8E%94%C4%8E%0Cdj%7C%BC%E2%F4%BC%BA%C4%EC%B6%3C%FC%E2%B4%CC%AAT%C4%BE%7C%CC%A6D%A4b%0C%5CB%3C%B4%BE%D4%B4%96D%F4%C6d%E4%EE%FC%94%96%A4%D4%CA%9C%84%82%94%D4%D6%DC%E4%E2%E4tr%7C%9C%A2%AC%EC%F6%FC%DC%DE%E4%FC%FA%FC%AC%AE%B4%F4%BET%D4%F2%FCtz%8C%CC%F2%FC%F4%F6%FC%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%2C%00%00%00%00%12%00%12%00%00%08%FF%005%91%A1%A4%A9%20%11%1ED%0Aj%A24%90LC%22ddx%18D%A0%83%0C%3At%7E%14lHF%13%11%0C%16%2A%A4%882%22%C2%9B8%88%1A%FDY%C1%C3%23D%1FBl%08%093c%C1%01%22%1BthH%C3%A3%A3%C0%19%5B%10%08E%60%A6%E8%86%12%0C%AE%CCA%08q%06%0A%10%20%24U1%13%28%0C%83.%84%128%EA%E9p%06%02%14%21%84RR%93%E8%82%1B%05%88%82%A4i%E8%14%0C%18%10f%94%D4%28%0B%81O%801%1F%20%92%F1%DA%E2L%0B%04L%2Ce%10%94G%05%9F%13e%C84%C5%D2%E6%81%00%01%14%A6%BCx%A1%40A%0E%1C%906%CE%08%E1%C7%2F%0D%24%85v%00B%03%C5%C0%9D%3DD%16%7F%81%01C%00%8DC%08%1C%E0%00%20%26I%11%81%7BadjpI%CF%5B%B8%8B%B2%ECQK%29%E1%8C%2F%0D%1AH%80%E3%16%EA%12%20E%8E%CC%E9%B87%13%07%0E%CB%99%BF%D5%D0%C3%D1t%86D%7C%AC%29%90%B4%E2%03%9E%21%25%FA%90%E8%A3c%12%0F%86%0C%27Eb%21%C2%CE%00LO%0AT%AA3i%0EC%87%FF%05%08%E0%80%0D%05%04%00%3B";
	else if (name=="default.gif")
		str="GIF89a%12%00%12%00%A2%00%00%FC%FE%D4%C6%C6%C6%84%84%84%00%00%00%FF%FF%FF%00%00%00%00%00%00%00%00%00%21%F9%04%05%14%00%04%00%2C%00%00%00%00%12%00%12%00%00%03HH%B2%DC%F4%F0%09%40%2B%15%23%C2%19%3A%F0S%A6MV%40%0D%A8%B8%7D%9EY%05%AAd%7D%F4%17%2B%AC%D9%B9%F08%CF%BD%08gG%B4%F9%7E%AF%DB%90%D8R%22%93%C7%D7%CE%28%7CR%82%1B%A6V%99%EAz5%E0%B0x%ACI%00%00%3B";

	Response.BinaryWrite(getByteString(unescape(str)));
	Response.End();
}

function responseXmlFile()
{
	showAuthorize("XMLHTTP");
	Response.ContentType="text/xml";
%>
<?xml version="1.0" encoding="<%=CONFIG["encoding"]%>"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://editone.gaya.cn">
<msxsl:script language="javascript" implements-prefix="user">
<![CDATA[
function getName(file, isDir)
{
	n=isDir? file.lastIndexOf("/", file.length-2):file.lastIndexOf("/");
	return file.substring(n+1, (isDir? file.length-1:file.length));
}
function getType(file)
{
	n=file.lastIndexOf(".");
	suffix=n>=0? file.substr(n+1).toLowerCase():"";
	switch (suffix) {
		case "asp": case "aspx": case "php": case "jsp": case "cgi": case "pl": case "js": return "script";
		case "htm": case "html": case "shtml": return "htm";
		case "js": case "css": case "xml": case "xsl": return "config";
		case "jpg": case "gif": case "bmp": case "psd": case "ico": return "pic";
		case "java": case "c": case "cpp": case "cs": case "h": case "hpp": return "source";
		case "mp3": case "mpga": case "wav": case "mid": case "avi": case "mpg": case "rm": case "wmv": case "wma": case "swf": return "media";
		case "rar": case "zip": case "gz": case "tar": return "rar";
		default: return "default";
	}
}
]]>
</msxsl:script>

<xsl:template match="/">
<xsl:apply-templates select="TreeNode" />
</xsl:template>

<xsl:template match="TreeNode">
<xsl:for-each select="./TreeNode">
	<xsl:variable name="vIsDir" select="substring(@file, string-length(@file), 1)='/'"/>
	<xsl:variable name="vName" select="user:getName(string(@file), $vIsDir)"/>
	<xsl:variable name="vType" select="user:getType($vName)"/>
	<div class="TreeNode" nowrap="true">
		<xsl:attribute name="uid"><xsl:value-of select="@file" /></xsl:attribute>
		<xsl:attribute name="open">false</xsl:attribute>
		<xsl:attribute name="type">
		<xsl:choose>
			<xsl:when test="$vIsDir">parent</xsl:when>
			<xsl:otherwise>leaf</xsl:otherwise></xsl:choose>
		</xsl:attribute>
		<input type="checkbox" name="itemSel" class='selector'>
		<xsl:attribute name="value"><xsl:value-of select="@file" /></xsl:attribute>
		</input>
		<img align="absmiddle">
			<xsl:attribute name="src">
			<xsl:choose>
				<xsl:when test="$vIsDir"><%=PAGE%>?do=image&amp;file=folder_close.gif</xsl:when>
				<xsl:otherwise><%=PAGE%>?do=image&amp;file=<xsl:value-of select="$vType"/>.gif</xsl:otherwise>
			</xsl:choose>
			</xsl:attribute>
		</img>
		<span type="label">
			<a>
			<xsl:attribute name="file"><xsl:value-of select="@file" /></xsl:attribute>
			<xsl:attribute name="href">javascript:void(0)</xsl:attribute>
			<xsl:attribute name="onClick">javascript:return dispose(this)</xsl:attribute>
			<xsl:attribute name="onMouseOver">javascript:return showDetail(this)</xsl:attribute>
			<xsl:attribute name="onMouseOut">javascript:return closeDetail(this)</xsl:attribute>
			<xsl:if test="$vIsDir=false">
				<xsl:attribute name="length"><xsl:value-of select="@length"/></xsl:attribute>
			</xsl:if>
			<xsl:attribute name="time"><xsl:value-of select="@time" /></xsl:attribute>
			<xsl:value-of select="$vName" />
			</a>
		</span>
		<xsl:if test="$vIsDir">
		<div type="container" class="container" style="display:none">
			<xsl:if test="@file">
				<xsl:attribute name="uid"><xsl:value-of select="@file"/></xsl:attribute>
			</xsl:if>
			<xsl:choose>
			<xsl:when test="./TreeNode">
			<xsl:attribute name="send">true</xsl:attribute>
			<xsl:apply-templates select="."/>
			</xsl:when>
			<xsl:otherwise><xsl:attribute name="send">false</xsl:attribute>&#160;</xsl:otherwise>
			</xsl:choose>
		</div>
		</xsl:if>
	</div>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet><%
}

function getRealPath(file)
{
	return Server.MapPath(file);
}
function isExist(file,isDir)
{
	try {
		var fso=Server.CreateObject("Scripting.FileSystemObject");
		if (isDir)
			return fso.FolderExists(file);
		else
			return fso.FileExists(file);
	}
	catch (e) {
		e=null;
		return false;
	}
}
function rename(file,name,isDir)
{
	try {
		var fso=Server.CreateObject("Scripting.FileSystemObject");
		var f;
		if (isDir)
			f=fso.GetFolder(file);
		else
			f=fso.GetFile(file);
		f.name=name;
		return true;
	}
	catch (e) { return false; }
}
function delete0(file,isDir)
{
	try {
		var fso=Server.CreateObject("Scripting.FileSystemObject");
		if (isDir)
			fso.DeleteFolder(file);
		else
			fso.DeleteFile(file);
		return true;
	}
	catch (e) { return false; }
}

function fopen(filename, mode)
{
	try {
		var fso=Server.CreateObject("Scripting.FileSystemObject");
		ioMode=(mode.charAt(0)=='r')? 1:((mode.charAt(0)=='w')? 2:8);
		var f=fso.OpenTextFile(filename, ioMode, true);
		return f;
	}
	catch (e) { return null; }
}
function fread(fp, size)
{
	if (size>=0)
		return fp.Read(size);
	else if (fp.AtEndOfStream)
		return "";
	else
		return fp.ReadAll();
}
function fwrite(fp, str)
{
	fp.Write(str);
}
function fclose(fp)
{
	fp.Close();
}
function file(filename)
{
	if (!(fp=fopen(filename, "rb")))
		return null;
	var lines=new Array();
	while (!fp.AtEndOfStream)
		lines[lines.length]=fp.ReadLine();
	return lines;
}

//----------------------- MD5 -----------------------
function MD5(sMessage) {
function RotateLeft(lValue, iShiftBits) {
  return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
}
function AddUnsigned(lX,lY) {
  var lX4,lY4,lX8,lY8,lResult;
  lX8=(lX & 0x80000000);
  lY8=(lY & 0x80000000);
  lX4=(lX & 0x40000000);
  lY4=(lY & 0x40000000);
  lResult=(lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
  if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
  if (lX4 | lY4) {
   if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
   else return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
  } else return (lResult ^ lX8 ^ lY8);
}
function F(x,y,z) { return (x & y) | ((~x) & z); }
function G(x,y,z) { return (x & z) | (y & (~z)); }
function H(x,y,z) { return (x ^ y ^ z); }
function I(x,y,z) { return (y ^ (x | (~z))); }
function FF(a,b,c,d,x,s,ac) {
  a=AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
  return AddUnsigned(RotateLeft(a, s), b);
}
function GG(a,b,c,d,x,s,ac) {
  a=AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
  return AddUnsigned(RotateLeft(a, s), b);
}
function HH(a,b,c,d,x,s,ac) {
  a=AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
  return AddUnsigned(RotateLeft(a, s), b);
}
function II(a,b,c,d,x,s,ac) {
  a=AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
  return AddUnsigned(RotateLeft(a, s), b);
}
function ConvertToWordArray(sMessage) {
  var lWordCount;
  var lMessageLength=sMessage.length;
  var lNumberOfWords_temp1=lMessageLength+8;
  var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
  var lNumberOfWords=(lNumberOfWords_temp2+1)*16;
  var lWordArray=Array(lNumberOfWords-1);
  var lBytePosition=0;
  var lByteCount=0;
  while ( lByteCount<lMessageLength ) {
   lWordCount=(lByteCount-(lByteCount % 4))/4;
   lBytePosition=(lByteCount % 4)*8;
   lWordArray[lWordCount]=(lWordArray[lWordCount] | (sMessage.charCodeAt(lByteCount)<<lBytePosition));
   lByteCount++;
  }
  lWordCount=(lByteCount-(lByteCount % 4))/4;
  lBytePosition=(lByteCount % 4)*8;
  lWordArray[lWordCount]=lWordArray[lWordCount] | (0x80<<lBytePosition);
  lWordArray[lNumberOfWords-2]=lMessageLength<<3;
  lWordArray[lNumberOfWords-1]=lMessageLength>>>29;
  return lWordArray;
}
function WordToHex(lValue) {
  var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
  for (lCount=0;lCount<=3;lCount++) {
   lByte=(lValue>>>(lCount*8)) & 255;
   WordToHexValue_temp="0"+lByte.toString(16);
   WordToHexValue=WordToHexValue+WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
  }
  return WordToHexValue;
}
    var x=Array();
    var k,AA,BB,CC,DD,a,b,c,d
    var S11=7, S12=12, S13=17, S14=22;
    var S21=5, S22=9 , S23=14, S24=20;
    var S31=4, S32=11, S33=16, S34=23;
    var S41=6, S42=10, S43=15, S44=21;
    // Steps 1 and 2.  Append padding bits and length and convert to words
    x=ConvertToWordArray(sMessage);
    // Step 3.  Initialise
    a=0x67452301; b=0xEFCDAB89; c=0x98BADCFE; d=0x10325476;
    // Step 4.  Process the message in 16-word blocks
    for (k=0;k<x.length;k+=16) {
        AA=a; BB=b; CC=c; DD=d;
        a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
        d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
        c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
        b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
        a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
        d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);
        c=FF(c,d,a,b,x[k+6], S13,0xA8304613);
        b=FF(b,c,d,a,x[k+7], S14,0xFD469501);
        a=FF(a,b,c,d,x[k+8], S11,0x698098D8);
        d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
        c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
        b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
        a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
        d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
        c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
        b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
        a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);
        d=GG(d,a,b,c,x[k+6], S22,0xC040B340);
        c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
        b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
        a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);
        d=GG(d,a,b,c,x[k+10],S22,0x2441453);
        c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
        b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
        a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
        d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
        c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
        b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);
        a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
        d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
        c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);
        b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
        a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
        d=HH(d,a,b,c,x[k+8], S32,0x8771F681);
        c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
        b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
        a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
        d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
        c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
        b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
        a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
        d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
        c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
        b=HH(b,c,d,a,x[k+6], S34,0x4881D05);
        a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
        d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
        c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
        b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
        a=II(a,b,c,d,x[k+0], S41,0xF4292244);
        d=II(d,a,b,c,x[k+7], S42,0x432AFF97);
        c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
        b=II(b,c,d,a,x[k+5], S44,0xFC93A039);
        a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
        d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
        c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
        b=II(b,c,d,a,x[k+1], S44,0x85845DD1);
        a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
        d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
        c=II(c,d,a,b,x[k+6], S43,0xA3014314);
        b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
        a=II(a,b,c,d,x[k+4], S41,0xF7537E82);
        d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
        c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
        b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
        a=AddUnsigned(a,AA); b=AddUnsigned(b,BB); c=AddUnsigned(c,CC); d=AddUnsigned(d,DD);
    }
    // Step 5.  Output the 128 bit digest
    var temp= WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
    return temp.toLowerCase();
}
%>
<SCRIPT language="VBScript" runat="server">
'Byte string to string conversion
Function getString(sBin)
	getString=""
	For I=1 to LenB(sBin)
		getString=getString & Chr(AscB(MidB(sBin,I,1)))
	Next
End Function

'String to byte string conversion
Function getByteString(sStr)
	Dim I,sB,C
	For I=1 to Len(sStr)
		C=Mid(sStr,I,1)
		sB=sB&ChrB(AscB(C))
	Next
	getByteString=sB
End Function

Function uploadFile()
	showAuthorize "EMBED"
	iCrlf1=ChrB(13) & ChrB(10)
	iCrlf2=iCrlf1 & iCrlf1

	Dim sBin,src,buf,iPos1,iPos3,iPos4
	sBin=Request.BinaryRead(Request.TotalBytes)
	Set src=Server.CreateObject("ADODB.Stream")
	src.Type=1
	src.Mode=3
	src.Open
	src.Write sBin

	On Error Resume Next
	Set buf=Server.CreateObject("ADODB.Stream")
	buf.Type=1
	buf.Mode=3
	buf.Open
	iPos1=InStrB(1, sBin, iCrlf1)-1
	bSeparator=LeftB(sBin, iPos1)
	LenSep=LenB(bSeparator)
	bFile=getByteString("name=""fileUpload""")

	iPos3=1
	DO While true
		iPos3=InStrB(iPos3, sBin, bSeparator)+LenSep
		iPos4=InStrB(iPos3, sBin, iCrLf2)
		bHeader=MidB(sBin, iPos3, iPos4-iPos3)
		If InStrB(1, bHeader, bFile)>0 Then Exit Do
	LOOP

	iPos1=InStrB(iPos3, sBin, iCrlf2)+3
	iPos2=InStrB(iPos3, sBin, bSeparator)-3
	src.Position=iPos1
	src.CopyTo buf, iPos2-iPos1

	filename=Request.QueryString("dir")&Request.QueryString("name")
	filepath=getRealPath(filename)
	buf.SaveToFile filepath,2
	buf.Close
	src.Close
	If Err.Number = 0 Then
		Response.Write "<html><head></head><body><scr"&"ipt>parent.reportUpload(true,"&(iPos2-iPos1)&");</scr"&"ipt></body></html>"
	Else
		If (fp=fopen(file,"wb")) Then
			fwrite fp,getString(MidB(sBin, iPos1, iPos2-iPos1))
			fclose fp
			Response.Write "<html><head></head><body><scr"&"ipt>parent.reportUpload(true,"&(iPos2-iPos1)&");</scr"&"ipt></body></html>"
		Else

			Response.Write "<html><head></head><body><scr"&"ipt>parent.reportUpload(false,'"&Err.Description&"','"&Err.Number&"');</scr"&"ipt></body></html>"
		End If
	End If
End Function

Function renewConfig(sStr,sName,sContent)
	Dim nB,nE
	nB=InStr(1, sStr, "var "&sName)
	nE=InStr(1, sStr, "//END_"&sName)
	renewConfig=Mid(sStr,1,nB-1)&sContent&Mid(sStr,nE)
End Function
</SCRIPT>