User:Karl Dickman/permalink&cite.js

function cite_permalink {

var qb=document.getElementById('quickbar') var loc=qb.getElementsByTagName('a')[2];// insert before this

var br=document.createElement('br'); var cite=document.createElement('a'); cite.appendChild(document.createTextNode('Cite this article')); cite.href='http://en.wikipedia.org/wiki/Special:Cite/'+wgPageName;

qb.insertBefore(br,loc); qb.insertBefore(cite,loc); } if (window.addEventListener) window.addEventListener('load',cite_permalink,false); else if (window.attachEvent) window.attachEvent('onload',cite_permalink);