function Form_onsubmit(){var a=parseInt(document.getElementById("ddWidthFeet").value),c=parseInt(document.getElementById("ddWidthInches").value),d=parseInt(document.getElementById("ddWidthFrac").value),a=a*384+c*32+d,c=parseInt(document.getElementById("ddLengthFeet").value),d=parseInt(document.getElementById("ddLengthInches").value),o=parseInt(document.getElementById("ddLengthFrac").value),c=c*384+d*32+o;if(a>c)return alert("Width cannot be greater than Length"),!1;if(a==c&&(a=parseInt(document.getElementById("ddRafterThickInches").value)*
32+parseInt(document.getElementById("ddRafterThickFrac").value),parseInt(document.getElementById("ddRidgeThickInches").value)*32+parseInt(document.getElementById("ddRidgeThickFrac").value)!=a&&!confirm("With a square building, Ridge Thickness must be the same as\nRafter Thickness, giving a square center Kingpost.\n("+ConEng(a,!1)+" x "+ConEng(a,!1)+")\n\nChange Ridge Thickness to "+ConEng(a,!1)+" and Continie ?")))return!1;a=parseInt(document.getElementById("ddPlateWidthInches").value);c=parseInt(document.getElementById("ddPlateWidthFrac").value);
a=a*32+c;if(a>0&&(c=parseInt(document.getElementById("_txtAngle").value),a*=Math.sin(c/(180/Math.PI)),c=parseInt(document.getElementById("ddRafterDepthInches").value),d=parseInt(document.getElementById("ddRafterDepthFrac").value),(c*32+d)/a<3&&!confirm("Birds mouth depth will be greater than 1/3 rafter depth\n\rThis can significantly weaken rafter\n\r\n\rContinue?")))return!1;a=parseInt(document.getElementById("ddRafterDepthInches").value)*32+parseInt(document.getElementById("ddRafterDepthFrac").value);
if(parseInt(document.getElementById("ddHipDepthInches").value)*32+parseInt(document.getElementById("ddHipDepthFrac").value)<a)alert("Hip Depth must be equal to or greater than Rafter Depth\n\r\n\rHip Depth re-set to "+ConEng(a)),document.getElementById("ddHipDepthInches").selectedIndex=document.getElementById("ddRafterDepthInches").selectedIndex,document.getElementById("ddHipDepthFrac").selectedIndex=document.getElementById("ddRafterDepthFrac").selectedIndex;return!0}
function Window_onload(){DrawRoof();DrawRafter();DrawHip();DrawTemplate();DrawHipDetail();document.getElementById("rbHipChamfer").checked&&DrawHipChamfer();SetInput()}function ChangePitch(){var a=document.getElementById("ddPitchIn12").value;if(a!=0){var c=180/Math.PI,a=Math.atan(a/12)*c;if(a>=2&&a<=50)document.getElementById("_txtAngle").value=a.toFixed(4)}}
function ConvertDecimal(){var a=document.getElementById("txtConverter").value;document.getElementById("spnConverter").innerHTML=ConEng(a*32,!0)}
function CompareOverhang(){var a=document.getElementById("ddOverhangFeet").value*384;a+=document.getElementById("ddOverhangInches").value*32;a+=document.getElementById("ddOverhangFrac").value;var c=document.getElementById("ddOverhangGableFeet").value*384;c+=document.getElementById("ddOverhangGableInches").value*32;c+=document.getElementById("ddOverhangGableFrac").value;a!=c?(document.getElementById("ddOverhangGableFeet").style.backgroundColor="yellow",document.getElementById("ddOverhangGableInches").style.backgroundColor=
"yellow",document.getElementById("ddOverhangGableFrac").style.backgroundColor="yellow"):(document.getElementById("ddOverhangGableFeet").style.backgroundColor="",document.getElementById("ddOverhangGableInches").style.backgroundColor="",document.getElementById("ddOverhangGableFrac").style.backgroundColor="")}function ShowBirdsCalc(){document.getElementById("_txtBirdsmouthAngle").value=document.getElementById("_txtAngle").value;document.getElementById("divBirdsmouth").style.left="160px"}
function HideBirdsCalc(){document.getElementById("divBirdsmouth").style.left="-10000px"}function CalcBirdsSeat(){var a=parseInt(document.getElementById("ddBirdsPlumbInches").value),c=parseInt(document.getElementById("ddBirdsPlumbFrac").value),a=a*32+c,c=GetRangle();if(c!=null)a/=Math.tan(c),document.getElementById("spnSeatCut").innerHTML=ConEng(a,!1)}
function CalcBirdsPlumb(){var a=parseInt(document.getElementById("ddBirdsFootInches").value),c=parseInt(document.getElementById("ddBirdsFootFrac").value),a=a*32+c,c=GetRangle();if(c!=null)a*=Math.tan(c),document.getElementById("spnPlumbCut").innerHTML=ConEng(a,!1)}
function GetRangle(){var a=parseFloat(document.getElementById("_txtBirdsmouthAngle").value);return isNaN(a)?(alert("Please enter a valid number for Angle"),document.getElementById("_txtBirdsmouthAngle").select(),null):a<1||a>45?(alert("Angle must be larger than 1 and smaller than or equal to 45"),document.getElementById("_txtBirdsmouthAngle").select(),null):a/(180/Math.PI)}var RAD=Math.PI/180,lineWidth=6,fontSize=12;
function DrawRoof(){var a=document.getElementById("cnvsRoof");if(a.getContext){var c=a.width-50,d=roofData.split(","),o=parseFloat(d[0]),f=parseFloat(d[1]),q=parseFloat(d[2]),j=parseFloat(d[3]),e=parseFloat(d[4]),h=parseFloat(d[5]),l=parseFloat(d[6]),m=parseFloat(d[7]),n=parseFloat(d[8]),i=parseFloat(d[9]),r=parseFloat(d[10]),t=parseFloat(d[11]),w=parseFloat(d[12]),u=parseFloat(d[13]),v=parseFloat(d[14]),x=parseFloat(d[15]);parseFloat(d[16]);var y=parseFloat(d[17]),B=parseFloat(d[18]),z=parseFloat(d[19]),
F=parseFloat(d[20]),D=parseFloat(d[21]),E=o+x*2,G=f+x*2,d=c*(G/E);a.setAttribute("height",d);var A=c/E,s=0,b=a.getContext("2d");b.fillStyle="#fff";b.strokeStyle="#000";b.beginPath();b.fillRect(0,0,c,d);b.strokeRect(0,0,c,d-1);if(x>0)s=x*A,b.save(),b.fillStyle="#ececec",b.strokeStyle="#c0c0c0",b.shadowOffsetY=8,b.shadowOffsetX=4,b.shadowBlur=8,b.shadowColor="#808080",b.fillRect(s,s,c-s*2,d-s*2),b.restore(),b.strokeRect(s,s,c-s*2,d-s*2);var a=d/2,H=d/4,p=r*A;b.lineWidth=lineWidth;b.font=fontSize-2+
"px Verdana";b.textBaseline="top";if(u>50){b.strokeStyle="#f00";var g=c-a+p,k=d-a+p;for(b.fillStyle="#000";g<c&&v>50;)b.beginPath(),b.moveTo(g,d),b.lineTo(g,k),b.lineTo(c,k),b.stroke(),b.fillText(ConEng(v,!0),g,k-lineWidth/2-fontSize),v-=u,g+=p,k=d-(c-g)}b.font=fontSize+"px Verdana";b.beginPath();b.strokeStyle="#ffa500";b.moveTo(0,0);b.lineTo(a,a);b.moveTo(0,d);b.lineTo(a,a);b.moveTo(c,0);b.lineTo(c-a,a);b.moveTo(c,d);b.lineTo(c-a,a);b.stroke();b.fillStyle="#fff";b.fillRect(c+1,0,lineWidth,lineWidth);
b.fillRect(c+1,d-lineWidth,lineWidth,lineWidth);b.beginPath();b.strokeStyle=D==0?"#7cfc00":"#000";b.moveTo(0,a);b.lineTo(a,a);b.moveTo(c-a,a);b.lineTo(c,a);b.stroke();b.strokeStyle="#7cfc00";b.beginPath();b.moveTo(a,0);b.lineTo(a,d);b.moveTo(c-a,0);b.lineTo(c-a,d);g=a;v=w-2;g+=t>0?t*A:p;for(k=0;k<v;k++)b.moveTo(g,d),b.lineTo(g,a),g+=p;b.stroke();b.strokeStyle="#00f";b.lineWidth=lineWidth*(m/n);b.beginPath();b.moveTo(a-lineWidth/2,a);b.lineTo(c-a+lineWidth/2,a);b.stroke();b.lineWidth=lineWidth;if(z>
180){g=d-1;k=l*RAD;z*=Math.cos(k);z*=A;var C=0;F>0&&(C=F*A*Math.cos(k),g-=C);b.strokeStyle="#00f";b.lineWidth=2;for(b.beginPath();g>a-lineWidth/2;)b.moveTo(C,g),b.lineTo(c-C,g),C+=z,g-=z;b.stroke()}b.strokeStyle="#000";b.lineWidth=1;b.beginPath();b.moveTo(0,d);b.arc(0,d,120,0,315*RAD,!0);b.moveTo(100,d-100);b.lineTo(0,d);b.stroke();b.fillStyle="#000";g=fontSize+4;b.fillText("Hip "+ConEng(e,!0),a/2+lineWidth,H-fontSize);e="Rafters "+ConEng(h,!0)+" long x "+ConEng(i,!1)+" deep x "+ConEng(n,!1)+" thick";
i=b.measureText(e).width;b.fillText(e,c/2-i/2,a-lineWidth/2-g*4);e=t==0?"Adjusted Rafter Spacing "+ConEng(r,!0):"Rafter Spacing "+ConEng(r,!0)+" (2 ends = "+ConEng(t,!0)+")";r=a-lineWidth/2;i=b.measureText(e).width;b.fillText(e,c/2-i/2,r-g*3);e="Creeper Shortening "+ConEng(u,!0);i=b.measureText(e).width;b.fillText(e,c/2-i/2,r-g*2);e="Ridge "+ConEng(j,!0)+" long x "+ConEng(m,!1)+" thick";i=b.measureText(e).width;b.fillText(e,c/2-i/2,r-g);e="Roof area "+y+" ft\u00b2";i=b.measureText(e).width;b.fillText(e,
c-a/2-i/2,2);e="Rafter "+ConEng(h,!0);b.fillText(e,c-a+lineWidth,H);x>0&&(e="Roof Length "+ConEng(E,!0),b.fillText(e,4,a+g*2),e="Roof Width "+ConEng(G,!0),b.fillText(e,4,a+g*3),e="Overhang (level) "+ConEng(x,!0),b.fillText(e,40,2));e="Wall Length "+ConEng(o,!0);i=b.measureText(e).width;b.fillText(e,c/2-i/2,0);e="Angle "+l+"\u00b0";i=b.measureText(e).width;b.fillText(e,c/2-i/2,g);e="Overall Rise From Wall "+ConEng(q,!0);i=b.measureText(e).width;b.fillText(e,c/2-i/2,g*2);b.fillText("Sheathing",40,d-
g*2);b.fillText(B+"\u00b0",40,d-g);D>0&&b.fillText("End Jacks "+ConEng(D,!0),44,r-g);if(document.getElementById("pnlRunning")!=null){b=document.getElementById("cnvsRun");b.setAttribute("height",d);u=document.getElementById("lblRunLength").innerHTML.split(", ");y=0;q=document.getElementById("lblRunWidth").innerHTML.split(", ");j=0;B=document.getElementById("lblRunRidge").innerHTML.split(", ");r=0;h=document.getElementById("lblRunHip").innerHTML.split(", ");l=0;b=b.getContext("2d");b.beginPath();b.fillStyle=
"#f8f8ff";b.strokeStyle="#000";b.fillRect(0,0,c,d);b.strokeRect(0,0,c,d-1);if(x>0)b.save(),b.fillStyle="#f5f5dc",b.strokeStyle="#c0c0c0",b.fillRect(s,s,c-s*2,d-s*2),b.strokeRect(s,s,c-s*2,d-s*2);b.lineWidth=1;b.font="11px Verdana";b.fillStyle="#000";b.textBaseline="top";b.beginPath();b.strokeStyle="#f00";g=s+parseFloat(document.getElementById("txtWallStart").value)*A;for(k=d-g;g<a-10;)b.moveTo(g,d),b.lineTo(g,k),b.lineTo(0,k),e=q[j++],b.fillText(e,2,k+2),b.save(),e=u[y++],i=b.measureText(e).width,
b.translate(g-2,d-6-i),b.rotate(90*RAD),b.fillText(e,0,0),b.restore(),g+=p,k-=p;b.stroke();b.beginPath();b.strokeStyle=m==n?"#080":"#000";b.moveTo(0,a);b.lineTo(a,a);b.moveTo(c-a,a);b.lineTo(c,a);b.stroke();b.beginPath();b.strokeStyle="#080";e=q[j++];b.fillText(e,2,a+2);g=a;b.moveTo(a,0);b.lineTo(a,d);b.save();e=u[y++];i=b.measureText(e).width;b.translate(a-2,d-6-i);b.rotate(90*RAD);b.fillText(e,0,0);b.restore();if(w>1&&o>f){g+=t>0?t*A:p;for(k=0;k<v;k++)b.moveTo(g,d),b.lineTo(g,0),b.save(),e=u[y++],
i=b.measureText(e).width,b.translate(g-2,d-6-i),b.rotate(90*RAD),b.fillText(e,0,0),b.restore(),b.save(),e=B[++r],i=b.measureText(e).width,b.translate(g-2,a-i-4),b.rotate(90*RAD),b.fillText(e,0,0),b.restore(),g+=p;b.moveTo(c-a,0);b.lineTo(c-a,d);b.save();e=u[y++];i=b.measureText(e).width;b.translate(c-a,d-6-i);b.rotate(90*RAD);b.fillText(e,0,0);b.restore();b.save();e=B[++r];i=b.measureText(e).width;b.translate(c-a-2,a-i-4);b.rotate(90*RAD);b.fillText(e,0,0);b.restore()}b.stroke();b.beginPath();b.strokeStyle=
"#f00";g=c-a+p;for(k=a+p;g<c-s&&y<u.length;)b.moveTo(g,d),b.lineTo(g,k),b.lineTo(c,k),b.save(),e=u[y++],i=b.measureText(e).width,b.translate(g-2,d-6-i),b.rotate(90*RAD),b.fillText(e,0,0),b.restore(),g+=p,k+=p;g=c-a+p;k=a+p;for(o=0;o<h.length;o++)b.save(),b.translate(g-4,k-10),b.rotate(-40*RAD),b.fillText(h[l++],0,0),b.restore(),g+=p,k+=p;g=a-p;for(k=a-p;g>s+2;)b.moveTo(g,0),b.lineTo(g,k),b.lineTo(0,k),b.fillText(q[j++],2,k+2),g-=p,k=g;g=c-a+p;for(k=a-p;g<c-s-2;)b.moveTo(g,0),b.lineTo(g,k),b.lineTo(c,
k),g+=p,k-=p;b.stroke();b.lineWidth=3;b.strokeStyle="#ffa500";b.beginPath();b.moveTo(0,0);b.lineTo(a,a);b.moveTo(0,d);b.lineTo(a,a);b.moveTo(c,0);b.lineTo(c-a,a);b.moveTo(c,d);b.lineTo(c-a,a);b.stroke();b.strokeStyle="#00f";b.beginPath();b.moveTo(a,a);b.lineTo(c-a,a);b.stroke()}}}function LineSize(a){a==1&&lineWidth<40?(lineWidth+=4,fontSize=(lineWidth+20)/2,DrawRoof()):a==0&&lineWidth>3&&(lineWidth-=2,fontSize=(lineWidth+20)/2,DrawRoof())}
function DrawRafter(){var a=document.getElementById("cnvsRafter");if(a.getContext){var c=rafterData.split(","),d=parseFloat(c[0]),o=parseFloat(c[1]),f=parseFloat(c[2]),q=parseFloat(c[3]),j=c[4]=="1",e=parseFloat(c[5]),h=c[6],l=90-f,c=a.width,m=a.height-20,n=m/Math.tan(f*RAD),i=j?n:0,a=a.getContext("2d");a.font="13px Verdana";a.textBaseline="top";a.fillStyle="#7cfc00";a.strokeStyle="#000";a.beginPath();a.moveTo(i,0);a.lineTo(c,0);a.lineTo(c-n,m);var r,t,w,j=!1;if(e>0){var u=d/m;w=e/u;r=170-n;var n=
w*Math.sin(l*RAD),v=r+n/Math.tan(f*RAD),x=m-n,y=v+w*Math.cos(l*RAD);t=e*Math.tan(l*RAD);w=d/Math.cos(l*RAD)-t;a.lineTo(y,m);a.lineTo(v,x);a.lineTo(170,0);a.lineTo(r,m);a.lineTo(0,m);d/u/n<2.9&&(j=!0)}else a.lineTo(0,m);a.lineTo(i,0);a.save();a.shadowOffsetY=10;a.shadowBlur=10;a.shadowColor="#c0c0c0";a.fill();a.restore();a.stroke();a.fillStyle="#000";if(e>0)a.fillText(ConEng(h,!0),172,2),h=ConEng(t,!1),l=a.measureText(h).width,a.fillText(h,r-l,m-20),e=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),a.fillText(ConEng(e,
!1),r,m),h="HAP "+ConEng(w,!1),l=a.measureText(h).width,a.fillText(h,r-l,m/2-13);h="Setback "+ConEng(o,!1);l=a.measureText(h).width;a.fillText(h,c-l-2,m+4);h="Plumb cut "+f+"\u00b0";l=a.measureText(h).width;a.fillText(h,c-l-10,2);a.fillText("Rafter "+ConEng(q,!0),2,2);a.fillText("Rafter depth "+ConEng(d,!1),c*0.6,m/2-12);if(j)a.fillStyle="#f00",a.font="bold 16px Verdana",a.fillText("Birdsmouth is Deep !",r+10,m-20)}}
function DrawHip(){var a=document.getElementById("cnvsHip");if(a.getContext){var c=hipData.split(","),d=parseFloat(c[0]),o=parseFloat(c[1]),f=parseFloat(c[2]),q=c[3],j=c[4]=="1",e=parseFloat(c[5]),h=c[6],l=parseFloat(c[7]),c=90-f,m=a.width,n=a.height-20,a=a.getContext("2d");a.font="13px Verdana";a.textBaseline="top";a.fillStyle="#ffa500";a.strokeStyle="#000";a.beginPath();var i=n/Math.tan(f*RAD),r=j?i:0;a.moveTo(r,0);a.lineTo(m,0);a.lineTo(m-i,n);var t,w,u,v,j=!1;if(l>0||e>0){var e=Math.sqrt(e*e+
e*e),x=d/n;t=140-i;i=e/x*Math.sin(c*RAD);l>0&&(i+=l/Math.cos(c*RAD)/x);var y=t+i/Math.tan(f*RAD),B=n-i,z=y+i/Math.tan(c*RAD);v=e*Math.sin(c*RAD);v+=l*Math.cos(c*RAD);w=v/Math.cos(c*RAD);u=v/Math.sin(c*RAD);v=d/Math.cos(c*RAD)-w;a.lineTo(z,n);a.lineTo(y,B);a.lineTo(140,0);a.lineTo(t,n);a.lineTo(0,n);d/x/i<2.9&&(j=!0)}else a.lineTo(0,n);a.lineTo(r,0);a.save();a.shadowOffsetY=10;a.shadowBlur=10;a.shadowColor="#c0c0c0";a.fill();a.restore();a.stroke();a.fillStyle="#000";if(l>0||e>0)a.fillText(ConEng(h,
!0),142,2),e=ConEng(w,!1),h=a.measureText(e).width,a.fillText(e,t-h,n-20),w=Math.sqrt(Math.pow(w,2)+Math.pow(u,2)),a.fillText(ConEng(w,!1),t,n),e="HAP "+ConEng(v,!1),h=a.measureText(e).width,a.fillText(e,t-h,n/2-13);e="Setback "+ConEng(o,!1);h=a.measureText(e).width;a.fillText(e,m-h-2,n+4);e="Plumb cut "+f+"\u00b0";h=a.measureText(e).width;a.fillText(e,m-h-10,2);a.fillText("Hip "+ConEng(q,!0),2,2);a.fillText("Hip Depth "+ConEng(d,!1),m*0.6,n/2-12);a.fillText("Hip Angle "+c.toFixed(1)+"\u00b0",m*0.6,
n/2+8);if(j)a.fillStyle="#f00",a.font="bold 16px Verdana",a.fillText("Birdsmouth is Deep !",t+10,n-20)}}
function DrawTemplate(){var a=document.getElementById("cnvsTemplate");if(a.getContext){var c=templateData.split(","),d=parseFloat(c[0]),o=parseFloat(c[1]),f=parseFloat(c[2]),q=parseFloat(c[3]),j=parseFloat(c[4]),e=parseFloat(c[5]),h=parseFloat(c[6]),l=parseFloat(c[7]),c=parseFloat(c[8]);a.setAttribute("height",400/Math.tan(l*RAD)+18);a=a.getContext("2d");a.font="14px Verdana";a.textBaseline="top";var m=new Image;m.src=document.getElementById("imgAngles").src;a.drawImage(m,0,0);a.beginPath();a.moveTo(0,
0);a.lineTo(400,d);a.fillText("Hip plumb "+o+"\u00b0",416,d-14);a.moveTo(0,0);a.lineTo(400,f);a.fillText("Rafter plumb "+q+"\u00b0",416,f+2);a.moveTo(0,0);a.lineTo(400,j);a.fillText("Hip side cut "+e+"\u00b0",416,j-14);a.moveTo(0,0);a.lineTo(400,h);a.fillText("Creeper side "+l+"\u00b0",416,h);a.stroke();a.fillText("Roof Angle "+c,160,2);a.fillStyle="#ffa500";a.fillRect(400,d-12,14,12);a.fillStyle="#7cfc00";a.fillRect(400,f+2,14,12);a.fillStyle="#ffa500";a.fillRect(400,j-12,14,12);a.fillStyle="#f00";
a.fillRect(400,h+2,14,12)}}
function DrawHipDetail(){var a=document.getElementById("cnvsHipDetail");if(a.getContext){var c=hipDetailData.split(","),d=parseFloat(c[0]),o=parseFloat(c[1]),f=parseFloat(c[2]),c=parseFloat(c[3]),q=a.width-2,j=f*(100/c)+100;a.setAttribute("height",j+18);var e=(j-100)/Math.tan(d*RAD),a=a.getContext("2d");a.beginPath();var h=new Image;h.src=document.getElementById("bgImage1").src;h=a.createPattern(h,"repeat");a.fillStyle=h;a.moveTo(75,1);a.lineTo(1,25);a.lineTo(75,50);a.lineTo(75+e,j);a.lineTo(q,j);
for(var h=0,l=(j-50)/20,m=0;m<21;m++)a.lineTo(q-h,j-m*l),h=h>0?0:Math.random()*40+12;a.lineTo(q-100,1);a.lineTo(75,1);a.fill();a.stroke();a.beginPath();a.moveTo(75,50);a.lineTo(q,50);a.moveTo(1,25);a.lineTo(e,j-25);a.lineTo(75+e,j);a.lineTo(75,50);a.lineTo(1,25);h=new Image;h.src=document.getElementById("bgImage2").src;h=a.createPattern(h,"repeat");a.fillStyle=h;a.fill();a.stroke();a.font="24px Arial";a.textBaseline="top";a.fillStyle="#000";a.fillText(d+"\u00b0",85,50);d=ConEng(f,!1);f=a.measureText(d).width;
a.fillText(d,q-f-40,j/2);d=ConEng(c,!1);f=a.measureText(d).width;a.fillText(d,q-25-f-10,11);a.fillText("Hip Plumb + Side Cuts",q/3,52);d=o+"\u00b0";f=a.measureText(d).width;a.translate(f/2,6);a.rotate(20*RAD);a.fillText(d,50-f,29)}}
function DrawHipChamfer(){var a=hipDetailData.split(",");parseFloat(a[2]);var c=parseFloat(a[3]),d=parseFloat(a[4]),o=ConEng(d*RAD*(c/2),!1),f=document.getElementById("cnvsHipChamfer"),a=f.width,q=f.height-30,j=Math.tan(d*RAD)*(a/2)+2;if(f.getContext){f=f.getContext("2d");f.beginPath();f.moveTo(a/2,1);f.lineTo(0,j);f.lineTo(0,q);for(var e=a/20,h=10,l=0;l<=20;l++)f.lineTo(l*e,q+Math.random()*20+h),h=l%2?10:-10;f.lineTo(a,q);f.lineTo(a,j);f.closePath();f.fillStyle=f.createPattern(document.getElementById("bgImage2"),
"repeat");f.fill();f.stroke();f.beginPath();f.strokeStyle="#fff";f.moveTo(0,j);f.lineTo(a,j);f.moveTo(a/2,0);f.lineTo(a/2,j+40);f.stroke();f.font="18px Arial";f.textBaseline="top";f.fillStyle="#000";f.fillText(d+"\u00b0",4,j+2);f.fillText(o,a/2+4,j+2);f.fillText("Set-Down",a/2+4,j+22);f.font="20px Verdana";d="Hip Backing Angle";o=f.measureText(d).width;f.fillText(d,a/2-o/2,120);d="(bevel)";o=f.measureText(d).width;f.fillText(d,a/2-o/2,150);d=ConEng(c,!1)+" thick";o=f.measureText(d).width;f.fillText(d,
a/2-o/2,220)}}function CommonTemplate(){var a=parseInt(document.getElementById("ddRafterThickInches").value)*32+parseInt(document.getElementById("ddRafterThickFrac").value),c=rafterData.split(",");window.open("Templates/rafter.aspx?rw="+a+"&rd="+c[0]+"&pa="+c[2]+"&m=0")}
function CreeperTemplate(){var a=parseInt(document.getElementById("ddRafterThickInches").value)*32+parseInt(document.getElementById("ddRafterThickFrac").value),c=rafterData.split(","),d=templateData.split(",");window.open("Templates/creeper.aspx?rw="+a+"&rd="+c[0]+"&pa="+c[2]+"&sa="+d[7]+"&m=0")}
function HipTemplate(){var a=parseInt(document.getElementById("ddHipThickInches").value)*32+parseInt(document.getElementById("ddHipThickFrac").value),c=hipData.split(","),d=templateData.split(",");window.open("Templates/hip.aspx?rw="+a+"&rd="+c[0]+"&pa="+c[2]+"&sa="+d[5]+"&m=0")};
