function _initTafel() { treeviewOBJ = new TafelTree('treeview', struct, 'images/'); treeviewOBJ.setOnOpen(function (branch, status) { if (status) mainDirectory.getChild(branch.getId()).expand(); else mainDirectory.getChild(branch.getId()).child = new Array(); }); treeviewOBJ.setOnClick(function (branch) { mainDirectory.getChild(branch.getId()).click(); }); treeviewOBJ.generate(); }