function ToParent(){AjaxRequest("?_action=toparent","",DOK,null);}
function D(i){AjaxRequest("?_action=open&name="+escape($("d"+i).value),"",DOK,null);}

function DOK(r){
ui=eval(r);
$("delete").disabled=true;
$("copy").disabled=true;
$("cut").disabled=true;
$("zip").disabled=true;

if (ui[2]==1){
$("top").style.height="75px";
$("toparent").style.display="inline";
}
else{
$("top").style.height="60px";
$("toparent").style.display="none";
}
$("title").innerHTML="/"+ui[0];
if(ui[3]==1){
$("paste").style.display="inline";
$("cancelcut").style.display="inline";
}
else if(ui[3]==2){
$("paste").style.display="inline";
$("cancelcopy").style.display="inline";
}
else{
$("paste").style.display="none";
$("cancelcut").style.display="none";
$("cancelcopy").style.display="none";
}
$("main").innerHTML=CreateListUI();
ResetSize();
}

function Cut(){AjaxRequest("?_action=cut&cut="+escape(items),"",CutReturn,null);}
function CutReturn(r){
$("paste").style.display="inline";
$("cancelcut").style.display="inline";
$("cancelcopy").style.display="none";
if(r.substring(0,1)==' '){
ShowMessage(r);
}
else{
ShowMessageDialog("提示",r);
}
}

function Copy(){AjaxRequest("?_action=copy&copy="+escape(items),"",CopyReturn,null);}
function CancelCopy(){AjaxRequest("?_action=cancelcopy","",CancelCopyReturn,null);}
function CancelCut(){AjaxRequest("?_action=cancelcut","",CancelCutReturn,null);}
function CancelCopyReturn(r){
$("paste").style.display="none";
$("cancelcopy").style.display="none";
if(r.substring(0,1)==' '){
ShowMessage(r);
}
else{
ShowMessageDialog("提示",r);
}
}

function CancelCutReturn(r){
$("paste").style.display="none";
$("cancelcut").style.display="none";
if(r.substring(0,1)==' '){
ShowMessage(r);
}
else{
ShowMessageDialog("提示",r);
}
}

function CopyReturn(r){
$("paste").style.display="inline";
$("cancelcopy").style.display="inline";
$("cancelcut").style.display="none";
if(r.substring(0,1)==' '){
ShowMessage(r);
}
else{
ShowMessageDialog("提示",r);
}
}

function Paste(){AjaxRequest("?_action=paste","",PasteReturn,null);}
function PasteReturn(r){
if(r.substring(0,1)=='['){
var result=eval(r);
ui=result[1];
$("main").innerHTML=CreateListUI();
ShowMessage(result[0]);
if(ui[3]==0){
$("paste").style.display="none";
$("cancelcut").style.display="none";
}
$("delete").disabled=true;
$("copy").disabled=true;
$("cut").disabled=true;
$("zip").disabled=true;
}
else{
ShowMessageDialog("提示",r);
}
}

function UpLoad(){
AjaxRequest("index.htm","",ToUpload,null);
}

function ToUpload(){
var content="<form name=\"upload\" method=\"post\" target=\"res\" enctype=\"multipart/form-data\" action=\"?_action=upload&isiframe=1\"><input name=\"uploadfile\" size=\"38\" type=\"file\" onchange=\"$('yes').focus();\"/><button type=\"button\" id=\"yes\" onclick=\"UploadOK();\">确定</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button></form><iframe name=\"res\" style=\"display:none;\" src=\"\"></iframe>";
EasyMask.init({mode:2, width: 460, height: 70, title: '上传文件', detail: content });
document.upload.uploadfile.focus();
}

function UploadOK(){
if(document.upload.uploadfile.value==""){
ShowMessageDialog("提示","您未选择文件,请点击浏览按钮选择要上传的文件");
return;
}	
document.upload.submit();
EasyMask.hidden();
Trading();
}

function UploadEnd(message,data){
if(data!=null){
var i=ui[9].length;
var temp=document.createElement("div");
if(ui[10]==1){
var result="<a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + data[0] + "\"/>";
result+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + data[0] + "</a>";
temp.className="row";
temp.innerHTML=result;
}
else if(ui[10]==2){
var result="<span class=\"date\">"+data[1]+"</span><span class=\"time\">"+data[2]+"</span><span class=\"length\">"+data[3]+"</span><span class=\"name\"><a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + data[0] + "\"/>";
result+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + data[0] + "</a></span>";
temp.className="row";
temp.innerHTML=result;
}
else{
var result="<a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + data[0] + "\"/>";
result+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + data[0] + "</a>";
temp.innerHTML=result;
}

$("main").appendChild(temp);
ui[9][ui[9].length]=[data[0],1,1,1];
ShowMessage(message);
}
else{
ShowMessageDialog("提示",message);
}
EndTrading();
}

function AddEsp(){
var content="名称:<input id='name' onKeyDown=\"FileNameKeyDown(event);\" value=\"newpage.esp\"/><button type=\"button\" id=\"yes\" onclick=\"AddEspOK();\">确定</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button>";
EasyMask.init({ width: 431, height: 70, title: '新建页面(esp文件)', detail: content});
$("name").focus();
}

function AddEspOK(){
directoryName=$("name").value;
if(directoryName==""){
ShowMessageDialog("提示","名称不能为空");
return;
}
EasyMask.close();
AjaxRequest("?_action=addfile&name="+escape(directoryName),"",AddFileReturn,null);
}

function AddFileReturn(r){
if(r.substring(0,1)==' '){
Go("Edit.ashx?BSDevelopName=" + escape(directoryName));
}
else{
ShowMessageDialog("提示",r);
}
}

function AddEsc(){
var content="名称:<input id='name' onKeyDown=\"FileNameKeyDown(event);\" value=\"newcontrol.esc\"/><button type=\"button\" id=\"yes\" onclick=\"AddEscOK();\">确定</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button>";
EasyMask.init({ width: 431, height: 70, title: '新建控件(esc文件)', detail: content});
$("name").focus();
}

function AddEscOK(){
directoryName=$("name").value;
if(directoryName==""){
ShowMessageDialog("提示","名称不能为空");
return;
}
EasyMask.close();
AjaxRequest("?_action=addfile&name="+escape(directoryName),"",AddFileReturn,null);
}

var rI=0;
var newName="";

function DR(i){
var oldName=$("d"+i).value;
oldName=oldName.substring(0,oldName.lastIndexOf("/"));
var content="名称:<input id='name' value='"+oldName+"' onKeyDown=\"FileNameKeyDown(event);\"/><button type=\"button\" id=\"yes\" onclick=\"DROK("+i+");\">确定</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button>";
EasyMask.init({ width: 431, height: 70, title: '重命名', detail: content });
$("name").select(); 
$("name").focus();  
}

function DROK(i){
rI=i;
newName=$("name").value;
if(newName==""){
ShowMessageDialog("提示","名称不能为空");
return;
}
if($("d"+i).value==newName+"/"){
ShowMessageDialog("提示","您未改变名称");
return;
}
var oldName=$("d"+i).value;
EasyMask.close();
AjaxRequest("?_action=rename&name="+escape(newName)+"&oldname="+escape(oldName),"",DRReturn,null);
}

function DRReturn(r){
if(r.substring(0,1)==" "){
ui[8][rI][0]=newName;
$("d"+rI).value=newName+"/";
ShowMessage(r);
$("d"+rI).nextSibling.innerHTML=newName;
}
else{
ShowMessageDialog("提示",r);
}
}


function FR(i){
var oldName=$("f"+i).value;
var content="名称:<input id='name' value='"+oldName+"' onKeyDown=\"FileNameKeyDown(event);\"/><button type=\"button\" id=\"yes\" onclick=\"FROK("+i+");\">确定</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button>";
EasyMask.init({ width: 431, height: 70, title: '重命名', detail: content });
$("name").select(); 
$("name").focus();  
}

function FROK(i){
rI=i;
newName=$("name").value;
if(newName==""){
ShowMessageDialog("提示","名称不能为空");
return;
}
if($("f"+i).value==newName){
ShowMessageDialog("提示","您未改变名称");
return;
}
var oldName=$("f"+i).value;
EasyMask.close();
AjaxRequest("?_action=rename&name="+escape(newName)+"&oldname="+escape(oldName),"",FRReturn,null);
}

function FRReturn(r){
if(r.substring(0,1)==' '){
ui[9][rI][0]=newName;
$("f"+rI).value=newName;
ShowMessage(r);
$("f"+rI).nextSibling.innerHTML=newName;
}
else if(r.substring(0,1)=='['){
ui[9][rI][0]=newName;
$("f"+rI).value=newName;
var result=eval(r);
ShowMessage(result[0]);
$("f"+rI).nextSibling.innerHTML=newName;
if(ui[9][rI]){
if(ui[9][rI][5]){
ui[9][rI][5]=result[1];
}
}
}
else{
ShowMessageDialog("提示",r);
}
}

function View(i){
ui[10]=i;
AjaxRequest("?_action=view&view="+i,"",ViewOK,null);
}

function ViewOK(r){
if(r!=""){
ui=eval(r);
}
$("main").innerHTML=CreateListUI();
$("view").innerHTML=CreateViewUI();
}

function All(i){
var name=ui[9][i][5];
var content="<h2><a href=\""+ui[1]+name+".ashx\" target=\"_blank\">"+name+".ashx</a><br/><br/><a href=\"#\" onclick=\"Go('Edit.ashx?BSDevelopName="+name+".cs');return false;\">"+name+".cs</a></h2>";
EasyMask.init({ width: 400, height: 150, title: ui[9][i][0]+' 经编译后产生的文件', detail: content });
}

function F(i){
var name=$("f"+i).value;
var extense=name.substring(name.lastIndexOf(".")+1).toLowerCase();
if(extense=="zip"){
var content="<button type=\"button\" id=\"yes\" onclick=\"OOK1("+i+");\">下载</button><button type=\"button\" onclick=\"OOK2("+i+");\">解压</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button>";
EasyMask.init({ width: 170, height: 70, title: '您想如何处理此文件?', detail: content });
$("yes").focus(); 
}
else if(extense=="esp"||extense=="esc"||extense=="cs"||extense=="js"||extense=="css"||extense=="txt"||extense=="xml"||extense=="config"){
Go("Edit.ashx?BSDevelopName=" + escape(name));
}
else if(extense=="swf"||extense=="asp"||extense=="aspx"||extense=="ashx"){
var content="<form name=\"op\" action=\""+ui[1]+name+"\" target=\"_blank\"></form>";
EasyMask.init({ width: 0, height: 0, title: '', detail: content });
document.op.submit();EasyMask.close();
}
else if(extense=="shtml"||extense=="html"||extense=="htm"){
var content="<form name=\"op\" action=\""+ui[1]+name+"\" target=\"_blank\"><button type=\"button\"  id=\"yes\" onclick=\"document.op.submit();EasyMask.close();\">浏览</button><button type=\"button\" onclick=\"EasyMask.close();Go('Edit.ashx?BSDevelopName=" + escape(name)+"');\">编辑</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button></form>";
EasyMask.init({ width: 170, height: 70, title: '您想如何处理此文件?', detail: content });
$("yes").focus(); 
}
else if(extense=="jpg"||extense=="gif"||extense=="png"||extense=="bmp"||extense=="ico"){
var content="<div style=\"width:100%;height:100%;overflow:auto;\"><img src=\""+ui[1]+name+"\"/></div>";
EasyMask.init({ width: 600, height: 400, title: name, detail: content });
}
else if(extense=="rar"||extense=="doc"||extense=="xls"){
OOK1(i);
}
else{
ShowMessageDialog("提示","此类型文档无法直接下载,请先压缩后再下载");
}
}

function OOK1(i){
var name=$("f"+i).value;
EasyMask.close();
window.location=ui[1]+name;
}

function OOK2(i){
var name=$("f"+i).value;
EasyMask.close();
AjaxRequest("?_action=unzip&name="+escape(name),"",UnZipReturn,null);
}

function UnZipReturn(r){
if(r.substring(0,1)=='['){
var result=eval(r);
ui=result[1];
$("main").innerHTML=CreateListUI();
ShowMessage(result[0]);
$("delete").disabled=true;
$("copy").disabled=true;
$("cut").disabled=true;
$("zip").disabled=true;
}
else{
ShowMessageDialog("提示",r);
}
}

function SAll(){
var arr=document.getElementsByName("i");
for(var i=0;i<arr.length;i++){
if(arr[i].disabled==false){arr[i].checked=true;}
}
S();
}

function USAll(){
var arr=document.getElementsByName("i");
for(var i=0;i<arr.length;i++){
if(arr[i].disabled==false){arr[i].checked=!arr[i].checked;}
}
S();
}

var items="";
function S(){
var arr=document.getElementsByName("i");
var enableAction=true;
var enableZip=true;
items="";
for(var i=0;i<arr.length;i++){
if(arr[i].checked&&arr[i].disabled==false){
enableAction=false;
var name=arr[i].value;
var extension=name.substring(name.lastIndexOf(".")+1).toLowerCase();
if(extension=="esp"){
var j=arr[i].id.replace("f","");
if(ui[9][j][4]==1){
items+="|"+ui[9][j][5]+".ashx|"+ui[9][j][5]+".cs";
}
}
items+="|"+arr[i].value;
}
}
$("zip").disabled=enableAction;
$("delete").disabled=enableAction;
$("cut").disabled=enableAction;
$("copy").disabled=enableAction;
}

function AddDirectoryOK(){
directoryName=$("name").value;
if(directoryName==""){
ShowMessageDialog("提示","名称不能为空");
return;
}
EasyMask.close();
AjaxRequest("?_action=adddirectory&name="+escape(directoryName),"",AddDirectoryReturn,null);
}

var directoryName="";
function AddDirectoryReturn(r){
if(r.substring(0,1)==' '){
var i=ui[8].length;
var temp=document.createElement("div");
if(ui[10]==1){
var result="<a href=\"#\" onclick=\"DR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + directoryName + "/\"/>";
result+="<a href=\"#\" onclick=\"D(" + i + ");return false;\">" + directoryName + "</a>";
temp.className="row";
temp.innerHTML=result;
}
else if(ui[10]==2){
var date=new Date();
var result="<span class=\"date\">"+date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+"</span><span class=\"time\">"+date.getHours()+":"+date.getMinutes()+"</span><span class=\"length\">&lt;dir&gt;</span><span class=\"name\"><a href=\"#\" onclick=\"DR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + directoryName + "/\"/>";
result+="<a href=\"#\" onclick=\"D(" + i + ");return false;\">" + directoryName + "</a></span>";
temp.className="row";
temp.innerHTML=result;
}
else{
var result="<a href=\"#\" onclick=\"DR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + directoryName + "/\"/>";
result+="<a href=\"#\" onclick=\"D(" + i + ");return false;\">" + directoryName + "</a>";
temp.innerHTML=result;
}
$("main").appendChild(temp);
ui[8][ui[8].length]=[directoryName,1,1,1];
ShowMessage(r);
}
else{
ShowMessageDialog("提示",r);	
}
}

function AddDirectory(){
var content="名称:<input id='name' onKeyDown=\"FileNameKeyDown(event);\"/><button type=\"button\" id=\"yes\" onclick=\"AddDirectoryOK();\">确定</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button>";
EasyMask.init({ width: 431, height: 70, title: '新建目录', detail: content });
$("name").focus();
}

var zipName="";
function ZipOK(){
zipName=$("name").value;
if(zipName==""){
ShowMessageDialog("提示","名称不能为空");
return;
}
EasyMask.close();
AjaxRequest("?_action=zip&name="+escape(zipName)+"&zip="+escape(items),"",ZipReturn,null);
}

function ZipReturn(r){
if(r.substring(0,1)=='['||r.substring(0,1)==' '){
var i=ui[9].length;
var temp=document.createElement("div");
if(ui[10]==1){
var result="<a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + zipName + "\"/>";
result+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" +  zipName + "</a>";
temp.className="row";
temp.innerHTML=result;
ShowMessage(r);
}
else if(ui[10]==2){
var message=eval(r)[0];
var length=eval(r)[1];
var date=new Date();
var result="<span class=\"date\">"+date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+"</span><span class=\"time\">"+date.getHours()+":"+date.getMinutes()+"</span><span class=\"length\">"+length+"</span><span class=\"name\"><a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" +  zipName + "\"/>";
result+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" +  zipName + "</a></span>";
temp.className="row";
temp.innerHTML=result;
ShowMessage(message);
}
else{
var result="<a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
result+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" +  zipName+"\"/>";
result+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" +  zipName + "</a>";
temp.innerHTML=result;
ShowMessage(r);
}
$("main").appendChild(temp);
ui[9][ui[9].length]=[zipName,1,1,1];
}
else{
ShowMessageDialog("提示",r);	
}
}

function Zip(){
var content="名称:<input id='name' onKeyDown=\"FileNameKeyDown(event);\" value=\"new.zip\"/><button type=\"button\" id=\"yes\" onclick=\"ZipOK();\">确定</button><button type=\"button\" onclick=\"EasyMask.close();\">取消</button>";
EasyMask.init({ width: 431, height: 70, title: '压缩', detail: content });
$("name").focus();
}

function Delete(){
var content="<table style=\"width:215px;\"><tr><td colspan=\"2\"><br>&nbsp;&nbsp;&nbsp;确实要删除选中的文件吗?<br><br><br></td></tr><tr><td></td><td align=\"right\"><button type=\"button\" id=\"yes\" onclick=\"EasyMask.close();DeleteOK();\">&nbsp;是&nbsp;</button>&nbsp;<button type=\"button\" onclick=\"EasyMask.close();\">&nbsp;否&nbsp;</button></td></tr></table>";
EasyMask.init({ width: 230, height: 131, title: '确认删除选中的文件', detail: content });
$("yes").focus();
}

function DeleteOK(){
AjaxRequest("?_action=delete&delete="+escape(items),"",DeleteReturn,null);
}

function DeleteReturn(r){
if(r.substring(0,1)=='['){
var result=eval(r);
ui=result[1];
$("main").innerHTML=CreateListUI();
ShowMessage(result[0]);
$("delete").disabled=true;
$("copy").disabled=true;
$("cut").disabled=true;
$("zip").disabled=true;
}
else{
ShowMessageDialog("提示",r);	
}
}

function ResetSize(){
var w = window.innerWidth || self.innerWidth || (document.documentElement && document.documentElement.clientWidth && document.documentElement.offsetWidth) || document.body.clientWidth;
if(System.ie){w=w-4;}
var h = window.innerHeight  || document.documentElement.clientHeight;
if(ui[2]==1){
$("main").style.height=(h-209)+"px";
}
else{
$("main").style.height=(h-194)+"px";
}
$("main").style.width=(w-67)+"px";
}

function CreateUI(){
document.body.style.overflow = eval((document.documentElement.offsetWidth) ? "document.documentElement" : "document.body").style.overflow = "hidden";
var u="<form name=\"client\" method=\"post\" action=\"\"><div id=\"menu\"><button type=\"button\" onclick=\"Compile();\">编译</button></div><div id=\"top\"><H1 id=\"title\">/" + ui[0] + "</H1>";
if (ui[2]==1){
u+="<A href=\"#\" id=\"toparent\" onclick=\"ToParent();return false;\">[上一级]</A>";
}
else{
u+="<A href=\"#\" id=\"toparent\" style=\"display:none;\" onclick=\"ToParent();return false;\">[上一级]</A>";
}
u+="</div>";

u+="<div id=\"main\" class=\"dir\">";
u+=CreateListUI();
u+="</div>";

u+="<div id=\"bottom\"><div id=\"toolbar\">";

u+="<pre><button type=\"button\" onclick=\"SAll();\">全选</button><button type=\"button\" onclick=\"USAll();\">反选</button> <button type=\"button\" id=\"zip\" disabled=\"true\" onclick=\"Zip();\">压缩</button><button type=\"button\" id=\"delete\" disabled=\"true\" onclick=\"Delete();\">删除</button><button type=\"button\" id=\"cut\" disabled=\"true\" onclick=\"Cut();\">剪切</button><button type=\"button\" id=\"copy\" disabled=\"true\" onclick=\"Copy();\">复制</button> ";

if (ui[3]==1){
u+="<button type=\"button\" id=\"cancelcut\" onclick=\"CancelCut();\">取消剪切</button><button type=\"button\" id=\"cancelcopy\" style=\"display:none;\" onclick=\"CancelCopy();\">取消复制</button><button type=\"button\" id=\"paste\" onclick=\"Paste();\">粘贴</button>";
}
else if (ui[3]==2){
u+="<button type=\"button\" id=\"cancelcut\" style=\"display:none;\" onclick=\"CancelCut();\">取消剪切</button><button type=\"button\" id=\"cancelcopy\" onclick=\"CancelCopy();\">取消复制</button><button type=\"button\" id=\"paste\" onclick=\"Paste();\">粘贴</button>";
}
else{
u+="<button type=\"button\" id=\"cancelcut\" style=\"display:none;\" onclick=\"CancelCut();\">取消剪切</button><button type=\"button\" id=\"cancelcopy\" style=\"display:none;\" onclick=\"CancelCopy();\">取消复制</button><button type=\"button\" id=\"paste\" style=\"display:none;\" onclick=\"Paste();\">粘贴</button>";
}

u+="</pre><button type=\"button\" onclick=\"AddDirectory();\">新建目录</button><button type=\"button\" onclick=\"AddEsp();\">新建页面(esp文件)</button><button type=\"button\" onclick=\"AddEsc();\">新建控件(esc文件)</button><button type=\"button\" onclick=\"UpLoad();\">上传文件</button><span id=\"view\">";
u+=CreateViewUI();
u+="</span></div><pre class=\"message\" id=\"message\"></pre></div></form>";

document.body.innerHTML=u;
if (ui[2]==1){
$("top").style.height="75px";
}
else{
$("top").style.height="60px";
}
ResetSize();
}

function CreateViewUI(){
if (ui[10]==1){
return "界面: <b>简洁</b> <a href=\"#\" onclick=\"View(2);return false;\">详细</a> <a href=\"#\" onclick=\"View(3);return false;\">平铺</a>";
}
else if(ui[10]==2){
return "界面: <a href=\"#\" onclick=\"View(1);return false;\">简洁</a> <b>详细</b> <a href=\"#\" onclick=\"View(3);return false;\">平铺</a>";
}
else{
return "界面: <a href=\"#\" onclick=\"View(1);return false;\">简洁</a> <a href=\"#\" onclick=\"View(2);return false;\">详细</a> <b>平铺</b>";
}
}

function CreateListUI(){
if(ui[10]==1){
return View1();
}
else if(ui[10]==2){
return View2();
}
else{
return View3();
}
}

function View1(){
var u=new Array();
var index = 0;
for (var i = 0; i < ui[8].length; i++){
if(ui[8][i][3]==1){
u[i]="<div class=\"row\"><a href=\"#\" onclick=\"DR(" + i + ");return false;\">重命名</a>";
}
else{
u[i]="<div class=\"row\"><span>重命名</span>";
}

if(ui[8][i][2]==1){
u[i]+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + ui[8][i][0] + "/\"/>";
}
else{
u[i]+="<input disabled=\"disabled\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + ui[8][i][0] + "/\"/>";
}

if(ui[8][i][1]==1){
u[i]+="<a href=\"#\" onclick=\"D(" + i + ");return false;\">" + ui[8][i][0] + "</a></div>";
}
else{
u[i]+=ui[8][i][0] + "</div>";
}
}

for (var i = 0; i < ui[9].length; i++){
index = ui[8].length + i;
if(ui[9][i][3]==1){
u[index]="<div class=\"row\"><a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
}
else{
u[index]="<div class=\"row\"><span>重命名</span>";
}

if(ui[9][i][2]==1){
u[index]+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + ui[9][i][0] + "\"/>";
}
else{
u[index]+="<input disabled=\"disabled\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + ui[9][i][0] + "\"/>";
}

if(ui[9][i][1]==1){

if(ui[9][i][4]==1){
u[index]+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + ui[9][i][0] + "</a><a href=\"#\" onclick=\"All("+i+");return false;\">＋</a></div>";
}
else{
u[index]+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + ui[9][i][0] + "</a></div>";
}

}
else{
u[index]+=ui[9][i][0] + "</div>";
}
                    }
return u.join("");
}


function View2(){
var u=new Array();
var index = 0;
for (var i = 0; i < ui[8].length; i++){
if(ui[8][i][3]==1){
u[i]="<div class=\"row\"><span class=\"date\">"+ui[8][i][4]+"</span><span class=\"time\">"+ui[8][i][5]+"</span><span class=\"length\">&lt;dir&gt;</span><span class=\"name\"><a href=\"#\" onclick=\"DR(" + i + ");return false;\">重命名</a>";
}
else{
u[i]="<div class=\"row\"><span class=\"date\">"+ui[8][i][4]+"</span><span class=\"time\">"+ui[8][i][5]+"</span><span class=\"length\">&lt;dir&gt;</span><span class=\"name\"><span>重命名</span>";
}

if(ui[8][i][2]==1){
u[i]+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + ui[8][i][0] + "/\"/>";
}
else{
u[i]+="<input disabled=\"disabled\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + ui[8][i][0] + "/\"/>";
}

if(ui[8][i][1]==1){
u[i]+="<a href=\"#\" onclick=\"D(" + i + ");return false;\">" + ui[8][i][0] + "</a></span></div>";
}
else{
u[i]+=ui[8][i][0] + "</span></div>";
}
}

for (var i = 0; i < ui[9].length; i++){
index = ui[8].length + i;
if(ui[9][i][3]==1){
u[index]="<div class=\"row\"><span class=\"date\">"+ui[9][i][6]+"</span><span class=\"time\">"+ui[9][i][7]+"</span><span class=\"length\">"+ui[9][i][8]+"</span><span class=\"name\"><a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
}
else{
u[index]="<div class=\"row\"><span class=\"date\">"+ui[9][i][6]+"</span><span class=\"time\">"+ui[9][i][7]+"</span><span class=\"length\">"+ui[9][i][8]+"</span><span class=\"name\"><span>重命名</span>";
}

if(ui[9][i][2]==1){
u[index]+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + ui[9][i][0] + "\"/>";
}
else{
u[index]+="<input disabled=\"disabled\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + ui[9][i][0] + "\"/>";
}

if(ui[9][i][1]==1){
if(ui[9][i][4]==1){
u[index]+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + ui[9][i][0] + "</a><a href=\"#\" onclick=\"All("+i+");return false;\">＋</a></span></div>";
}
else{
u[index]+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + ui[9][i][0] + "</a></span></div>";
}
}
else{
u[index]+=ui[9][i][0] + "</span></div>";
}
}
return u.join("");
}


function View3(){
var u=new Array();
var index = 0;
for (var i = 0; i < ui[8].length; i++){
if(ui[8][i][3]==1){
u[i]="<div><a href=\"#\" onclick=\"DR(" + i + ");return false;\">重命名</a>";
}
else{
u[i]="<div><span>重命名</span>";
}

if(ui[8][i][2]==1){
u[i]+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + ui[8][i][0] + "/\"/>";
}
else{
u[i]+="<input disabled=\"disabled\" type=\"checkbox\" name=\"i\" id=\"d" + i + "\" value=\"" + ui[8][i][0] + "/\"/>";
}

if(ui[8][i][1]==1){
u[i]+="<a href=\"#\" onclick=\"D(" + i + ");return false;\">" + ui[8][i][0] + "</a></div>";
}
else{
u[i]+=ui[8][i][0] + "</div>";
}
}

for (var i = 0; i < ui[9].length; i++){
index = ui[8].length + i;
if(ui[9][i][3]==1){
u[index]="<div><a href=\"#\" onclick=\"FR(" + i + ");return false;\">重命名</a>";
}
else{
u[index]="<div><span>重命名</span>";
}

if(ui[9][i][2]==1){
u[index]+="<input onclick=\"S();\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + ui[9][i][0] + "\"/>";
}
else{
u[index]+="<input disabled=\"disabled\" type=\"checkbox\" name=\"i\" id=\"f" + i + "\" value=\"" + ui[9][i][0] + "\"/>";
}

if(ui[9][i][1]==1){
if(ui[9][i][4]==1){
u[index]+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + ui[9][i][0] + "</a><a href=\"#\" onclick=\"All("+i+");return false;\">＋</a></div>";
}
else{
u[index]+="<a href=\"#\" onclick=\"F(" + i + ");return false;\">" + ui[9][i][0] + "</a></div>";
}
}
else{
u[index]+=ui[9][i][0] + "</div>";
}
}
return u.join("");
}