Use this snippet to insert a node after another node. Quite handy in laying out Web pages.
<!– Add this snippet to your existing JavaScripts –>
/* This script and many more are available free online at
The JavaScript Source :: http://javascriptsource.com
Created by: Public Domain */
function insertAfter(parent, node, referenceNode) {
parent.insertBefore(node, referenceNode.nextSibling);
}