Note that this problem only occurs because I am making the script live from DHTML. As DHTML cannot interpret the script, I am dumping it into a DIV, which I then make the script live later on with the DOM approach. So, when I want to set the focus on a field, I simply used the same technique by adding one additional DIV, reading its value (which is the field name), and scripting that later in the final script to set the focus.
// If we have to set the focus on a field
if (document.getElementById("IFrameGeneric").contentWindow.document.getElementById("LXFocus"))
{
lcField=document.getElementById("IFrameGeneric").contentWindow.document.getElementById("LXFocus").innerHTML
document.getElementById(lcField).focus()
}