var ab=[["meter [m]",1],["kilometer [km]",1000],["hectometer [hm]",100],["decimeter [dm]",0.1],["centimeter",0.01],["millimeter [mm]",0.001],["micrometer [um]",1e-6],["nanometer [nm]",1e-9],["picometer [pm]",1e-12],["angstrom [A]",1e-10],["inch [in]",0.0254],["foot (US) [ft]",0.3048],["yard [yd]",0.9144],["mile (international) [mi]",1609.344],["thou(=mil)",0.0000254],["mil",0.0000254],["nautical mile(international)",1852],["nautical mile(UK)",1853.184],["em (pica)",0.0042333],["parsec [pc]",3.0856776e16],["hand",0.1016],["astronomical unit [AU]",149598550000],["light year",9.460528405e15],["barleycorn",0.008467],["cable",182.88],["chain (surveyor's)",20.116840233680467360934721869444],["ell (UK)",0.875],["fathom [fath]",1.8288],["furlong",201.168]];var bb;function vj(db){var eb=window.onload;if(typeof window.onload!="function"){window.onload=db;}
else{window.onload=function(){eb();db();}
}
;}
function wj(db){var gb=window.onunload;if(typeof window.onunload!="function"){window.onunload=db;}
else{window.onunload=function(){gb();db();}
}
;}
vj(xj);wj(yj);function zj(kb,value,lb){var mb=new Date();mb.setDate(mb.getDate()+lb);document.cookie=kb+"="+escape(value)+((lb==null)?"":";expires="+mb.toGMTString());}
function $j(kb){if(document.cookie.length>0){ob=document.cookie.indexOf(kb+"=");if(ob!=-1){ob=ob+kb.length+1;pb=document.cookie.indexOf(";",ob);if(pb==-1)pb=document.cookie.length;return unescape(document.cookie.substring(ob,pb));}
}
return"";}
function xj(){_j();if(document.getElementById('valuetolength2')){ak();cc_length2();}
}
function _j(){bb=bk();}
function ak(){var tb=ck("selectfromlength2",0);var vb=ck("selecttolength2",0);dk('selectfromlength2',tb);dk('selecttolength2',vb);document.getElementById('valuefromlength2').value=ck("valuefromlength2",1);}
function yj(){if(document.getElementById('valuetolength2')){var xb;xb=document.getElementById('selectfromlength2');zj('selectfromlength2',xb.options[xb.selectedIndex].value,365);xb=document.getElementById('selecttolength2');zj('selecttolength2',xb.options[xb.selectedIndex].value,365);xb=document.getElementById('valuefromlength2');zj('valuefromlength2',xb.value,365);}
}
function dk(yb,zb){var xb=document.getElementById(yb);if((zb>=0)&&(zb<xb.options.length)){xb.selectedIndex=zb;}
}
function ek(_b,X){X=(!X?6:X);return Math.round(_b*Math.pow(10,X))/Math.pow(10,X);}
function ck(ac,bc){var cc=$j(ac);if(cc===false){return bc;}
else{return cc;}
}
function bk(){return parseInt(ck("floatnumber",6));}
function fk(ec){var ValidChars="0123456789.";for(i=0;i<ec.length;i++){if(ValidChars.indexOf(ec.charAt(i))==-1){return false;}
}
return true;}
function ins_length2(fc){document.writeln('<select name="'+fc+'" id="'+fc+'" size="1" onchange="cc_length2()">');for(i=0;i<ab.length;i++){document.writeln('<option value="'+i+'">'+ab[i][0]+'</option>');}
document.writeln('</select>');}
function gk(hc,vv,ic){var jc=ab[hc];var kc=ab[ic];;if(fk(jc[1])){vv=vv*jc[1];}
else{vv=eval(jc[1]);}
if(fk(kc[1])){vv=vv/kc[1];}
else{vv=eval(kc[2]);}
return ek(vv,bb);}
function cc_length2(){var lc=parseFloat(document.getElementById('valuefromlength2').value);if(isNaN(lc)){document.getElementById('valuetolength2').value='';}
else{var tb=document.getElementById('selectfromlength2').selectedIndex;var vb=document.getElementById('selecttolength2').selectedIndex;document.getElementById('valuetolength2').value=gk(tb,lc,vb);mc=document.getElementById('valueresultlength2').tagName;if(mc=="SPAN")document.getElementById('valueresultlength2').innerHTML=lc+" "+nc(document.getElementById('selectfromlength2').options[document.getElementById('selectfromlength2').selectedIndex].text)+" = "+document.getElementById('valuetolength2').value+" "+nc(document.getElementById('selecttolength2').options[document.getElementById('selecttolength2').selectedIndex].text);else
document.getElementById('valueresultlength2').value=lc+" "+nc(document.getElementById('selectfromlength2').options[document.getElementById('selectfromlength2').selectedIndex].text)+" = "+document.getElementById('valuetolength2').value+" "+nc(document.getElementById('selecttolength2').options[document.getElementById('selecttolength2').selectedIndex].text);}
}
function ccb_length2(){var lc=parseFloat(document.getElementById('valuetolength2').value);if(isNaN(lc)){document.getElementById('valuefromlength2').value='';}
else{var tb=document.getElementById('selecttolength2').selectedIndex;var vb=document.getElementById('selectfromlength2').selectedIndex;document.getElementById('valuefromlength2').value=gk(tb,lc,vb);document.getElementById('valueresultlength2').value=document.getElementById('valuefromlength2').value+" "+nc(document.getElementById('selectfromlength2').options[document.getElementById('selectfromlength2').selectedIndex].text)+" = "+lc+" "+nc(document.getElementById('selecttolength2').options[document.getElementById('selecttolength2').selectedIndex].text);}
}
function nc(oc){return oc;var pc;if((oc.indexOf('(')==-1)&&(oc.indexOf('[')==-1))pc=oc.split();else{var qc=oc.indexOf(' ');if(qc==-1)qc=999;var rc=oc.indexOf('(');if(rc==-1)rc=999;var sc=oc.indexOf('[');if(sc==-1)sc=999;var tc=' ';if(rc<qc){tc='(';if(sc<rc){tc='[';}
}
else{tc=' ';if(sc<qc){tc='[';}
}
pc=oc.split(tc);}
return pc[0];}
