Help! Infinite menu help!

Hi guys,

really need help with the code below, I need the code to ease to a stop rather than an abrupt stop!

Can anyone help?

Thanks in advance.

onClipEvent (load) {
xcenter = 326;
speed = 1 / 10;
}
onClipEvent (mouseDown) {
dragging = true;
}
onClipEvent (mouseUp) {
dragging = false;

}

onClipEvent (enterFrame) {
if (dragging) {
var distance = _root._xmouse - xcenter;
_x += (distance * speed);
if (_x > -325) {
_x = -1305;
}
if (_x < -1305) {
_x = -325;
}
}
}