/***********************************
*	Ashworth Navigation Javascript
*	Developer: Rich Rudzinski
*	Created on: 8/10
***********************************/
// set width of li items
function adjustNav() {
	var navCount = $('#ashworth_nav li.top-level').length;
	var logoWidth = 0;
	var navWidth = Math.floor($('#ashworth_nav')[0].offsetWidth - logoWidth);  // total nav width - width of the logo li
	var liWidth = Math.floor(navWidth/navCount) - ($('#ashworth_nav li.top-level').css('padding-right').replace('px', ''));  // round down the navWidth - the number of nav items and subtract the nav items right padding (divider)
	$('#ashworth_nav li.logo').css('width', logoWidth+'px');  // set logo width
	$('#ashworth_nav li.top-level').css('width', liWidth+'px');  // set nav item width
	
	// add hover for ie6
	if(navigator.appName.match(/Microsoft Internet Explorer/) && navigator.appVersion.match(/MSIE 6.0/)) {
		$('#ashworth_nav li.top-level').hover(function() {
			if($(this).children()[1].tagName.match(/UL/)) {
				$(this).addClass('hover');
			}
		}, function() {
			if($(this).children()[1].tagName.match(/UL/)) {
				$(this).removeClass('hover');
			}
		});
	}
}






