var from=0,to=0,incs=0;function CreateTable(){from=parseInt(document.getElementById("txtFrom").value);GoTable()}
function GoTable(){incs=parseInt(document.getElementById("ddIncs").value);if(from==0)from=incs;var a=parseInt(document.getElementById("ddRows").value),b=parseInt(document.getElementById("ddCols").value);to=from+incs*a*b;for(var g=1,h=document.getElementById("rbFeet").checked,c=document.getElementById("tblResults");c.rows.length>0;)c.deleteRow(c.rows.length-1);c=c.insertRow(0);var f="",d=20;switch(b){case 1:d=0;break;case 2:d=100;break;case 3:d=60;break;case 4:d=40;break;case 5:d=20}for(var e=from;e<
to;e+=incs){f+="<span class='Mtbl'>"+e+"</span> - <span class='Etbl'>"+ConEng(e/0.79375,h)+"</span><br />";if(g%a==0){b=c.insertCell(c.cells.length);b.setAttribute("vAlign","top");b.innerHTML="Millimeters to Imperial<br />"+f;f="";b=c.insertCell(c.cells.length);b.setAttribute("width",d)}g++}}var runs=0;function SetUp(){CreateTable()}function AutoUp(){from+=incs;GoTable()}var upTimer=null;function StartUp(){upTimer=setInterval("AutoUp()",100)}function EndUp(){clearInterval(upTimer)}
function AutoDown(){if(from-incs>0){from-=incs;GoTable()}}var downTimer=null;function StartDown(){downTimer=setInterval("AutoDown()",100)}function EndDown(){clearInterval(downTimer)}function PageUp(){from=to;GoTable()}function PageDown(){var a=parseInt(document.getElementById("ddRows").value),b=parseInt(document.getElementById("ddCols").value);a=a*b;if(from>a){from-=a;GoTable()}}
function PrintTable(){var a=window.open("",null,"width=1000,height=800,status=no,toolbar=no,menubar=yes,scrollbars=yes,location=no"),b=document.getElementById("divResults");a.document.open();a.document.write('<html><head><link href="Styles/Bl2.css" type="text/css" rel="stylesheet"></head><body onload="window.print();window.close();"><div align="center">');a.document.write(b.innerHTML);a.document.write("\n</div></body></html>");a.document.close();a.focus()};
