Scrolling menu

I found this article and have been trying to duplicate the menu for my site: http://www.sitepoint.com/article/menu-scrolling-background/
However, I can’t figure out what all the different numbers mean and how that makes my menu move from left to right. If anyone would be willing to help that would be great. Here is the code as well:


xm = 0; 
//function to set the xpos of the movieclip 
function xpos(bar_length,mul) 
{ 
hpos = 0; 
scroll_length = 420; 
incr = bar_length/scroll_length; 
xm = _xmouse; 
if(_xmouse <= 10){xm = 10;} 
if(_xmouse >= 400){xm = 400;} 
scroll_x = hpos - xm; 
scroll_x = scroll_x * mul; 
x_pos = scroll_x * incr; 
x_pos = x_pos + hpos; 
return x_pos; 
} 
 
_root.onEnterFrame = function () 
{ 
// call function xpos 
x_pos = xpos(700,.20); 
with (bg) 
{ 
_x += (x_pos - _x)*.4; 
} 
// call function xpos 
x_pos = xpos(950,.75); 
with (menu) 
{ 
_x += (x_pos - _x)*.4; 
} 
}

I figured out that hpos has something to do with where it shows the slider, cause if I put it at 500 it will show the far left side of my the menu, and 0 puts it in the middle, but I can figure out what all the other numbers are for. I also can’t figure out how to make it slide all the way through my menu, the menu movie clip is 1045 pixels wide. If I set the hpos at 0 then I see the last 3 1/2 menu selections on the left. If it’s at 0 then I can see the last 6 on the right and that’s it. Any help or direction would be very much appreciated. Thanks.