function tag_links (container, exclude_url, exclude_class, pre_text, text, post_text, link_class, title) { if (pre_text == null) {pre_text = ' [';} if (text == null) {text = 'b';} if (post_text == null) {post_text = ']';} if (link_class == null) {link_class = 'autolink';} if (title == null) {title = 'metalink';} var con_node = (container != null) ? document.getElementById (container):document; var a_nodes = con_node.getElementsByTagName ('A'); var temp_nodes = new Array (); for (var i = 0; i < a_nodes.length; i++) { temp_nodes[temp_nodes.length] = a_nodes[i]; } for (var i = 0; i < temp_nodes.length; i++) { var a_node = temp_nodes[i]; //check if it's one we created if (a_node.className == 'autolink') {continue;} //check if tag is just an anchor if (a_node.href == '') {continue;} //check if tag is a link to exclude if ((exclude_url != null) && (exclude_url == a_node.href.substr(0,exclude_url.length))) {continue;} if ((exclude_class != null) && (exclude_class == a_node.className)) {continue;} var new_node = document.createElement('A'); new_node.className = link_class; new_node.href = "http://blogdex.media.mit.edu/browseSource.asp?url=" + escape (a_node.href); new_node.target= "_blank"; new_node.appendChild (document.createTextNode(text)); new_node.title = title; var new_div_node = document.createElement ('SPAN'); new_div_node.appendChild (a_node.cloneNode(true)); new_div_node.appendChild (document.createTextNode(pre_text)); new_div_node.appendChild (new_node); new_div_node.appendChild (document.createTextNode(post_text)); a_node.parentNode.replaceChild (new_div_node,a_node); } }