var rateList=new Array(28); rateList[0]=new Array(1,1,0); rateList[1]=new Array(0.92,0.915,1); rateList[2]=new Array(7.72,7.79,0); rateList[3]=new Array(5.045,5.131,0); rateList[4]=new Array(5.618,5.705,0); rateList[5]=new Array(9.034,9.148,0); rateList[6]=new Array(0.05234,0.05306,0); rateList[7]=new Array(0.005559,0.005688,0); rateList[8]=new Array(1.815,1.88,0); rateList[9]=new Array(4.542,4.696,0); rateList[10]=new Array(0.9063,0.9704,0); rateList[11]=new Array(0.1313,0.1421,0); rateList[12]=new Array(10.448,10.603,0); rateList[13]=new Array(6.021,6.127,0); rateList[14]=new Array(0.6151,0.8626,0); rateList[15]=new Array(9.606,9.807,0); rateList[16]=new Array(0.2436,0.25,0); rateList[17]=new Array(0.2384,0.2461,0); rateList[18]=new Array(2105,2000,1); rateList[19]=new Array(5.823,6.083,0); rateList[20]=new Array(0.0665,0.0909,0); rateList[21]=new Array(0.7129,0.7981,0); rateList[22]=new Array(1.105,1.308,0); rateList[23]=new Array(3413,3278,1); rateList[24]=new Array(2.017,2.121,0); rateList[25]=new Array(2.1098,2.3911,0); rateList[26]=new Array(0.331,0.499,0); rateList[27]=new Array(1.974,2.08,0); rateList[28]=new Array(0.0861,0.1163,0); var summoney=new Array(6); for (i=0;i<6;i++){ summoney[i]=0; } function getRate(id){ var s1=$('#rate1'+id).val(); var s2=$('#rate2'+id).val(); var money1=$('#money1'+id).val(); var m1,m2,r,m; midh=0; summoney[id-1]=0; if(s1==s2){ m=($('#money1'+id).val()); r=('1'); }else{ if(s1==0){ r=(rateList[s2][1]); if(rateList[s2][2]==1){ m=(money1*rateList[s2][1]); }else{ m=((money1/rateList[s2][1])); } midh=money1; }else if(s2==0){ r=(rateList[s1][0]); if(rateList[s1][2]==1){ m=(money1/rateList[s1][0]); }else{ m=((money1*rateList[s1][0])); } midh=m; }else{ if(rateList[s1][2]==1){ midh=money1/rateList[s1][0]; m1=1000/rateList[s1][0]; }else{ midh=money1*rateList[s1][0]; m1=1000*rateList[s1][0]; } if(rateList[s2][2]==1){ m=(midh*rateList[s2][1]); m2=m1*rateList[s2][1]; }else{ m=(midh/rateList[s2][1]); m2=m1/rateList[s2][1]; } //r=m2/1000; r=(Math.max(1000/m2,m2/1000)); } } m=String(m); r=String(r); summoney[id-1]=midh; if(m.indexOf('.')!=-1){ m=m.split('.')[0]+'.'+m.split('.')[1].substr(0,1); } if(r.indexOf('.')!=-1){ r=r.split('.')[0]+'.'+r.split('.')[1].substr(0,6); } $('#money2'+id).val(m); $('#rate3'+id).val(r); var summ; summ=0; for (i=0;i<=5;i++){ summ=summ+'+'+summoney[i]; } if (eval(summ)>=120000){ $('#oinfo').slideDown(200); }else{ $('#oinfo').slideUp(200); } }