if(top!=self)top.location=self.document.location;function Window_onload(){Calculate()}
function Calculate(){for(var o=0;o<2;o++){var p=o==1,b;b=p?document.getElementById("cnvsDovetailR"):document.getElementById("cnvsDovetail");if(b.getContext){var f=(parseFloat(document.getElementById("ddWidthInches").value)*32+parseFloat(document.getElementById("ddWidthFrac").value))*3,c=parseFloat(document.getElementById("ddThickFrac").value)*3,q=parseFloat(document.getElementById("ddPinWidthFrac").value)*3,l=document.getElementById("cbColor").checked,m=parseFloat(document.getElementById("ddPitch").value),
h=c/2,i=240-h,g=240+h,j=i-c;h=g+c;var e=c/m,d=c/2;m=d;var k=c-e*2,n=f-(d*2+q*2+e*4+k*2),a=b.getContext("2d");b.setAttribute("height",480);b.setAttribute("width",f);a.clearRect(0,0,b.width,b.height);if(l){a.fillStyle=p?"#f00":"#00f";a.fillRect(0,0,f,j);a.fillRect(0,h,f,480-h);if(p){a.fillRect(0,j,f,h-j);a.fillStyle="#fff"}else{a.fillStyle="#fff";a.fillRect(0,j,f,h-j);a.fillStyle="#00f"}}a.beginPath();a.moveTo(d,h);a.lineTo(d+e,g);a.lineTo(d-e,j);a.lineTo(d+k+e*3,j);a.lineTo(d+e+k,g);a.lineTo(d+k+e*
2,h);a.closePath();l?a.fill():a.stroke();d+=k+e*2+q;a.beginPath();a.moveTo(d+e,h);a.lineTo(d,g);a.lineTo(d+e*2,j);a.lineTo(d+n-e*2,j);a.lineTo(d+n,g);a.lineTo(d+n-e,h);a.closePath();l?a.fill():a.stroke();d+=n+q;a.beginPath();a.moveTo(d,h);a.lineTo(d+e,g);a.lineTo(d-e,j);a.lineTo(d+k+e*3,j);a.lineTo(d+e+k,g);a.lineTo(d+k+e*2,h);a.closePath();l?a.fill():a.stroke();l||a.strokeRect(0,0,b.width,b.height);a.beginPath();a.moveTo(0,i);a.lineTo(f,i);a.moveTo(0,g);a.lineTo(f,g);a.moveTo(0,i-c);a.lineTo(f,i-
c);a.moveTo(0,g+c);a.lineTo(f,g+c);a.stroke();a.font="22px  Verdana";a.fillStyle="#000";b="X";a.textBaseline="top";c=a.measureText(b).width;c=c/2;i=240-c;g=f/2;if(p){a.fillText(b,m/2-c+k,i);a.fillText(b,g-c,i);a.fillText(b,f-m/2-c-k,i)}else{a.fillText(b,m/2-c,i);a.fillText(b,g-n/2-q/2-c,i);a.fillText(b,g+n/2+q/2-c,i);a.fillText(b,f-m/2-c,i)}a.font="bold 16px  Verdana";a.fillStyle="#fff";b="Print - Fold Over Wood";c=a.measureText(b).width;a.fillText(b,f/2-c/2,20);b="Cut Through Paper Template";c=a.measureText(b).width;
a.fillText(b,f/2-c/2,47);a.fillStyle=l?"#fff":"#000";a.font="bold 36px  Verdana";b=p?"B":"A";c=a.measureText(b).width;a.fillText(b,f/2-c/2,h+6)}}}
function PitchChanged(o){if(o.value=="0"){document.getElementById("rbEvenGapsTails").checked=true;document.getElementById("rbEvenSpacing").checked=true;document.getElementById("spn4t2c").style.display="none";document.getElementById("spnSetTailWidth").style.display="none";document.getElementById("divGapType").style.display="none"}else{document.getElementById("spn4t2c").style.display="block";document.getElementById("spnSetTailWidth").style.display="block";document.getElementById("divGapType").style.display=
"block"}Calculate()};
