js tree searching