var foldersView; var itemsView; function init() { foldersView = new Scholar.TreeView(0); //pass params here? document.getElementById('folders-tree').view = foldersView; itemsView = new Scholar.TreeView(0); document.getElementById('items-tree').view = itemsView; var addMenu = document.getElementById('tb-add').firstChild; var itemTypes = Scholar.ItemTypes.getTypes(); for(var i = 0; i 0 && confirm("Are you sure you want to delete the selection????")) { itemsView.deleteSelection(); } } function search() { //TO DO: reload items tree with a search instead of a root folder alert(document.getElementById('tb-search').value); }