Rights to something you do at your 9-5?

I’m going to be starting on a Flash app at my full-time job soon. I came up with the initial idea, and will be doing pretty much all the work on it. There is some very serious potential of selling this app to other schools for a large amount of money. The consulting work involved would also be significant.

My question is…is there any way for me to legally get rights to this application if I do it while at work? I’m sure I will do a large amount of the work during office hours while getting paid. Is there any trick, or legal document, that I can use to have ownership of what I develop?

I’ll probably be contacting a lawyer about this, but I wanted to see if someone here has some experience with situations like this.

Thanks a lot,

SR