function O(i){
parent.FileSelected(ui[0]+i);
}

function ToParent(){AjaxRequest("?_action=toparent","",IOK,null);}
function I(name){AjaxRequest("?_action=open&name="+escape(name),"",IOK,null);}

function IOK(r){
ui=eval(r);
if (ui[2]==1){
$("top").style.height="60px";
$("toparent2").style.display="inline";
}
else{
$("top").style.height="45px";
$("toparent2").style.display="none";
}

$("title").innerHTML="/"+ui[0];
$("main").innerHTML=CreateListUI();
}

function CreateUI(){
var u="<form name=\"client\" method=\"post\" action=\"\"><div id=\"top\" class=\"top\"><H3 id=\"title\">/" + ui[0] + "</H3>";
if (ui[2]==1){
u+="<A id=\"toparent2\" onclick=\"ToParent();\">[上一级]</A>";
}
else{
u+="<A id=\"toparent2\" style=\"display:none;\" onclick=\"ToParent();\">[上一级]</A>";
}
u+="</div>";

u+="<div id=\"main\" class=\"dir2\">";
u+=CreateListUI();
u+="</div>";
u+="</form>";
document.body.innerHTML=u;
if (ui[2]==1){
$("top").style.height="60px";
}
else{
$("top").style.height="45px";
}
}

function CreateListUI(){
var u=new Array();
var index = 0;
for (var i = 0; i < ui[3].length; i++){
u[i]="<div><A onclick=\"I('" + ui[3][i] + "')\">" + ui[3][i] + "</A></div>";
}
for (var i = 0; i < ui[4].length; i++){
index = ui[3].length + i;
u[index]="<div><A onclick=\"O('" + ui[4][i] + "')\">" + ui[4][i] + "</A></div>";
}
return u.join("");
}