>The exception occurs in the insertBefore function. You can't mix nodes from different Documents. See http://www.w3.org/DOM/faq.html#moveNode for background and workarounds -- basically, you want importNode rather than cloneNode, if it's available, or a hand-coded equivalent if it isn't.