/**
* $Id$
*/

/**
* Add menu hover functionality for browser not supporting li:hover, and ensure
* menu widths do not exceed the "max-width" specified in the CSS (for browser
* who don't obey max-width)
*/
$(document).ready(function() {

	// Menu hovering
	$('#nav-main > li').hover(
		function() {
			$(this).find('ul').css('display', 'block');
		},

		function() {
			$(this).find('ul').css('display', 'none');
		}
	);

	// Menu width
	var maxWidth = parseInt($($('#nav-main > li a').get(0)).css('max-width'));
	$('#nav-main > li a').each(function(i, el) {
		$(el).css('display', 'block');
		if($(el).width()>maxWidth) {
			$(el).width(maxWidth);
		}
	});
});
