Almost certainly, this is not allowed. You were paid by the previous employer to generate code (and value) for them, not for your second employer.
Yeah, I totally understand this. However, I can say in my situation that my previous employer would be totally fine with my reusing of non-trade secret code (in fact, I've probably mentioned it to him). If the situation were not so, though, I wonder what I'd do. Probably re-invent the wheel I guess, as I try to do things as ethically as possible. Besides, code always seems better the second time you do it!
_________________________
-Jeff
Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.