and I just spotted this
var cost3= eval( document.forms.cost.value );
Don't use eval() unless you have no option, that one line can be the pages Achilles heel.
either use one of the following to make a string number in to a number value
var cost3= document.forms.cost.value - 0;
var cost3= document.forms.cost.value * 1;
var cost3= parseInt( document.forms.cost.value );
var cost3= parseFloat( document.forms.cost.value );
eval is very powerful and very dangerous, that line alone leave the entire page open to injection. A carefully crafted string could gain access to the browser, that in turn could load a larger payload to load the payload to hack your visitors PC.
eval does have its uses and it needs to be used with great care. I see it used as a quick fix but its not, its not meant for the purposes that people use them for, I used it in a script several times as part of a VAT calculator that required a way of stringing together an algorithm that altered based on incremental steps of 2.5 as a percentage and the algorithm had to mine the result to get the answer. That was the right method to use in my script because no function or combination of functions could have slung together a simple test that when eval'd would return the result rather than looping through hundreds of combinations, wanging the string in to eval was saving about 100 lines of code to test the various permutations.
In that example from your code... very poor use of the function, especially having a raw input directly in to it...
What is the data in that field? Maybe a fix if the others suggested are not suitable and i'm barking up the wrong lamppost.