User:Jimmy321/monobook.js

/* hide wikipedia links */ function hideextiw { var i = 0; var k = document.links.length; for (i=0;i<k;i++) { if (document.links[i].className == 'extiw') { document.links[i].className='hiddenextiw'; } } }

/* show wikipedia links */ function showextiw { var i = 0; var k = document.links.length; for (i=0;i<k;i++) { if (document.links[i].className == 'hiddenextiw') { document.links[i].className='extiw'; } } }

/* add hide tab */ function addthetab { var a = document.createElement('a'); a.setAttribute('href', 'javascript:;'); a.setAttribute('onClick', 'hideextiw;'); a.appendChild(document.createTextNode('hide'));

var tab = document.createElement('li'); tab.appendChild(a);

var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; tabs.appendChild(tab); }

if (window.addEventListener) window.addEventListener("load",addthetab,false); else if (window.attachEvent) window.attachEvent("onload",addthetab);