fires when selection in the tree was changed
myTree.attachEvent("onSelect", function(id){ // your code here });