What you do for your employer while you work for them belongs to them, unless you have a specific agreement stating otherwise.
While this is close, it's inaccurate in an important (albeit minor, in the context of this discussion) way. The term used here is "work for hire," which means that the copyright to an original creation is owned not by the most direct creator, but by the employer.
Under US copyright law, there are two instances in which work for hire applies. First is the fork I believe you're thinking of: if the work is within the regular scope of one's employment. This is an important distinction; it means that if you're working as an animator for the Simpsons, and spend some of your work time writing a program (that has nothing to do with animating the Simpsons), you own the copyright to that program, not your employers. While there will always be billable hours for lawyers to argue over what is within the scope of anyone's employment,no written agreement stating otherwise is required for an employee to own the copyright to something unrelated to work that he/she creates while on the job.
The second fork of work for hire applies to contractors, rather than regular employees. Under this, the work has to fit one of 9 categories, AND there has to be a signed, written agreement (can't be oral) explicitly stating that the work in question is work-for-hire. Point is the written agreement applies only to contractors not employees, and it has to explicitly state that the work is work for hire, not the other way around.
http://www.copyright.gov/help/faq/faq-definitions.html