// ==UserScript==
// @name           xkcd Enhancer
// @namespace      http://freecog.net/2006/
// @description    Shows the "title text" below the comic.
// @include        http://xkcd.com/
// @include        http://www.xkcd.com/
// @include        http://xkcd.com/c*.html
// @include        http://www.xkcd.com/c*.html
// ==/UserScript==


var img = document.getElementById('middleContent').getElementsByTagName('img')[0];
if (!img.title) return;
var p = document.createElement('p');
var s = p.style;
	s.padding = '0';
	s.margin = '-5px auto 0 auto';
	s.width = (img.width - 4*2) + 'px';
	//s.borderBottom = s.borderLeft = s.borderRight = '1px solid black';
	s.padding = '4px';
	s.fontSize = '14px';
	s.minHeight = '34px'; // Don't shift the nav around so much.
	s.fontVariant = 'normal';
p.appendChild(document.createTextNode(img.title));
if (img.nextSibling) {
	img.parentNode.insertBefore(p, img.nextSibling);
} else {
	img.parentNode.appendChild(p);
}