document.observe("dom:loaded", function (event) {
	$$("#navigation li.more a").each(function (element) {
		element.observe('click', function (event) {
			// Get the elements
			var li = element.up('li');
			var drop = $(li.getAttribute('id')+'_over');
			var timer;
			
			drop.observe('mouseout', function (event) {
				timer = setTimeout(function () {
					drop.hide();
				}, 750);
			});
			
			drop.observe('mouseover', function (event) {
				clearTimeout(timer);
			});
			
			// Hide all of the navigation items.
			$$("ul[id$='_over']").each(Element.hide);

			// Show the one we just clicked on.
			drop.show();

			// So the browser doesn't move and add that silly #
			event.stop();
		});
	});
	
	$$("a[title='rhyme']").each(function (element) {
		element.addClassName('rhyme');
		element.observe('click', function(event) {
			event.stop();		
			popitup(element.href);
		});
	});
	
	$('styleswitcher').observe('click', function (event) {
		if(document.styleSheets.length > 0) {
			for (var i = 0; i < document.styleSheets.length; i++) {
				document.styleSheets[i].disabled = true;
			}
		}
		Effect.ScrollTo(document.body);
		event.stop();
	});
});

function popitup(url) {
	newwindow=window.open(url,'name','height=400,width=300,scrollbar=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}