Restrict a number to a range? (0 - 1, for example)

How would I restrict this variable:


this.mousePercent = _root.portfolio._xmouse/500;

so that it can’t get below 0 or greater than 1?

My brain is fried and I can’t figure it out. :-/