window.addEvent('domready', function() {	// Wait to run this until the window is DOM ready
	CreateSliders('#navigation div.parent','div.children');	// Create the left column sliders
});

function CreateSliders(parent_css,child_css) {
	
	var prevFx = null;															// Holds the prior slider so that we can collapse it upon the next click
	
	$('wrapper').getElements(parent_css).each( function( elem ) {				// Loop through the categories
		var list = elem.getElement(child_css);									// Find the child element that is to be slid
		
		if (list) {																// If it exists...
			list.style.display = 'block';										// Make the slider object display (we hid it in CSS to prevent "blinky" page loads
			
			if (list.className != 'children open') {
				var myFx = new Fx.Slide(list, { duration: 400 }).hide();		// Create a new slider object tied to the list
			}
			else {
				var myFx = new Fx.Slide(list, { duration: 400 });		// Create a new slider object tied to the list
				prevFx = myFx;
			}

			elem.getElement('a').addEvents({													// Add events to the parent element
				'click' : function() {											// Add a "click" event
					if (prevFx) { prevFx.slideOut(); }							// If there's a previous element, slide it away
					myFx.cancel();												// Cancel anything happening already
					myFx.toggle();												// Toggle this element (this allows us to close them all again if we want)
					prevFx = myFx;												// Keep this effect as the previous
				}
			});
		}
	})
}

function DoNothing() {
}