fires when an item is selected
myTreeView.attachEvent("onSelect", function(id, mode){ // your code here });