User:Jgjake2/global.js

function getElementsByClass(elementName, tagname, tclass){ var itemsfound = new Array; var elements = elementName.getElementsByTagName(tagname); for(var i=0;i<elements.length;i++){ if(hasClass(elements[i], tclass)){ itemsfound.push(elements[i]); }	}	return itemsfound; } function insertChatangoSection{ var chatSection = getElementsByClass(document, 'section', 'ChatModule'); chatSection[0].parentNode.removeChild(chatSection[0]); //var section = getElementsByClass(document, 'section', 'LatestPhotosModule'); var section = getElementsByClass(document, 'section', 'WikiaSpotlightsModule'); var newSection = document.createElement("section"); newSection.innerHTML = ' '; newSection.setAttribute('class',"module"); section[0].parentNode.insertBefore(newSection,section[0]); //section[0].parentNode.appendChild(newSection); //INCONTENT_BOXAD_1 //WikiaSpotlightsModule } addOnloadHook(insertChatangoSection);