// JavaScript Document

function FU_Calculate(){
with(document.weights){
var A1=parseFloat(avoir.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(A1)) A1=0;
Atotal=""+(A1*.91146) ;
if(Atotal.indexOf(".")!=-1) Atotal=""+Atotal.substring(0,Atotal.lastIndexOf(".")+4);
troy.value=""+Atotal+"";
Btotal=""+(A1*28.3495) ;
if(Btotal.indexOf(".")!=-1) Btotal=""+Btotal.substring(0,Btotal.lastIndexOf(".")+4);
gram.value=""+Btotal+"";
Ctotal=""+(A1*437.5) ;
if(Ctotal.indexOf(".")!=-1) Ctotal=""+Ctotal.substring(0,Ctotal.lastIndexOf(".")+4);
grain.value=""+Ctotal+"";
Dtotal=""+(A1*18.2292) ;
if(Dtotal.indexOf(".")!=-1) Dtotal=""+Dtotal.substring(0,Dtotal.lastIndexOf(".")+4);
dwt.value=""+Dtotal+"";
}
return true;
}

function FU_Calculate1(){
with(document.weights){
var A1=parseFloat(troy.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(A1)) A1=0;
Atotal=""+(A1*1.0971) ;
if(Atotal.indexOf(".")!=-1) Atotal=""+Atotal.substring(0,Atotal.lastIndexOf(".")+4);
avoir.value=""+Atotal+"";
Btotal=""+(A1*31.1035) ;
if(Btotal.indexOf(".")!=-1) Btotal=""+Btotal.substring(0,Btotal.lastIndexOf(".")+4);
gram.value=""+Btotal+"";
Ctotal=""+(A1*480) ;
if(Ctotal.indexOf(".")!=-1) Ctotal=""+Ctotal.substring(0,Ctotal.lastIndexOf(".")+4);
grain.value=""+Ctotal+"";
Dtotal=""+(A1*20) ;
if(Dtotal.indexOf(".")!=-1) Dtotal=""+Dtotal.substring(0,Dtotal.lastIndexOf(".")+4);
dwt.value=""+Dtotal+"";
}
return true;
}

function FU_Calculate2(){
with(document.weights){
var A1=parseFloat(gram.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(A1)) A1=0;
Atotal=""+(A1*.03527) ;
if(Atotal.indexOf(".")!=-1) Atotal=""+Atotal.substring(0,Atotal.lastIndexOf(".")+4);
avoir.value=""+Atotal+"";
Btotal=""+(A1*.03215) ;
if(Btotal.indexOf(".")!=-1) Btotal=""+Btotal.substring(0,Btotal.lastIndexOf(".")+4);
troy.value=""+Btotal+"";
Ctotal=""+(A1*15.4324) ;
if(Ctotal.indexOf(".")!=-1) Ctotal=""+Ctotal.substring(0,Ctotal.lastIndexOf(".")+4);
grain.value=""+Ctotal+"";
Dtotal=""+(A1*.643) ;
if(Dtotal.indexOf(".")!=-1) Dtotal=""+Dtotal.substring(0,Dtotal.lastIndexOf(".")+4);
dwt.value=""+Dtotal+"";
}
return true;
}

function FU_Calculate3(){
with(document.weights){
var A1=parseFloat(grain.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(A1)) A1=0;
Atotal=""+(A1*.00228571) ;
if(Atotal.indexOf(".")!=-1) Atotal=""+Atotal.substring(0,Atotal.lastIndexOf(".")+4);
avoir.value=""+Atotal+"";
Btotal=""+(A1*.00208333) ;
if(Btotal.indexOf(".")!=-1) Btotal=""+Btotal.substring(0,Btotal.lastIndexOf(".")+4);
troy.value=""+Btotal+"";
Ctotal=""+(A1*.06479874) ;
if(Ctotal.indexOf(".")!=-1) Ctotal=""+Ctotal.substring(0,Ctotal.lastIndexOf(".")+4);
gram.value=""+Ctotal+"";
Dtotal=""+(A1*.04166667) ;
if(Dtotal.indexOf(".")!=-1) Dtotal=""+Dtotal.substring(0,Dtotal.lastIndexOf(".")+4);
dwt.value=""+Dtotal+"";
}
return true;
}

function FU_Calculate4(){
with(document.weights){
var A1=parseFloat(dwt.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(A1)) A1=0;
Atotal=""+(A1*.054855) ;
if(Atotal.indexOf(".")!=-1) Atotal=""+Atotal.substring(0,Atotal.lastIndexOf(".")+4);
avoir.value=""+Atotal+"";
Btotal=""+(A1*.05) ;
if(Btotal.indexOf(".")!=-1) Btotal=""+Btotal.substring(0,Btotal.lastIndexOf(".")+4);
troy.value=""+Btotal+"";
Ctotal=""+(A1*1.555175) ;
if(Ctotal.indexOf(".")!=-1) Ctotal=""+Ctotal.substring(0,Ctotal.lastIndexOf(".")+4);
gram.value=""+Ctotal+"";
Dtotal=""+(A1*24) ;
if(Dtotal.indexOf(".")!=-1) Dtotal=""+Dtotal.substring(0,Dtotal.lastIndexOf(".")+4);
grain.value=""+Dtotal+"";
}
return true;
}


