th.value = "/"+filename+"."+ext;
  };
}

function createTree(element, editor){
  var preview = ge("preview");
  var treeRoot = ce("div");
  treeRoot.className = "tvu";
  ge(element).appendChild(treeRoot);

  function loadDownload(path){
    ge('download-frame').src = "/edit?download="+path;
  }

  function loadPreview(path){
    var edfname = ge("editor-filename");
    edfname.value=path;
    ge("editor").style.display = "none";
    preview.style.display = "block";
    preview.innerHTML = '<img src="/edit?e