The first thing I'd ask is - Are you modifying the JS code provided with the tree control, or is this your custom JS file? If it's the JS that came with - I advice not modifying that.
First thing to be aware of is that the prefix is done to prevent same name conflicts. For example if you more than 1 module on the page with the container, and the container has a named control in it, there will be a conflict. The same goes for any controls in the module. Basically - ASP gets very unhappy if you have 2 controls named the same thing, as it can't identify which one it is. Many(all) asp frameworks prefix the control. Which is why all controls have CONTROLNAME.ClientID, it gives you the name of the control on the client side, which is what is needed by javascript. To get this into the JS, you need to do something like <%= CONTROLNAME.ClientID %> instead of the dnn...txtsel. It will replace it with that value.
The simple answers to your questions are - No it won't work. The ctr364 is the moduleID (I think) on that page, so the likelyhood of DNN assinging something else is nearly 100%.
To handle this situation - There are a few ways. The simplest, if you are writing your own javascript is to embed it in the ascx file. Using this
document.getElementById('<%= txtSel.ClientID %>')
you should be able to access the element. The constraint to this is that the txtSel.ClientID will only work in the ascx file that txtSel is defined in.
Another option is to pass in the clientID to the function you are using. I don't have the code for this off the top of my head, but you could something like
Func('<%...%>')
and have it send the clientID to the function and then the function can access the control from that.
There are other options, I haven't used them yet, so I can't say how well they work. Do some googleing of "ASP javascript clientID" and you'll be able to find them.
Hope that helps some.