Javascript Calculation over 99,000
<p>I have this calculator calcuting the the estimate premium based on sales. It works fine except for when I get to above 99,000 it suddenly starts calculating the constant rate I have defined for 24,999 and under. Does anyone know why this might be happening? Here is the code.</p>

<pre><code>function updatesurchargetotal() {
    document.rater.surchargetotal.value = (document.rater.subtotaltotal.value -0) * (document.rater.surcharge.value -0);
}
function updatepremium() {
    document.rater.premium.value = (document.rater.subtotaltotal.value -0) + (document.rater.surchargetotal.value -0);
}
function updatetax() {
    if (document.rater.state.value=="8" || document.rater.state.value=="29") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="32" || document.rater.state.value=="42") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="6") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="35" || document.rater.state.value=="36" || document.rater.state.value=="37" || document.rater.state.value=="47" || document.rater.state.value=="52" || document.rater.state.value=="56") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="13") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="50") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="18" || document.rater.state.value=="21" || document.rater.state.value=="24" || document.rater.state.value=="23" || document.rater.state.value=="22" || document.rater.state.value=="28" || document.rater.state.value=="34" || document.rater.state.value=="38" || document.rater.state.value=="39" || document.rater.state.value=="46" || document.rater.state.value=="55") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="30" || document.rater.state.value=="40") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="3") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="10") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="26" || document.rater.state.value=="31" || document.rater.state.value=="53") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="5" || document.rater.state.value=="15" || document.rater.state.value=="16" || document.rater.state.value=="49") {
    document.rater.tax.value = 0;
    }
    else if (document.rater.state.value=="27" || document.rater.state.value=="33" || document.rater.state.value=="45" || document.rater.state.value=="48") {
    document.rater.tax.value = 0;
    }
    else {
    document.rater.tax.value = 0;
    }
}
function updatetaxtotal() {
    document.rater.taxtotal.value = (document.rater.tax.value -0) * (document.rater.premium.value -0);
}
function updatetotal() {
    document.rater.total.value = Math.round(((document.rater.premium.value -0) + (document.rater.taxtotal.value -0) + 0) * 100)/100;
}

//SALES FUNCTIONS

function updatesalespremium() {
    if (document.rater.sales.value &gt; "0" &amp;&amp; document.rater.sales.value &lt;= "24999") {
    document.rater.sales_premium.value = (525)
    ;
    }
    else if (document.rater.sales.value &gt; "24999" &amp;&amp; document.rater.sales.value &lt;= "50000") {
    document.rater.sales_premium.value = (document.rater.sales.value / 1000)*25;
    }
    else if (document.rater.sales.value &gt; "50000" &amp;&amp; document.rater.sales.value &lt;= "65000") {
    document.rater.sales_premium.value = (document.rater.sales.value / 1000)*25;
    }
    else if (document.rater.sales.value &gt; "65000" &amp;&amp; document.rater.sales.value &lt;= "80000") {
    document.rater.sales_premium.value = (document.rater.sales.value / 1000)*25;
    }
    else if (document.rater.sales.value &gt; "80000" &amp;&amp; document.rater.sales.value &lt;= "95000") {
    document.rater.sales_premium.value = (document.rater.sales.value / 1000)*25;
    }
    else if (document.rater.sales.value &gt; "95000" &amp;&amp; document.rater.sales.value &lt;= "120000") {
    document.rater.sales_premium.value = (document.rater.sales.value / 1000)*25;
    }
    else {
    document.rater.sales_premium.value = (document.rater.sales.value / 1000)*25;
    }
}
function updatesalespremium2() {
    if (document.rater.sales_premium.value&gt;=100) {
    document.rater.sales_premium2.value = document.rater.sales_premium.value;
    }
    else {
    document.rater.sales_premium2.value = 100;
    }
}
function updatesalestax() {
    document.rater.sales_tax.value = Math.round((document.rater.sales_state.value) * (document.rater.sales_premium2.value) * 100)/100;
}
function updatesalestotal() {
    document.rater.sales_total.value = Math.round((((document.rater.sales_premium2.value -0) + (document.rater.sales_tax.value -0)) + 650) * 100)/100;
}
</code></pre>
