User:Sigma 7/modern.js

function domNavToc { var navRight = document.getElementById( 'p-tb' ); if( !navRight ) { alert("can't find sidebar"); return 0;} var len; var articleTags; var navTocElements; var bodyContent = document.getElementById('bodyContent'); if(document.getElementsBySelector) { articleTags = document.getElementsBySelector('#bodyContent div.articletag'); navTocElements = document.getElementsBySelector('#bodyContent div.nav_toc_append');} else if(bodyContent && getElementsByClassName) { articleTags = getElementsByClassName(bodyContent,'div','articletag'); navTocElements = getElementsByClassName(bodyContent,'div','nav_toc_append');} else { return 0;} var hasArticleTags = articleTags.length > 0; if (hasArticleTags) { navRight.innerHTML += ' Article Tags ' var articleTagBox = document.getElementById('articletags');} len = navTocElements.length; for(var i = 0; i < len; i++) { var navTocAppend = navTocElements[i]; if( navTocAppend ) { var navTocAppendClone = navTocAppend.cloneNode(true); var oRegExp = new RegExp("(^|\\s)" + "articletag" + "(\\s|$)"); if(hasArticleTags && oRegExp.test(navTocAppend.className)) { articleTagBox.appendChild(navTocAppendClone);} else { navRight.appendChild(navTocAppendClone);} if(navTocAppendClone.style.display) {thisNavTocClone.style.display = 'block';} if(navTocAppendClone.visibility) {thisNavTocClone.visibility = 'visible';} navTocAppend.parentNode.removeChild(navTocAppend);} } var navToc = document.getElementById( 'p-tb' ); if( !navToc ) { alert("can't refind sidebar"); return 0;} var navToc2 = navToc.cloneNode(true); navToc.parentNode.removeChild(navToc); navRight.appendChild( navToc2 ); navToc2.style.display = 'block';}

setTimeout("domNavToc;", 1000);