IE JavaScript Help?

I’ve got some JavaScript that works great in Gecko browsers and Firefox, but doesn’t work completely in IE. It is supposed to create a new field, then set focus to the field. In IE, it doesn’t set focus to the field.

Example Code

Anyone know of a fix or a work-around?