Калькулятор для ломбарда бюджет 500 рублей
есть такой вот хреновый код
<SCRIPT type="text/javascript" language="javascript" >
nTimer = 0;
function updateresult()
{ var bufcalc;
nTimer = setTimeout("updateresult()", 1000);
if (this.document.gold_calc.tip_cred.value==3) {
if (this.document.gold_calc.proba.value==430) {ro=50}
if (this.document.gold_calc.proba.value==630) {ro=50}
if (this.document.gold_calc.proba.value==690) {ro=80}
if (this.document.gold_calc.proba.value==840) {ro=90}
if (this.document.gold_calc.proba.value==980) {ro=220}
}
if (this.document.gold_calc.tip_cred.value==15) {
if (this.document.gold_calc.proba.value==430) {ro=120}
if (this.document.gold_calc.proba.value==630) {ro=190}
if (this.document.gold_calc.proba.value==690) {ro=230}
if (this.document.gold_calc.proba.value==840) {ro=360}
if (this.document.gold_calc.proba.value==980) {ro=470}
}
if (this.document.gold_calc.tip_cred.value==30) {
if (this.document.gold_calc.proba.value==430) {ro=70}
if (this.document.gold_calc.proba.value==630) {ro=100}
if (this.document.gold_calc.proba.value==690) {ro=140}
if (this.document.gold_calc.proba.value==840) {ro=240}
if (this.document.gold_calc.proba.value==980) {ro=420}
}
str=this.document.gold_calc.mass.value;
s=isNaN(this.document.gold_calc.mass.value*this.document.gold_calc.proba.value*1.0);
if (s==true)
{
str=str.replace("\,","\.");
}
buf=parseInt(eval(str*this.document.gold_calc.proba.value+ro*str)*100);
s=isNaN(str);
if (s==true)
{
this.document.gold_calc.result.value ="?????";
}
else {
this.document.gold_calc.result.value = buf/100;
}
if ((this.document.gold_calc.result.value<30000) && (this.document.gold_calc.tip_cred.value==3))
{ this.document.gold_calc.prosent.value = "0.6%";
bufcalc=0.6*0.01;}
if ((this.document.gold_calc.result.value<30000) && (this.document.gold_calc.tip_cred.value==15))
{ this.document.gold_calc.prosent.value = "0.55%";
bufcalc=0.55*0.01;}
if ((this.document.gold_calc.result.value<30000) && (this.document.gold_calc.tip_cred.value==30))
{ this.document.gold_calc.prosent.value = "0.5%";
bufcalc=0.5*0.01;}
if ((this.document.gold_calc.result.value>=30000) && (this.document.gold_calc.result.value<100000))
{ this.document.gold_calc.prosent.value = "0.3%";
bufcalc=0.3*0.01;}
if ((this.document.gold_calc.result.value>=100000) && (this.document.gold_calc.result.value<200000))
{ this.document.gold_calc.prosent.value = "0.3%";
bufcalc=0.3*0.01;}
if (this.document.gold_calc.result.value>=200000)
{ this.document.gold_calc.prosent.value = "0.3%";
bufcalc=0.3*0.01;}
bufp=parseInt(eval(buf*bufcalc*0.01)*100);
this.document.gold_calc.proc_d.value = bufp/100;
this.document.gold_calc.proc_30d.value=bufp*30/100;
}
</SCRIPT>
и такой
<Form>
<table width="99%" cellpadding="5" cellspacing="1">
<tr><td><strong>Проба золота: </strong></td> <td> <select name="proba">
<option value=430> 375 </option>
<option value=630> 500 (имп.) </option>
<option selected value=690> 583/585 </option>
<option value=840> 750 </option>
<option value=980> 958 </option>
</select> </td> </tr>
<tr> <td><strong>Вес, в граммах:</strong></td>
<td ><input type="text" name="mass" size="6" MAXLENGTH="5" value=1></td>
</tr>
<tr><td><strong>Вид кредита: </strong></td> <td> <select name="tip_cred">
<option selected value=15> 15 дней</option>
<option value=30> 30 дней </option>
</select> </td> </tr>
</table>
<hr />
<div align="center">
<table border="1" >
<tr bgcolor="#900d1b">
<td colspan="2" align="center"><strong> Сумма, руб.: </strong>
</td>
</tr>
<tr bgcolor="#a42331" >
<td align="center"> <strong>на руки</strong></td>
<td align="center"> <strong>%, за день</strong></td>
</tr>
<tr>
<td align = "center"><input type="text" name="result" style="border:0; font-size:16px; text-align:center;" size="7" readonly > </td>
<td align = "center" ><input type="text" name="proc_d" style="border:0; font-size:16px; text-align:center;" size="7" readonly > </td>
</tr>
<tr bgcolor="#900d1b">
<td colspan="2" align="center"> <strong>Процентная ставка (в день): </strong> </td>
</tr>
<tr>
<td colspan="2" align="center"> <strong ><input type="text" name="prosent" style="border:0; text-align:center;" size="5" value="0%" readonly> </strong></td>
</tr>
</table>
</div>
</form>