Not-infinitive sliding menu

I have found this vertical infinite menu, but I would like to apply samo changes on it. I want it to stop in the bottom and on the not (start and end) and not to be infinite anymore.

Can someone help me?
Thanks

 
onEnterFrame = function() {
menu._y += (.5*Stage.height-_ymouse)/5;