Intellectual property 101
brlewis: The company holds copyright to all the code you write on company time.In theory, abstract ideas in the code are not patentable.  Patents are supposed to be specific embodiments of ideas.  In practice, you totally need a lawyer if you or the employer are considering patents.