Do you have access to the server with the older versions of the pages working correctly? From what you have posted and the edits that Dave helped with I'm not so sure that it would work correctly with the older code.
The edits that were made to get it working are exactly rite, thanks for you help and insight on this one Dave.