User:Li-sung/monobook.js

function change_title { var restrictions = document.getElementById("restrictions"); var real_title_b = restrictions.getElementsByTagName("b")[0]; if (real_title_b) {   var real_title = real_title_b.innerHTML; restrictions.style.display = "none"; var headings = document.getElementsByTagName("h1"); var pattern = new RegExp("(^|\\s)firstHeading(\\s|$)"); for (i=0; i<headings.length; i++) { if (pattern.test(headings[i].className) ) { headings[i].innerHTML = real_title; }   }  } }

function correctTitle { if (document.getElementById('lowercase')) { var contentDiv = document.getElementById('content'), bodyContentDiv = document.getElementById('bodyContent'), tLowercase = document.getElementById('lowercase').parentNode.parentNode, articleHead = contentDiv.getElementsByTagName('h1')[0], title1 = articleHead.innerHTML.substr(0,1).toLowerCase, titleR = articleHead.innerHTML.slice(1); articleHead.innerHTML = title1 + titleR; bodyContentDiv.removeChild(tLowercase); document.title = title1 + titleR + " - Wikipedia, the free encyclopedia"; } }

if (window.addEventListener) window.addEventListener('load',correctTitle,false); else if (window.attachEvent) window.attachEvent('onload',correctTitle);

window.onload = change_title;