if (typeof Prototype != "undefined") {
	document.observe("dom:loaded", function() {
		$$("nav ul a").each(function(item) {
			// Does this link have a sibling UL with more than zero child LIs?
			if (item.next("ul")) {
				var listItems = item.next("ul").childElements();
				//alert(item + "\n" + listItems.length);
				
				if (listItems.length > 0) {
					item.observe("click", function(e) {
						$(e).stop();
						
						$(this).up("li").toggleClassName("open");
					});
				}
			}
		});
	});
}

