window.addEvent('domready', function(){

	$$('#menu .page_item').each(function(menuItem){
		// Make 'em all as wide as their parents
		if(menuItem.getElement('li')){
			menuItem.getElements('li').each(function(item){
				parentItem = item.getParent('li');
				minwidth = parentItem.scrollWidth;
				item.setStyle('min-width', minwidth);
			});	
		}

		if(menuItem.getElement('ul')){	
			menuItem.addEvents({
				'mouseover': function(){
					menuItem.getElement('ul').setStyles({
						'display': 'block'
						});
					menuItem.addClass('focussed');
				},
				'mouseout': function() {
					menuItem.getElement('ul').setStyle('display', 'none');
					menuItem.removeClass('focussed');
				}
			});
		}
	});
	
// Zebra Striping, (container first, then the elements to be given the odd & even classes)

function zebraStripe(container, alternator) { 
		container.getElements(alternator).each(function(el,i) {
		//do regular shading
		var _class = i % 2 ? 'even' : 'odd'; 
		el.addClass(_class);
	});		
}
function zebraTables() { $('main').getElements('table').each(function(table){ zebraStripe(table,'tr'); });} // Zebra Stripe all tables with the .zebraTable class. requires knd-lib.js
zebraTables();
	
	
});