function Mover2(a){clearTimeout(rndBond);a.style.backgroundColor="DarkOrange";var b;if(a.cellIndex==0)b="1/2 block";else{b=Math.floor((a.cellIndex+1)/2);if(a.cellIndex%2==0)b+="~1/2";b+=" blocks"}var c=document.getElementById("spnBlockCount").innerHTML;if(isNaN(a.innerHTML))if(a.innerHTML.indexOf("'")!=a.innerHTML.length-1)document.getElementById("spnBlockCount").innerHTML=a.innerHTML+'" = '+b;else document.getElementById("spnBlockCount").innerHTML=a.innerHTML+" = "+b;else document.getElementById("spnBlockCount").innerHTML=
a.innerHTML+" = "+b;b=document.getElementById("trBlocks");a=a.cellIndex;document.getElementById("tblBlocks").style.width=a*27.5+27.5+"px"}function Mout2(a){a.style.backgroundColor="Yellow"}var rndBond=null;function SetBond(){rndBond=setTimeout("RandomBond()",1E3)}function RandomBond(){var a=Math.floor(Math.random()*30)+2;a=document.getElementById("trTape").cells[a];Mover2(a);Mout2(a)}
function ConvertToFrac(){var a=parseFloat(document.getElementById("_txtDec").value),b=Math.round(a*32);document.getElementById("spnFrac").innerHTML=ConEng(b,document.getElementById("rbUseFeet").checked);a=" &nbsp;&nbsp; "+(a*0.0254).toFixed(3)+" m &nbsp;&nbsp; "+(a*2.54).toFixed(2)+" cm &nbsp;&nbsp; "+(a*25.4).toFixed(1)+" mm";document.getElementById("spnFrac2").innerHTML=a}
function ConvertToDec(){var a=parseInt(document.getElementById("ddLengthFeet").value)*384;a+=parseInt(document.getElementById("ddLengthInches").value)*32;a+=parseInt(document.getElementById("ddLengthFrac").value);a=a/32;document.getElementById("spnDec").innerHTML=a.toFixed(2)+'"';a=" &nbsp;&nbsp; "+(a*0.0254).toFixed(3)+" m &nbsp;&nbsp; "+(a*2.54).toFixed(2)+" cm &nbsp;&nbsp; "+(a*25.4).toFixed(1)+" mm";document.getElementById("spnDec2").innerHTML=a}
function SetUp(){document.getElementById("ddLengthFeet").selectedIndex=1+Math.floor(Math.random()*3);document.getElementById("ddLengthInches").selectedIndex=Math.floor(Math.random()*12);document.getElementById("ddLengthFrac").selectedIndex=Math.floor(Math.random()*32);document.getElementById("_txtDec").value=(6+Math.random()*30).toFixed(2);ConvertToDec();ConvertToFrac();SetBond()};