Treeview control script

Dear All,
I have page here with the treeview menu http://183.78.169.54/tree/1.html. Now what I want to control is that once a submenu is selected then I want it to have a different font color how to control on that. Secondly I am going to have a validation form so based on the validation I want the particular menu to be expanded and the list in it to be highlighted accordingly. How to achieve that any help please?