// ==UserScript==
// @name Metro Mojo Page Titles
// @namespace http://dse.webonastick.com/
// @author Darren Stuart Embry http://dse.webonastick.com/
// @include http://www.*mojo.com/*
// ==/UserScript==
//
// This is a Greasemonkey user script.
// To install it, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox, and revisit this script.
//
// If you're still using Internet Explorer, then you just don't love yourself.

// TODO: page titles should indicate "hotbox", "posse", etc.

(function() {
	document.title = document.title.replace(
		/\s+-\s+free\s+personal.*?more$/, ""
	);

	var spans = document.getElementsByTagName("span");
	var smalltopic;
	for (var i = 0; i < spans.length; ++i) {
		if (spans[i].className == "smalltopic") {	
			smalltopic = spans[i];
		}
	}
	if (!smalltopic) return;
	if (!smalltopic.hasChildNodes()) return;
	var node = smalltopic.childNodes[0];
	if (node.nodeType == 3) { /* 3 == Node.TEXT_NODE */
		document.title = node.data + " - " + document.title;
	}
})();
