sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
function getMenuWidth() {
	//main ul of main menu
	var topLevel = new Array();
	//li elements of first level of menu
	var menuItems = new Array();
	//arrays of item number/width values for the sub level menus
	var secLevel =  new Array();
	//used for the class name of current list element to check if it's a parent with submenu
	var cName = new String();
	var itemNum = new String();
	var m = document.getElementById('nav');
	if(m.hasChildNodes()) {
		//set class to remove the preset width and set width with javascript also change class to only javascript class - this might need to move outside the function because it's acting screwy, set it "yesJSMenu" if using the class
		m.className=m.className.replace(new RegExp("noJSMenu"), "");
		topLevel = m.getElementsByTagName('ul');
		if(topLevel[0].getAttribute('class') == 'menu') {
			//alert('it is the top level menu div');
			var t = topLevel[0];
			//now get all the li elements and if they have a class of parent use the class item number to set the width of the child ul element
			menuItems = t.getElementsByTagName('li');
			//iterate over each ul element to see if they are parent items
			for (i=0; i<menuItems.length; i++) {
				cName = menuItems[i].getAttribute('class');
				rExp = new RegExp('parent','i');
				if (cName.match(rExp)) {
					//get width of widest sublevel li element in the next first level drop down
					su = menuItems[i].getElementsByTagName('ul');
					for (a=0; a<su.length; a++) {	
						if (su[a].parentNode.getAttribute('class') == menuItems[i].getAttribute('class')) {
							//alert(su[a].childNodes);
							width = 0;
							for (h=0; h<su[a].childNodes.length; h++) {
								w = su[a].childNodes[h].offsetWidth;
								if (w > width) {
									width = w;
								}
							}
						}
						//get width in ems, 16px:1em scale
						width = (width/16);
						su[a].style.width = (width.toString()+'em');
					}
				}
			}
		}
	} else {
		return false;
	}
}