I have allowed for variable width of the dropdown items by doing the following
if (containsClass(h, 'submenu') && !containsClass(h, 'lvl1')) {
c.style.cssText += ';left:'+h.clientWidth+'px;';
}
on the 4th line of the show function (obviously I also have a containsClass function)
This works great for my purposes, but it creates the problem where if you have a 3rd or more level of menu items then they don't stay open correctly but rather just close while you are hovering over them.
I am rather stumped so any help appreciated.