// ==UserScript==
// @name           Plain Google logo
// @namespace      djce.org.uk/greasemonkey
// @description    Replaces Google's "logo of the day" by the plain one
// @include        http://www.google.co.uk/
// @include        http://www.google.com/
// ==/UserScript==

try {
	var x = document.evaluate(
		'//img',
	       document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null
	);
	for (var i=0; i<x.snapshotLength; ++i)
	{
		var e = x.snapshotItem(i);
		if (e.src.match('/logos/'))
		{
			var old_img = e;
			var new_img = document.createElement("img");
			new_img.setAttribute("src", "http://www.google.com/intl/en_ALL/images/logo.gif");
			new_img.setAttribute("border", "0");

			var p = old_img.parentNode;

			var set_old = function() {
				if (p.firstChild) p.removeChild(p.firstChild);
				p.appendChild(old_img);
			};
			var set_new = function() {
				if (p.firstChild) p.removeChild(p.firstChild);
				p.appendChild(new_img);
			};

			new_img.addEventListener("mouseover", set_old, false);
			old_img.addEventListener("mouseout", set_new, false);

			set_new();
		}
	}

} catch (e) {
	alert("Error: "+e);
}

