Menu with slider and various button widths

I have a horizontal menu with various width buttons such as “home” and “location & hours”.

I’m trying to use this tutorial, but I can’t figure out how to adjust the math to move the slider to the center of my button instead of the top left _x coordinate.

http://www.kirupa.com/developer/mx2004/menu_with_slider.htm

Any ideas please?