function setVal(a,b,c){if(a.value==b)a.value=c}function toggleHidden(a){a=document.getElementById(a);a.style.display=a.style.display!="none"?"none":""} function calcWeight(){var a=0;w1=document.weight_form.w1;w1sel=w1.options[w1.selectedIndex].value;w2=document.weight_form.w2;w2sel=w2.options[w2.selectedIndex].value;wv=document.weight_form.wv.value;document.weight_form.wr.value=wv*(w1sel=="g"&&w2sel=="kg"?0.001:w1sel=="g"&&w2sel=="p"?0.00220462262:w1sel=="g"&&w2sel=="s"?1.57473044E-4:w1sel=="kg"&&w2sel=="g"?1E3:w1sel=="kg"&&w2sel=="p"?2.20462262:w1sel=="kg"&&w2sel=="s"?0.157473044:w1sel=="p"&&w2sel=="g"?453.59237:w1sel=="p"&&w2sel=="kg"?0.45359237: w1sel=="p"&&w2sel=="s"?0.0714285714:w1sel=="s"&&w2sel=="g"?6350.29318:w1sel=="s"&&w2sel=="kg"?6.35029318:w1sel=="s"&&w2sel=="p"?14:1)} function calcLength(){var a=0;d1=document.len_form.d1;d1sel=d1.options[d1.selectedIndex].value;d2=document.len_form.d2;d2sel=d2.options[d2.selectedIndex].value;dv=document.len_form.dv.value;document.len_form.dr.value=dv*(d1sel=="mm"&&d2sel=="cm"?0.1:d1sel=="mm"&&d2sel=="m"?0.01:d1sel=="mm"&&d2sel=="in"?0.0393700787402:d1sel=="mm"&&d2sel=="ft"?0.00328083989501:d1sel=="cm"&&d2sel=="mm"?10:d1sel=="cm"&&d2sel=="m"?0.01:d1sel=="cm"&&d2sel=="in"?0.393700787:d1sel=="cm"&&d2sel=="ft"?0.032808399:d1sel=="m"&& d2sel=="mm"?1E3:d1sel=="m"&&d2sel=="cm"?100:d1sel=="m"&&d2sel=="in"?39.3700787:d1sel=="m"&&d2sel=="ft"?3.2808399:d1sel=="in"&&d2sel=="mm"?25.4:d1sel=="in"&&d2sel=="cm"?2.54:d1sel=="in"&&d2sel=="m"?0.0254:d1sel=="in"&&d2sel=="ft"?0.0833333333:d1sel=="ft"&&d2sel=="mm"?304.8:d1sel=="ft"&&d2sel=="cm"?30.48:d1sel=="ft"&&d2sel=="m"?0.3048:d1sel=="ft"&&d2sel=="in"?12:1)} function calcVolume(){var a=0;v1=document.vol_form.v1;v1sel=v1.options[v1.selectedIndex].value;v2=document.vol_form.v2;v2sel=v2.options[v2.selectedIndex].value;vv=document.vol_form.vv.value;document.vol_form.vr.value=vv*(v1sel=="l"&&v2sel=="ukg"?0.219969157:v1sel=="l"&&v2sel=="p"?1.75975326:v1sel=="l"&&v2sel=="usg"?0.264172051:v1sel=="ukg"&&v2sel=="l"?4.54609188:v1sel=="ukg"&&v2sel=="p"?8:v1sel=="ukg"&&v2sel=="usg"?1.20095042:v1sel=="p"&&v2sel=="l"?0.568261485:v1sel=="p"&&v2sel=="ukg"?0.125:v1sel== "p"&&v2sel=="usg"?0.150118802:v1sel=="usg"&&v2sel=="l"?3.7854118:v1sel=="usg"&&v2sel=="ukg"?0.832673844:v1sel=="usg"&&v2sel=="p"?8:1)} function calcTemp(){var a=0;t1=document.temp_form.t1;t1sel=t1.options[t1.selectedIndex].value;t2=document.temp_form.t2;t2sel=t2.options[t2.selectedIndex].value;tv=document.temp_form.tv.value;document.temp_form.tr.value=t1sel=="c"&&t2sel=="f"?tv*1.8+32:t1sel=="c"&&t2sel=="k"?tv-0+273.15:t1sel=="f"&&t2sel=="c"?(tv-32)/1.8:t1sel=="f"&&t2sel=="k"?tv*1.8+305.15:t1sel=="k"&&t2sel=="c"?tv-273.15:t1sel=="k"&&t2sel=="f"?(tv-273.15)*1.8+32:tv} function calcTankVol(){var a=0;a=document.tank_vol_form.tvH.value;var b=document.tank_vol_form.tvW.value,c=document.tank_vol_form.tvL.value;tvUin=document.tank_vol_form.tvUin;input=tvUin.options[tvUin.selectedIndex].value;tvUout=document.tank_vol_form.tvUout;output=tvUout.options[tvUout.selectedIndex].value;a=input=="cm"?c*b*a/1E3:input=="in"?c*2.54*b*2.54*a*2.54/1E3:"Please select a unit for the dimensions of your tank.";output=="ukg"?a*=0.219969157:output=="usg"&&(a*=0.264172051);document.tank_vol_form.tvr.value= a};
