hey there. im currently trying to get a script written that can accomplish an image display based on the entered value of a form. the problem is there are four individual forms that can both be within + or - ranges.

for instance.

Form 1:
Code:
function showImg() {
var val = document.getElementById("form1").value;
// check that the value of val is a valid entry?  A number?
document.getElementById("image1").src = "blank.jpg"
// go through ranges
if (val >= 3.25 && val <= 4.75) {document.getElementById("image1").src = "imageA.gif"}
if (val >= 5.00 && val <= 6.50) {document.getElementById("image1").src = "imageB.gif"}
if (val >= 6.75 && val <= 7.50) {document.getElementById("image1").src = "ImageC.gif"}
if (val >= 7.75) {document.getElementById("image1").src = "imageC2.gif"}
if (val >= -3 && val <= 3) {document.getElementById("image1").src = "ImageD.gif"}
if (val <= -3.25 && val >= -5) {document.getElementById("image1").src = "ImageE.gif"}
if (val <= -5.25 && val >= -6.50) {document.getElementById("image1").src = "imageF.gif"}
if (val <= -6.75 && val >= -7.25) {document.getElementById("image1").src = "imageG.gif"}
if (val <= -7.50) {document.getElementById("image1").src = "imageH.gif"}
}
thats form one. there are three other forms that are all scripted the same. what i'd like to do is have the values taken from all four forms separately and only have the one with the highest value subsequently display its corresponding image.

what needs to be taken into account is that the highest value isn't necessarily the largest positive number. it's just the number that goes the furthest in its respective direction.

-5 for instance is higher than +4

given this it'd probably be necessary to discard the +/- signs altogether, though again in the input process they're necessary.

any advice would be appreciated. thanks so much.