Well, I'm stumped. From both your example code and your actual code, I'm always getting the values you're expecting. For example, startPriceRange gets set to -19590. priceRangeEnd gets set to 74442. priceRange gets (properly) set to 94032.
Tested in Safari, Chrome, and Firefox.Edit:
Is this the part that's confusing you?:
document.write(mileRangeEnd+' - '+startMileRange+' = '+mileMedian+'<br />');
If I'm understanding this correctly, you should be outputting mileRange in that example, not mileMedian.