I'm looking for some advice about whether I can negotiate intellectual property. I work for a company full-time and do freelance as well. I developed a web app for the company which is now of interest to some organisations we work with. With my company's full permission I may integrate this web app into these organisation's systems with the theory that I charge for the implementation through my freelance work. Although the web app was built specifically for my employers, the entire concept and idea came from me so I would like to retrieve the rights to use the code as I see fit and then pay my employers either a one-off fee or (more likely) a licence fee for every time its used. Is this realistic?

What are your experiences of negotiating IP with existing employers? I can imagine it could be a bit of a minefield!