Sliding menu

Hi I am busy with a sliding menu I have used this code on the movie clip

onClipEvent (load) {
xCen = 778/2;
}
onClipEvent (enterFrame) {
x = xCen-_root._xmouse;
_x += x/30;
}

When the mouse goes left the clip goes right and the opposite aswell, but I need to know how to make it stop once the clip gets to either end.

I have attached the file, thanks for any help.