Wraps a node with an anchor (i.e. HyperLink, JavaScript prompt). // 'node' can be an existing node, or a string (id of node) // 'anchor' can be a URL string, or a precreated anchor // 'target' is the target frame to go to, and is optional function anchorWrap(node,anchor,target) { if(!document.createElement) return; var newanchor,parent,sibling; if(typeof(node) == "string") { node = document.getElementById(node); } if(!node || !node.parentNode) return; if(typeof(anchor) == "string") { newanchor = document.createElement("a"); newanchor.href = anchor; } else { newanchor = anchor; } if(!newanchor) return; // if href is not set (which may be the case when it performs a javascript action), set it to #, so the link is seen if(!newanchor.href) newanchor.href = "#"; // if target is defined, set it if(typeof(target) == "string") { newanchor.target = target; } // get the sibling and the parent...