Здравствуйте,в моей программе вводишь данные, результат выводится в итого, помогите сделать, чтобы если было больше 2000 выдавало ошибку, если 2000 и меньше отправляло данные на мыло
<head>
<meta http-equiv="Content-Language" content="en-us">
</head>
<script>
function func()
{
var a;
var b;
var c;
var d;
var i;
var f;
var g;
var h;
var i;
var j;
var k;
var l;
var m;
var n;
a = parseFloat(document.getElementById('result').innerHTML);
b = parseFloat(document.getElementById('result1').innerHTML);
d = parseFloat(document.getElementById('result2').innerHTML);
i = parseFloat(document.getElementById('result3').innerHTML);
f = parseFloat(document.getElementById('result4').innerHTML);
g = parseFloat(document.getElementById('result5').innerHTML);
h = parseFloat(document.getElementById('result6').innerHTML);
i = parseFloat(document.getElementById('result7').innerHTML);
j = parseFloat(document.getElementById('result8').innerHTML);
k = parseFloat(document.getElementById('result9').innerHTML);
l = parseFloat(document.getElementById('result10').innerHTML);
m = parseFloat(document.getElementById('result11').innerHTML);
c = a + b + d + i + f + g + h + i + j + k + l + m;
if (!isNaN(c))
{
document.getElementById('ress').value = c + ' руб.';
}
}
</script>
<table>
<table border="1" width="24%" height="54">
<tr>
<td width="21%" align="center"><b><span lang="ru">Наименование</span></b></td>
<td width="20%" align="center"><b><span lang="ru">Кол-во</span></b></td>
<td align="center" width="21%"><b><span lang="ru">Цена</span></b></td>
</tr>
<tr>
<td height="23" colspan="3">
<p align="center"><b><span lang="ru">Заявка на канцелярские товары</span></b></td>
</tr>
</table>
</table>
<form>
<table>
<tr>
<td><input type="text" required value="Например: Бумага"></td>
<td><input type="text" required value="3" id="a" onkeyup="document.getElementById('result').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('b').value)||0) + ' руб.'" onblur="func()"></td>
<td><input type="text" required value="10" id="b" onkeyup="document.getElementById('result').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('a').value)||0) + ' руб.'" onblur="func()"></td>
<td id="result"></td>
</tr>
<tr>
<td><input type="text" name="T1" size="20"></td>
<td><input type="text" id="c" onkeyup="document.getElementById('result1').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('d').value)||0) + ' руб.'" onblur="func()"></td>
<td><input type="text" id="d" onkeyup="document.getElementById('result1').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('c').value)||0) + ' руб.'" onblur="func()"></td>
<td id="result1"></td>
</tr>
<tr>
<td><input type="text" name="T2" size="20"></td>
<td><input type="text" id="e" onkeyup="document.getElementById('result2').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('f').value)||0) + ' руб.'" onblur="func()"></td>
<td><input type="text" id="f" onkeyup="document.getElementById('result2').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('e').value)||0) + ' руб.'" onblur="func()"></td>
<td id="result2"></td>
</tr>
<tr>
<td><input type="text" name="T3" size="20"></td>
<td><input type="text" id="g" onkeyup="document.getElementById('result3').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('h').value)||0) + ' руб.'" onblur="func()"></td>
<td><input type="text" id="h" onkeyup="document.getElementById('result3').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('g').value)||0) + ' руб.'" onblur="func()"></td>
<td id="result3"></td>
</tr>
<tr>
<td><input type="text" name="T4" size="20"></td>
<td><input type="text" id="i" onkeyup="document.getElementById('result4').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('j').value)||0) + ' руб.'" onblur="func()"></td>
<td><input type="text" id="j" onkeyup="document.getElementById('result4').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('i').value)||0) + ' руб.'" onblur="func()"></td>
<td id="result4"></td>
</tr>
<tr>
<td><input type="text" name="T5" size="20"></td>
<td><input type="text" id="k" onkeyup="document.getElementById('result5').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('l').value)||0) + ' руб.'" onblur="func()"></td>
<td><input type="text" id="l" onkeyup="document.getElementById('result5').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('k').value)||0) + ' руб.'" onblur="func()"></td>
<td id="result5"></td>
</tr>
</table>
<table border="1" width="24%">
<tr>
<td width="21%" align="center"><b><span lang="ru">Наименование</span></b></td>
<td width="20%" align="center"><b><span lang="ru">Кол-во</span></b></td>
<td align="center" width="21%"><b><span lang="ru">Цена</span></b></td>
</tr>
<tr>
<td colspan="3">
<p align="center"><b><span lang="ru">Заявка на хозяйственные товары</span></b></td>
</tr>
</table>
<table>
<tr>
<td><input type="text" name="T11" size="20"></td>
<td>
<input type="text" id="m" onkeyup="document.getElementById('result6').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('n').value)||0) + ' руб.'" onblur="func()" name="T12" size="20"></td>
<td>
<input type="text" id="n" onkeyup="document.getElementById('result6').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('m').value)||0) + ' руб.'" onblur="func()" name="T13" size="20"></td>
<td id="result6"></td>
</tr>
<tr>
<td><input type="text" name="T6" size="20"></td>
<td>
<input type="text" id="o" onkeyup="document.getElementById('result7').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('p').value)||0) + ' руб.'" onblur="func()" name="T14" size="20"></td>
<td>
<input type="text" id="p" onkeyup="document.getElementById('result7').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('o').value)||0) + ' руб.'" onblur="func()" name="T15" size="20"></td>
<td id="result7"></td>
</tr>
<tr>
<td><input type="text" name="T7" size="20"></td>
<td>
<input type="text" id="q" onkeyup="document.getElementById('result8').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('r').value)||0) + ' руб.'" onblur="func()" name="T16" size="20"></td>
<td>
<input type="text" id="r" onkeyup="document.getElementById('result8').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('q').value)||0) + ' руб.'" onblur="func()" name="T17" size="20"></td>
<td id="result8"></td>
</tr>
<tr>
<td><input type="text" name="T8" size="20"></td>
<td>
<input type="text" id="w" onkeyup="document.getElementById('result9').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('x').value)||0) + ' руб.'" onblur="func()" name="T18" size="20"></td>
<td>
<input type="text" id="x" onkeyup="document.getElementById('result9').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('w').value)||0) + ' руб.'" onblur="func()" name="T19" size="20"></td>
<td id="result9"></td>
</tr>
<tr>
<td><input type="text" name="T9" size="20"></td>
<td>
<input type="text" id="y" onkeyup="document.getElementById('result10').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('z').value)||0) + ' руб.'" onblur="func()" name="T20" size="20"></td>
<td>
<input type="text" id="z" onkeyup="document.getElementById('result10').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('y').value)||0) + ' руб.'" onblur="func()" name="T21" size="20"></td>
<td id="result10"></td>
</tr>
<tr>
<td><input type="text" name="T10" size="20"></td>
<td>
<input type="text" id="z1" onkeyup="document.getElementById('result11').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('z2').value)||0) + ' руб.'" onblur="func()" name="T22" size="20"></td>
<td>
<input type="text" id="z2" onkeyup="document.getElementById('result11').innerHTML = (parseFloat(this.value)||0) * (parseFloat(document.getElementById('z1').value)||0) + ' руб.'" onblur="func()" name="T23" size="20"></td>
<td id="result11"></td>
</tr>
</table>
</form>
<p> Итого:
<input type="text" id="ress" name="T24" size="20"> </td>
<tr>
</tr>
</p>
<p> <button>Отправить заявку</button><INPUT TYPE="RESET" VALUE="Очистить форму"> </p>