var win=0,gab=0,wall=0,imgShow,totalWalls=0,currentWall=0,currentWindow=0,currentEdit="wall";
function nextWall(){currentWall=wall;currentEdit="wall";document.getElementById("tblWalls").style.display="block";var b=document.createElement("input");b.setAttribute("id","wallLen"+wall);b.setAttribute("width","60");b.setAttribute("class","TxtBox1");b.setAttribute("type","text");b.setAttribute("name","wallLen"+wall);b.onkeypress=CheckNumeric2;var a=document.createElement("a");a.setAttribute("href","javascript:RemoveWall("+wall+");");var c=document.createElement("img");c.setAttribute("src","images/Delete.gif");
c.setAttribute("border","0");c.setAttribute("alt","Remove this wall");a.appendChild(c);var f;c=document.getElementById("tblWalls");c=c.insertRow(c.rows.length);c.setAttribute("id","wallRow"+wall);f=c.insertCell(c.cells.length);f.appendChild(b);f=c.insertCell(c.cells.length);f.appendChild(a);b.focus();wall++;totalWalls++;document.getElementById("spnWallCount").innerHTML=totalWalls;document.getElementById("numWalls").value=wall;if(wall>0)document.getElementById("btnCalc").disabled=false}
function nextWindow(){currentWindow=win;currentEdit="window";document.getElementById("tblWindows").style.display="block";var b=document.createElement("a");b.setAttribute("href","javascript:RemoveWin("+win+");");var a=document.createElement("img");a.setAttribute("src","images/Delete.gif");a.setAttribute("border","0");a.setAttribute("alt","Remove this window");b.appendChild(a);a=document.createElement("input");a.setAttribute("id","winLen"+win);a.setAttribute("name","winLen"+win);a.setAttribute("width",
"60");a.setAttribute("class","TxtBox1");a.setAttribute("type","text");a.onkeypress=CheckNumeric2;var c=document.createElement("input");c.setAttribute("id","winHei"+win);c.setAttribute("name","winHei"+win);c.setAttribute("width","60");c.setAttribute("class","TxtBox1");c.setAttribute("type","text");c.onkeypress=CheckNumeric2;var f=document.createElement("input");f.setAttribute("id","winHead"+win);f.setAttribute("name","winHead"+win);f.setAttribute("type","text");f.setAttribute("width","30");f.setAttribute("class",
"TxtBox2");f.setAttribute("value","10");f.onkeypress=CheckNumeric2;var h=document.createElement("input");h.setAttribute("type","checkbox");h.setAttribute("id","winSill"+win);h.setAttribute("name","winSill"+win);var d=document.createElement("input");d.setAttribute("id","winNum"+win);d.setAttribute("name","winNum"+win);d.setAttribute("type","text");d.setAttribute("width","30");d.setAttribute("class","TxtBox2");d.onkeypress=CheckNumeric2;d.onchange=CountWindows;var e,g;e=document.getElementById("tblWindows");
e=e.insertRow(e.rows.length);e.setAttribute("id","winRow"+win);g=e.insertCell(e.cells.length);g.appendChild(a);g=e.insertCell(e.cells.length);g.appendChild(c);g=e.insertCell(e.cells.length);g.appendChild(f);g=e.insertCell(e.cells.length);g.appendChild(h);g=e.insertCell(e.cells.length);g.appendChild(d);g=e.insertCell(e.cells.length);g.appendChild(b);a.focus();win++;document.getElementById("numWins").value=win;h.checked=document.getElementById("cbHasSills").checked}
function nextGable(){document.getElementById("tblGables").style.display="block";var b=document.createElement("a");b.setAttribute("href","javascript:RemoveGable("+gab+");");b.setAttribute("id","Remove"+gab);var a=document.createElement("img");a.setAttribute("src","images/Delete.gif");a.setAttribute("border","0");a.setAttribute("alt","Remove this gable");b.appendChild(a);a=document.createElement("input");a.setAttribute("id","gabLen"+gab);a.setAttribute("name","gabLen"+gab);a.setAttribute("width","60");
a.setAttribute("class","TxtBox1");a.setAttribute("type","text");a.onkeypress=CheckNumeric2;var c=document.createElement("input");c.setAttribute("id","gabHei"+gab);c.setAttribute("name","gabHei"+gab);c.setAttribute("width","60");c.setAttribute("class","TxtBox1");c.setAttribute("type","text");c.onkeypress=CheckNumeric2;var f=document.createElement("input");f.setAttribute("id","gabLeft"+gab);f.setAttribute("name","gabLeft"+gab);f.setAttribute("type","text");f.setAttribute("width","60");f.setAttribute("class",
"TxtBox1");f.onkeypress=CheckNumeric2;var h=document.createElement("input");h.setAttribute("id","gabBeams"+gab);h.setAttribute("name","gabBeams"+gab);h.setAttribute("type","text");h.setAttribute("width","30");h.setAttribute("class","TxtBox2");h.onkeypress=CheckNumeric2;var d=document.createElement("input");d.setAttribute("id","gabNum"+gab);d.setAttribute("name","gabNum"+gab);d.setAttribute("type","text");d.setAttribute("width","30");d.setAttribute("class","TxtBox2");d.onkeypress=CheckNumeric2;var e,
g;e=document.getElementById("tblGables");e=e.insertRow(e.rows.length);e.setAttribute("id","gabRow"+gab);g=e.insertCell(e.cells.length);g.appendChild(a);g=e.insertCell(e.cells.length);g.appendChild(f);g=e.insertCell(e.cells.length);g.appendChild(c);g=e.insertCell(e.cells.length);g.appendChild(h);g=e.insertCell(e.cells.length);g.appendChild(d);g=e.insertCell(e.cells.length);g.appendChild(b);a.focus();gab++;document.getElementById("numGables").value=gab}
function CheckNumeric2(b){if(document.all){var a=event.keyCode;if(event.srcElement.id.indexOf("_")==0)if(a==46&&event.srcElement.value.indexOf(".")==-1)return true;if(a>47&&a<58)return true;return false}else{a=b.which;if(b.target.id.indexOf("_")==0)if(a==46&&b.target.value.indexOf(".")==-1)return true;if(a>47&&a<58||a==0||a==8)return true;b.preventDefault()}}
function CheckForm(){var b,a,c=document.form1.length,f=0,h=0;for(b=0;b<c;b++){a=document.form1[b];if(a.type=="text"||a.type=="checkbox"){var d=a.value==""?"NULL":a.value;switch(a.id.substring(0,6)){case "winLen":if(!TestValue(d,"winLen")){a.style.background="#ff0000";alert(d+" is not a valid value for  Window Lengths.\nWindow length must be in millimetres by 200\neg: 1800, 2000, 2200 etc\nEnter a valid value or click cross to remove entry");a.style.background="#ffffff";a.focus();a.select();return false}break;
case "winHei":if(!TestValue(d,"winHei")){a.style.background="#ff0000";alert(d+" is not a valid value for  Window Height.\nWindow height must be in millimetres by 100\neg: 1100, 1200, 1300 etc\nEnter a valid value or click cross to remove entry");a.style.background="#ffffff";a.focus();a.select();return false}f=d;break;case "winHea":if(!TestValue(d,"winHead")){a.style.background="#ff0000";alert(d+" is not a valid value for  Window Head.\nWindow head must be in courses\neg: 10, 11, 12 etc\nEnter a valid value or click cross to remove entry");
a.style.background="#ffffff";a.focus();a.select();return false}if(d*200<f){a.style.background="#ff0000";alert("Head height can not be lower than window height\nEnter a valid value or click cross to remove entry");a.style.background="#ffffff";a.focus();a.select();return false}h=d;break;case "winSil":if(a.checked)if(h*200==f){a.style.background="#ff0000";if(!confirm("A window with height of "+f+"\n\rand head at "+h+" courses\n\rcan not have a sill\n\r\n\rRemove sill and Continue?"))return false;a.checked=
false}break;case "winNum":if(!TestValue(d,"winNum")){a.style.background="#ff0000";alert(d+" is not a valid value for  Number of Windows this size.\nNumber of windows must be a plain number\neg: 1, 2, 3 etc\nEnter a valid value or click cross to remove entry");a.style.background="#ffffff";a.focus();a.select();return false}break;case "wallLe":if(!TestValue(d,"wall")){a.style.background="#ff0000";alert(d+" is not a valid value for  Wall Lengths.\nWall length must be in millimetres by 200\neg: 1800, 2000, 2200 etc\nEnter a valid value or click cross to remove entry");
a.style.background="#ffffff";a.focus();a.select();return false}break;case "gabLen":if(!TestValue(d,"wall")){a.style.background="#ff0000";alert(d+" is not a valid value for  Gable Lengths.\nGable length must be in millimetres by 200\neg: 1800, 2000, 2200 etc\nEnter a valid value or click cross to remove entry");a.style.background="#ffffff";a.focus();a.select();return false}break;case "gabLef":if(!TestValue(d,"wall")){a.style.background="#ff0000";alert(d+" is not a valid value for  Gable left length.\nGable left length must be in millimetres by 200\neg: 1800, 2000, 2200 etc\nEnter a valid value or click cross to remove entry");
a.style.background="#ffffff";a.focus();a.select();return false}break;case "gabBea":if(!TestValue(d,"gabBe")){a.style.background="#ff0000";alert(d+" is not a valid value for  Gable bond beams.\nGable bond beams must be a plain number\neg: 1, 2 etc\nEnter a valid value or click cross to remove entry");a.style.background="#ffffff";a.focus();a.select();return false}break;case "gabHei":if(!TestValue(d,"winHei")){a.style.background="#ff0000";alert(d+" is not a valid value for  Gable height.\nGable height must be in millimetres\neg: 1040, 1250 etc\nEnter a valid value or click cross to remove entry");
a.style.background="#ffffff";a.focus();a.select();return false}break;case "gabNum":if(!TestValue(d,"winNum")){a.style.background="#ff0000";alert(d+" is not a valid value for  Mumber of Gables this size.\nNumber of Gables must be a plain number\neg: 1, 2 etc\nEnter a valid value or click cross to remove entry");a.style.background="#ffffff";a.focus();a.select();return false}break}}}return true}
function TestValue(b,a){if(b=="")return false;var c;switch(a){case "winLen":c=/^\d{1,4}00$/;break;case "winHei":c=/^\d{1,2}00$/;break;case "winHead":c=/^\d{1,2}$/;break;case "winNum":c=/^\d{1,2}$/;break;case "gabBe":c=/^\d{1}$/;break;case "wall":return b%200==0&&b>300&&b<1E6}return c!=null?c.test(b):false}function ShowAlert(){alert("Invalid value")}function RemoveWin(b){b=document.getElementById("winRow"+b);if(b!=null){b.parentNode.removeChild(b);CountWindows()}currentEdit="window"}
function RemoveGable(b){b=document.getElementById("gabRow"+b);b!=null&&b.parentNode.removeChild(b)}function RemoveWall(b){b=document.getElementById("wallRow"+b);if(b!=null){b.parentNode.removeChild(b);totalWalls--;document.getElementById("spnWallCount").innerHTML=totalWalls;if(totalWalls==0)document.getElementById("btnCalc").disabled=false}currentEdit="wall"}var showMisc=false;
function ToggleMisc(){var b=document.getElementById("divMisc");if(showMisc){var a=document.form1,c=a.txtMiscStretcher.value+a.txtMiscHalf.value+a.txtMiscKnoc.value+a.txtMiscLintel.value;c+=a.txtMiscKoLintel.value+a.txtMiscCornoc.value+a.txtMiscHH.value+a.txtMiscHHH.value+a.txtMiscSill.value;if(c.length>0){if(confirm("Can not hide Miscelaneaous if values enterred\n\r\n\rClear all input?")){ClearMisc();ToggleMisc()}return}else{b.style.display="none";document.getElementById("spnMisc").innerHTML="Show Miscellaneous";
document.images.imgMisc.src="images/edit.gif"}}else{b.style.display="block";document.getElementById("spnMisc").innerHTML="Hide Miscellaneous";document.images.imgMisc.src="images/Cancel.gif"}showMisc=!showMisc}
function window_onload(){for(var b=document.getElementsByTagName("input"),a=0;a<b.length;a++)if(b[a].type=="text")b[a].onkeypress=CheckNumeric2;b=aWall.length;if(b>0){for(a=0;a<b;a++){nextWall();document.getElementById("wallLen"+a).value=aWall[a]}var c=aWindows.length;b=0;if(c>0){for(a=0;a<c;a+=5){nextWindow();document.getElementById("winLen"+b).value=aWindows[a];document.getElementById("winHei"+b).value=aWindows[a+1];document.getElementById("winHead"+b).value=aWindows[a+2];document.getElementById("winSill"+
b).checked=aWindows[a+3]=="true";document.getElementById("winNum"+b).value=aWindows[a+4];b++}CountWindows()}c=aGables.length;if(c>0)for(a=b=0;a<c;a+=5){nextGable();document.getElementById("gabLen"+b).value=aGables[a];document.getElementById("gabLeft"+b).value=aGables[a+1];document.getElementById("gabHei"+b).value=aGables[a+2];document.getElementById("gabBeams"+b).value=aGables[a+3];document.getElementById("gabNum"+b).value=aGables[a+4];b++}b=document.getElementById("txtMiscStretcher").value+document.getElementById("txtMiscHalf").value;
b+=document.getElementById("txtMiscKnoc").value+document.getElementById("txtMiscCornoc").value;b+=document.getElementById("txtMiscLintel").value+document.getElementById("txtMiscKoLintel").value;b+=document.getElementById("txtMiscHH").value+document.getElementById("txtMiscHHH").value;b+=document.getElementById("txtMiscSill").value;b>0&&ToggleMisc()}else document.getElementById("btnCalc").disabled=true;document.getElementById("pnlResults")!=null&&document.getElementById("pnlResults").focus();if(document.getElementById("txtBullCorners").value>
0||document.getElementById("txtBullEnds").value>0||document.getElementById("txtSquint").value>0)ToggleBull()}function gabLen_onchange(b){alert(b.value)}
function mailJob_onclick(){var b=document.getElementById("divMail"),a=document.createElement("form");a.setAttribute("id","frmMailResults");a.setAttribute("name","frmMailResults");a.setAttribute("action","mailto:");a.setAttribute("method","GET");var c=document.createElement("input");c.setAttribute("type","submit");c.setAttribute("value","Mail Results");var f=document.createElement("input");f.setAttribute("name","subject");f.setAttribute("type","text");f.setAttribute("value","200_Series_Quantity_Results");
var h=document.createElement("textarea");h.setAttribute("name","body");h.value=getBody();a.appendChild(c);a.appendChild(f);a.appendChild(h);b.appendChild(a);a.submit()}
function getBody(){var b=0;b="Estimator_200_Series_results\nTop\n";if(document.getElementById("lblFull")!=null)b+="20.01__Stretcher\t\t"+document.getElementById("lblFull").innerHTML;if(document.getElementById("lblHalf")!=null)b+="\n20.03__Half\t\t"+document.getElementById("lblHalf").innerHTML;if(document.getElementById("lblKnoc")!=null)b+="\n20.20__Knockout\t\t"+document.getElementById("lblKnoc").innerHTML;if(document.getElementById("lblLintel")!=null)b+="\n20.12__Lintel\t\t"+document.getElementById("lblLintel").innerHTML;
if(document.getElementById("lblKoLint")!=null)b+="\n20.28__Knockout-Lintel\t\t"+document.getElementById("lblKoLint").innerHTML;if(document.getElementById("lblCorner")!=null)b+="\n20.21__Corner\t\t"+document.getElementById("lblCorner").innerHTML;if(document.getElementById("lblHH")!=null)b+="\n20.71__Half_Height\t\t"+document.getElementById("lblHH").innerHTML;if(document.getElementById("lblHHH")!=null)b+="\n20.73__Half_Height_Half\t\t"+document.getElementById("lblHHH").innerHTML;if(document.getElementById("lblSill")!=
null)b+="\n20.38__Sill\t\t"+document.getElementById("lblSill").innerHTML;if(document.getElementById("lblBullStretcher")!=null)b+="\n20.713__Bull\t\t"+document.getElementById("lblBullStretcher").innerHTML;if(document.getElementById("lblBullHalf")!=null)b+="\n20.714__Bull_Half\t\t"+document.getElementById("lblBullHalf").innerHTML;if(document.getElementById("lblSquint")!=null)b+="\n20.739__Squint\t\t"+document.getElementById("lblSquint").innerHTML;if(document.getElementById("lblTopTotal")!=null)b+="\nTotal__Top\t\t"+
document.getElementById("lblTopTotal").innerHTML;b+="\n\nBase\n";if(document.getElementById("lblBaseStretcher")!=null)b+="20.01__Stretcher\t\t"+document.getElementById("lblBaseStretcher").innerHTML;if(document.getElementById("lblBaseHalf")!=null)b+="\n20.01__Half\t\t"+document.getElementById("lblBaseHalf").innerHTML;if(document.getElementById("lblBaseKo")!=null)b+="\n20.20__Knockout\t\t"+document.getElementById("lblBaseKo").innerHTML;if(document.getElementById("lblBaseCorner")!=null)b+="\n20.21__Corner\t\t"+
document.getElementById("lblBaseCorner").innerHTML;if(document.getElementById("lblBaseBull")!=null)b+="\n20.713__Bull\t\t"+document.getElementById("lblBaseBull").innerHTML;if(document.getElementById("lblBaseBullHalf")!=null)b+="\n20.714__Bull_Half\t\t"+document.getElementById("lblBaseBullHalf").innerHTML;if(document.getElementById("lblBaseSquint")!=null)b+="\n20.739__Bull_Half\t\t"+document.getElementById("lblBaseSquint").innerHTML;if(document.getElementById("lblBaseTotal")!=null)b+="\nTotal__Base\t\t"+
document.getElementById("lblBaseTotal").innerHTML;if(document.getElementById("lblTotal")!=null)b+="\n\nGrand__Total\t\t"+document.getElementById("lblTotal").innerHTML;b+="\n";if(document.getElementById("lblConcrete")!=null)b+="\nCore_Fill\t\t"+document.getElementById("lblConcrete").innerHTML;if(document.getElementById("lblSteel")!=null)b+="\nHoriz_Steel\t\t"+document.getElementById("lblSteel").innerHTML;if(document.getElementById("lblPallets")!=null)b+="\nPallets\t\t"+document.getElementById("lblPallets").innerHTML;
if(document.getElementById("lblCement")!=null)b+="\nCement\t\t"+document.getElementById("lblCement").innerHTML;if(document.getElementById("lblLoam")!=null)b+="\nLoam\t\t"+document.getElementById("lblLoam").innerHTML;if(document.getElementById("lblArea")!=null)b+="\nArea\t\t"+document.getElementById("lblArea").innerHTML;return b}var showBull=false;
function ToggleBull(){if(showBull){document.getElementById("tblBull").style.display="none";document.getElementById("spnBull").innerHTML="Show Bullnose & Squint";document.images.imgBull.src="images/edit.gif"}else{document.getElementById("tblBull").style.display="block";document.getElementById("spnBull").innerHTML="Hide Bullnose & Squint";document.images.imgBull.src="images/Cancel.gif"}showBull=!showBull}var showSet=false;
function ToggleSet(){if(showSet){document.getElementById("tblSet").style.display="none";document.getElementById("spnSet").innerHTML="Show Settings";document.images.imgSet.src="images/edit.gif"}else{document.getElementById("tblSet").style.display="block";document.getElementById("spnSet").innerHTML="Hide Settings";document.images.imgSet.src="images/Cancel.gif"}showSet=!showSet}
function CbHasHH_onclick(b){b.checked&&alert("This will add a half height course to the bottom of the walls\r\neffectively  'jacking up' the building 100mm\r\nDo not add this extra 100 mm to opening heights")}
function Demo(){if(wall>0||win>0)if(!confirm("This action will overwrite current entries\n\r\n\rContinue?"))return;if(showMisc){ClearMisc();ToggleMisc()}if(document.getElementById("pnlResults")!=null)document.getElementById("pnlResults").style.display="none";ClearWalls();ClearWindows();ClearGables();showSet||ToggleSet();if(confirm("This Demo will Randomly Generate a Job\n\r\n\rKeep clicking OK to step through or Cancel to stop\n\r\n\rClick 'Show Settings' to edit blocks per bag cement\n\rblocks per pallet, blocks per m3 loam etc\n\r\n\rClick 'Hide Settings' to hide\n\r\n\rContinue?")){ToggleSet();
document.getElementById("txtCourses").style.backgroundColor="lawngreen";document.getElementById("ddEnds").value=Math.ceil(Math.random()*2)*2;document.getElementById("ddEnds").style.backgroundColor="lawngreen";document.getElementById("txtSteelDoors").value=Math.floor(Math.random()*3)+1;document.getElementById("txtSteelDoors").style.backgroundColor="lawngreen";document.getElementById("txtStarters").value=Math.floor(Math.random()*40)+60;document.getElementById("txtStarters").style.backgroundColor="lawngreen";
if(confirm("Enter top courses, base courses, ends\n\rbond beams, doors, starters etc\n\r\n\rDoors are standard 800 X 2000 steel frames\n\r\n\r1 single wall has 2 ends\n\r\n\rA 4 walled box has 0 ends\n\r\n\rCheck 'Silll Beams' for bond beams under sills\n\r\n\rStarters are vertical filled cores\n\r\n\rContinue?")){for(var b=0;b<4+Math.ceil(Math.random()*10);b++){nextWall();document.getElementById("wallLen"+b).value=2E3+Math.ceil(Math.random()*100)*200;document.getElementById("wallLen"+b).style.background=
"lawngreen"}if(confirm("Click 'Add Wall' to add wall lengths in millimetres by 200\n\r\n\rClick red cross to remove walls\n\r\n\rContinue?")){var a=0;for(b=0;b<2+Math.ceil(Math.random()*4);b++){nextWindow();document.getElementById("winLen"+a).value=600+Math.ceil(Math.random()*7)*200;document.getElementById("winLen"+a).style.backgroundColor="lawngreen";document.getElementById("winHei"+a).value=600+Math.ceil(Math.random()*7)*100;document.getElementById("winHei"+a).style.backgroundColor="lawngreen";
document.getElementById("winHead"+a).value=10;document.getElementById("winHead"+a).style.backgroundColor="lawngreen";document.getElementById("winNum"+a).value=Math.ceil(Math.random()*3);document.getElementById("winNum"+a).style.backgroundColor="lawngreen";a++}CountWindows();if(confirm("Click 'Add Window' to add Windows / Openings\n\r\n\rWidth in millimetres by 200\n\r\n\rHeight in millimetres by 100\n\r\n\rHead height in courses\n\r\n\rNumber windows this size\n\r\n\rClick red cross to remove window\n\r\n\rContinue?")){document.getElementById("txtMiscStretcher").value=
Math.floor(Math.random()*40)+10;document.getElementById("txtMiscStretcher").style.backgroundColor="lawngreen";document.getElementById("txtMiscHalf").value=Math.floor(Math.random()*20)+10;document.getElementById("txtMiscHalf").style.backgroundColor="lawngreen";document.getElementById("txtMiscKnoc").value=Math.floor(Math.random()*10)+10;document.getElementById("txtMiscKnoc").style.backgroundColor="lawngreen";showMisc||ToggleMisc();if(confirm("Click 'Show Miscellaneous' to enter miscellaneous entries\n\r\n\rClick 'Calculate Quantitiy' to finish\n\r\n\rCalculate now?")){if(CheckForm()){document.getElementById("hdnIsDemo").value=
"true";__doPostBack("btnCalc","")}}else{ClearWalls();ClearWindows();CountWindows();ClearMisc();ToggleMisc();document.getElementById("txtCourses").style.backgroundColor="white";document.getElementById("ddEnds").value=0;document.getElementById("ddEnds").style.backgroundColor="white";document.getElementById("txtSteelDoors").value=0;document.getElementById("txtSteelDoors").style.backgroundColor="white";document.getElementById("txtStarters").value=0;document.getElementById("txtStarters").style.backgroundColor=
"white";document.getElementById("txtMiscStretcher").style.backgroundColor="white";document.getElementById("txtMiscHalf").style.backgroundColor="white";document.getElementById("txtMiscKnoc").style.backgroundColor="white"}}}}}}function ClearWalls(){if(wall>0)for(var b=0;b<wall;b++)RemoveWall(b);wall=0;aWall.length=0;totalWalls=document.getElementById("numWalls").value=0}
function ClearWindows(){if(win>0)for(var b=0;b<win;b++)RemoveWin(b);win=0;aWindows.length=0;wc=document.getElementById("numWins").value=0}function ClearGables(){if(gab>0)for(var b=0;b<gab;b++)RemoveGable(b);gab=0;aGables.length=0;document.getElementById("numGables").value=0}
function ClearMisc(){document.getElementById("txtMiscStretcher").value="";document.getElementById("txtMiscHalf").value="";document.getElementById("txtMiscKnoc").value="";document.getElementById("txtMiscCornoc").value="";document.getElementById("txtMiscLintel").value="";document.getElementById("txtMiscKoLintel").value="";document.getElementById("txtMiscHH").value="";document.getElementById("txtMiscHHH").value="";document.getElementById("txtMiscSill").value=""}
function PrintDataEntry(){window.open("Sheets/Est200DataEntry.htm","Estimator200DataEntry","width=850,height=920,status=no,toolbar=no,menubar=no,location=no").focus()}
function CountWindows(){for(var b=0,a=0,c=0,f=0,h=document.form1.length,d,e=0;e<h;e++){d=document.form1[e];if(d.id.substring(0,6)=="winNum")isNaN(parseInt(d.value))||(b+=parseInt(d.value));if(d.id.substring(0,6)=="winLen")c=parseInt(d.value);if(d.id.substring(0,6)=="winHei")f=parseInt(d.value);if(d.id.substring(0,6)=="winNum")a+=c/1E3*f/1E3*parseInt(d.value)}c=b+" total windows";isNaN(a)||(c+=" Total window area = "+a.toFixed(2)+" m2");document.getElementById("spnWinCount").innerHTML=b;document.getElementById("spnWinCount").title=
c}function CbHasSills_onclick(b){for(var a=document.from1.length,c,f=0;f<a;f++){c=document.form1[f];if(c.id.substring(0,6)=="winSil")c.checked=b.checked}}document.onkeydown=HandleDown;
function HandleDown(b){if(b=b?b:event?event:null)switch(b.keyCode){case 40:currentEdit=="wall"?nextWall():nextWindow();break;case 38:if(currentEdit=="wall"){if(currentWall>-1){RemoveWall(currentWall);currentWall--}}else if(currentWindow>-1){RemoveWin(currentWindow);currentWindow--}break;case 37:currentEdit="wall";break;case 39:currentEdit="window";break}}function ShowBlock(b,a){document.images.imgShowType.src="images/Blocks/"+b+".jpg"}
function HideBlock(){document.images.imgShowType.src="images/1X1.gif"};