Image pan limits

hey i have a system of navigation buttons that when rollover they send a one two this script below. I am trying to set limits so that the nav cannot go off the image. anyone have any suggestions on how to write in a limit for the image. i have tried many things but nothing works.

i currently have this:
if (_root.map.up2 == 1) {
_root.map._y = _root.map._y+10;

i feel like i should be able to write something like this:

if (_root.map.up2 == 1) {
_root.map._y = _root.map._y+10;
_root.map._y+10 < _root.map._y=1000;

here is my code:

onClipEvent (enterFrame) {
if (_root.map.up == 1) {
_root.map._x = _root.map._x+10;
_root.map._y = _root.map._y+10;
} if (_root.map.up2 == 1) {
_root.map._y = _root.map._y+10;
} if (_root.map.up3 == 1) {
_root.map._x = _root.map._x-10;
_root.map._y = _root.map._y+10;
} if (_root.map.up4 == 1) {
_root.map._x = _root.map._x-10;
} if (_root.map.up5 == 1) {
_root.map._x = _root.map._x-10;
_root.map._y = _root.map._y-10;
} if (_root.map.up6 == 1) {
_root.map._y = _root.map._y-10;
} if (_root.map.up7 == 1) {
_root.map._x = _root.map._x+10;
_root.map._y = _root.map._y-10;
} if (_root.map.up8 == 1) {
_root.map._x = _root.map._x+10;
}
}

onClipEvent (load) {
ease = 5;
}
// 1 = move faster…10 = move slower

onClipEvent (enterFrame) {
if (_root.target_x>1) {
this._x += _root.target_x/ease;
_root.target_x -= _root.target_x/ease;
}
if (_root.target_y>1) {
this._y += _root.target_y/ease;
_root.target_y -= _root.target_y/ease;
}
if (_root.target_x<-1) {
this._x += _root.target_x/ease;
_root.target_x -= _root.target_x/ease;
}
if (_root.target_y<-1) {
this._y += _root.target_y/ease;
_root.target_y -= _root.target_y/ease;
}
}