rem: if ( nextnode && nextnode.parentNode != node ) nextnode = null; node.insertBefore( item, nextnode ); 
add: if ( nextnode && nextnode.parentNode == node ) node.insertBefore( item, nextnode ); else node.appendChild( item ); 
context: function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) {	var node = document.getElementById(portlet);	if ( !node ) return null;	node = node.getElementsByTagName( "ul" )[0];	if ( !node ) return null;	var link = document.createElement( "a" );	link.appendChild( document.createTextNode( text ) );	link.href = href;	var item = document.createElement( "li" );	item.appendChild( link );	if ( id ) item.id = id;	if ( accesskey ) {		link.setAttribute( "accesskey", accesskey );		tooltip += " ["+accesskey+"]";	}	if ( tooltip ) {		link.setAttribute( "title", tooltip );	}	if ( accesskey && tooltip ) {		updateTooltipAccessKeys( new Array( link ) );	}	if ( nextnode && nextnode.parentNode != node ) nextnode = null;	node.insertBefore( item, nextnode );	return item;}
meta: 7328	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/7328/603f6702603e162a9db06d14984dbca6d0f8208e/wikibits.js/buggy/skins/common/wikibits.js