// JavaScript Document

/***********************************************

***********************************************/

//******//
function fix(v){
if (!isFinite(v)) return "";
if (v==0) return "0";
st=""+v;
epos=st.indexOf('E');
if (epos==-1) epos=st.indexOf('e');
sdigi=Math.log(Math.abs(v)) / Math.LN10;
sdigif=Math.floor(sdigi);
if (epos==-1){
adjust=Math.pow(10, sdigif-7);
faqs=Math.round(v/adjust);
norst=""+faqs;
if (sdigif<7){
adjust2=Math.pow(10, 7-sdigif);
return (faqs / adjust2);}
else return (faqs*adjust);}
}

function convert()
{
isNS4=(document.layers) ? true : false;
isIE4=(document.all && !document.getElementById) ? true : false;
isIE5=(document.all && document.getElementById) ? true : false;
isNS6=(!document.all && document.getElementById) ? true : false;
myform=document.forms['cform'];
w1=myform.D1.options[myform.D1.selectedIndex].value;
w2=myform.D2.options[myform.D2.selectedIndex].value;
faqsorg=factors[w2]/factors[w1];
resfaqs=myform.T1.value*faqsorg;
if (isIE5 || isNS6){
elm=document.getElementById("N1");
elm2=document.getElementById("N2");
elm.innerHTML=gbrt[w1];
elm2.innerHTML=gbrt[w2];}
if (isNaN(parseFloat(resfaqs)))
myform.T2.value="";
else
{myform.T2.value=fix(parseFloat(resfaqs))+" ";}}


