Thanks again! The entire page works now! I didn't expect a reply so late, so I am very pleased. I would be working on this all weekend with no result because it wouldn't have occurred to me to move that piece of code or to move it after the head tag.
Why did the old page work with the code above the tag? Did the code belong below the head and just happen to work above the head tag too? What made the difference? Anyway, I appreciate your help!