In a lot of place you are not even allowed to perform the stuff you do at work in your free time, unless they own it outright. I have just signed a new contract for a university, where part of my work would be to create a module for students to match their skills with required skills in other universities for practical periods abroad.
They wanted to lock e out of webdesign because of this, and I had to negotiate hard to maintain the right to do webprogramming in my own time. In the end we agreed upon specifying which projects I would do for the university, and that could would be theirs alone.
In your case -note that we have no idea what you are programming- I would say that you have the moral high ground UNLESS you are developing something so specific to your job that someone who is NOT in your position would not have had the idea to program such an application. Whatever you agree with your employer, get it on paper, and possibly even include a record of the code that you already wrote at home (e.g., burn it to a CD and both sign on that disk), to avoid future nastyness.
But as laser: I am absolutely not a lawyer. But note that employers can in some locations have a lot of rights, especially when it comes to intellectual property & copyright.