
var iniTensileStrength=58;var iniEmbedDepth=8;var iniHookLength=3;function AnchorBoltClass()
{this.diameterIndex=0;this.anchorType=ETAnchorType[0];this.nutTypeIndex=0;this.embedDepth=iniEmbedDepth;this.hookLength=iniHookLength;this.tensileStrength=iniTensileStrength;this.anchorsWelded=false;this.groutPads=false;}
AnchorBoltClass.prototype.IsAnchorHooked=function()
{return(this.anchorType==="Hooked Bolt");}
AnchorBoltClass.prototype.IsHeadedStud=function()
{return(this.anchorType==="Headed Stud");}
AnchorBoltClass.prototype.GetProperties=function()
{switch(this.anchorType)
{case ETAnchorType[0]:return RodProperties;case ETAnchorType[1]:return BoltProperties;case ETAnchorType[2]:return StudProperties;case ETAnchorType[3]:return RodProperties;}}
AnchorBoltClass.prototype.GetDiameter=function()
{return this.GetProperties()[this.diameterIndex].Diameter;}
AnchorBoltClass.prototype.GetArea=function()
{return this.GetProperties()[this.diameterIndex].Ase;}
AnchorBoltClass.prototype.GetBearingArea=function(){var nutType=ETNutType[this.nutTypeIndex];if(this.IsHeadedStud()){var Abrg=this.GetProperties()[this.diameterIndex]['Abrg'];return Abrg;}
else{var Abrg=this.GetProperties()[this.diameterIndex][nutType.id];return Abrg;}}
var ETDiameter=[{id:"D0250",label:"1/4\""},{id:"D0375",label:"3/8\""},{id:"D0500",label:"1/2\""},{id:"D0625",label:"5/8\""},{id:"D0750",label:"3/4\""},{id:"D0875",label:"7/8\""},{id:"D1000",label:"1\""},{id:"D1125",label:"1-1/8\""},{id:"D1250",label:"1-1/4\""},{id:"D1375",label:"1-3/8\""},{id:"D1500",label:"1-1/2\""},{id:"D1750",label:"1-3/4\""},{id:"D2000",label:"2\""}];var ETAnchorType=["Threaded Rod","Headed Bolt","Headed Stud","Hooked Bolt"];var Abrg_Square=0;var Abrg_HeavySquare=1;var Abrg_Hex=2;var Abrg_HeavyHex=3;var ETNutType=[{id:'Abrg_Square',label:"Square"},{id:'Abrg_HeavySquare',label:"Heavy Square"},{id:'Abrg_Hex',label:"Hex"},{id:'Abrg_HeavyHex',label:"Heavy Hex"}];var RodProperties=[{Diameter:0.250,Ase:0.032,Abrg_Square:0.142,Abrg_HeavySquare:0.201,Abrg_Hex:0.117,Abrg_HeavyHex:0.167},{Diameter:0.375,Ase:0.078,Abrg_Square:0.280,Abrg_HeavySquare:0.362,Abrg_Hex:0.164,Abrg_HeavyHex:0.299},{Diameter:0.500,Ase:0.142,Abrg_Square:0.464,Abrg_HeavySquare:0.569,Abrg_Hex:0.291,Abrg_HeavyHex:0.467},{Diameter:0.625,Ase:0.226,Abrg_Square:0.693,Abrg_HeavySquare:0.822,Abrg_Hex:0.454,Abrg_HeavyHex:0.671},{Diameter:0.750,Ase:0.334,Abrg_Square:0.824,Abrg_HeavySquare:1.121,Abrg_Hex:0.654,Abrg_HeavyHex:0.911},{Diameter:0.875,Ase:0.462,Abrg_Square:1.121,Abrg_HeavySquare:1.465,Abrg_Hex:0.891,Abrg_HeavyHex:1.188},{Diameter:1.000,Ase:0.606,Abrg_Square:1.465,Abrg_HeavySquare:1.855,Abrg_Hex:1.163,Abrg_HeavyHex:1.501},{Diameter:1.125,Ase:0.763,Abrg_Square:1.854,Abrg_HeavySquare:2.291,Abrg_Hex:1.472,Abrg_HeavyHex:1.851},{Diameter:1.250,Ase:0.969,Abrg_Square:2.288,Abrg_HeavySquare:2.773,Abrg_Hex:1.817,Abrg_HeavyHex:2.237},{Diameter:1.375,Ase:1.160,Abrg_Square:2.769,Abrg_HeavySquare:3.300,Abrg_Hex:2.199,Abrg_HeavyHex:2.659},{Diameter:1.500,Ase:1.410,Abrg_Square:3.295,Abrg_HeavySquare:3.873,Abrg_Hex:2.617,Abrg_HeavyHex:3.118},{Diameter:1.750,Ase:1.900,Abrg_Square:0.000,Abrg_HeavySquare:0.000,Abrg_Hex:0.000,Abrg_HeavyHex:4.144},{Diameter:2.000,Ase:2.500,Abrg_Square:0.000,Abrg_HeavySquare:0.000,Abrg_Hex:0.000,Abrg_HeavyHex:5.316}];var BoltProperties=[{Diameter:0.250,Ase:0.032,Abrg_Square:0.092,Abrg_HeavySquare:0.000,Abrg_Hex:0.117,Abrg_HeavyHex:0.000},{Diameter:0.375,Ase:0.078,Abrg_Square:0.206,Abrg_HeavySquare:0.000,Abrg_Hex:0.164,Abrg_HeavyHex:0.000},{Diameter:0.500,Ase:0.142,Abrg_Square:0.366,Abrg_HeavySquare:0.000,Abrg_Hex:0.291,Abrg_HeavyHex:0.467},{Diameter:0.625,Ase:0.226,Abrg_Square:0.572,Abrg_HeavySquare:0.000,Abrg_Hex:0.454,Abrg_HeavyHex:0.671},{Diameter:0.750,Ase:0.334,Abrg_Square:0.824,Abrg_HeavySquare:0.000,Abrg_Hex:0.654,Abrg_HeavyHex:0.991},{Diameter:0.875,Ase:0.462,Abrg_Square:1.121,Abrg_HeavySquare:0.000,Abrg_Hex:0.891,Abrg_HeavyHex:1.188},{Diameter:1.000,Ase:0.606,Abrg_Square:1.465,Abrg_HeavySquare:0.000,Abrg_Hex:1.163,Abrg_HeavyHex:1.501},{Diameter:1.125,Ase:0.763,Abrg_Square:1.854,Abrg_HeavySquare:0.000,Abrg_Hex:1.472,Abrg_HeavyHex:1.851},{Diameter:1.250,Ase:0.969,Abrg_Square:2.228,Abrg_HeavySquare:0.000,Abrg_Hex:1.817,Abrg_HeavyHex:2.237},{Diameter:1.375,Ase:1.160,Abrg_Square:2.769,Abrg_HeavySquare:0.000,Abrg_Hex:2.199,Abrg_HeavyHex:2.659},{Diameter:1.500,Ase:1.410,Abrg_Square:3.295,Abrg_HeavySquare:0.000,Abrg_Hex:2.617,Abrg_HeavyHex:3.118},{Diameter:1.750,Ase:1.900,Abrg_Square:0.000,Abrg_HeavySquare:0.000,Abrg_Hex:3.562,Abrg_HeavyHex:4.144},{Diameter:2.000,Ase:2.500,Abrg_Square:0.000,Abrg_HeavySquare:0.000,Abrg_Hex:4.653,Abrg_HeavyHex:5.316}];var StudProperties=[{Diameter:0.250,Ase:0.049,Abrg:0.147},{Diameter:0.375,Ase:0.110,Abrg:0.331},{Diameter:0.500,Ase:0.196,Abrg:0.589},{Diameter:0.625,Ase:0.307,Abrg:0.920},{Diameter:0.750,Ase:0.442,Abrg:0.785},{Diameter:0.875,Ase:0.601,Abrg:0.884},{Diameter:0.000,Ase:0.000,Abrg:0.000},{Diameter:0.000,Ase:0.000,Abrg:0.000},{Diameter:0.000,Ase:0.000,Abrg:0.000},{Diameter:0.000,Ase:0.000,Abrg:0.000},{Diameter:0.000,Ase:0.000,Abrg:0.000},{Diameter:0.000,Ase:0.000,Abrg:0.000},{Diameter:0.000,Ase:0.000,Abrg:0.000}];var iniRows=3;var iniColumns=3;var iniRowSpacing=4;var iniColSpacing=4;var iniMinPerpEdge=1.5;var iniEdgeDistance=1.5;var iniTopEdge=3;var iniBottomEdge=5;var iniLeftEdge=13.5;var iniRightEdge=75;var Edge={Top:0,Bottom:1,Right:2,Left:3};function AnchorGeometryClass()
{this.rows=iniRows;this.columns=iniColumns;this.rowSpacing=iniRowSpacing;this.colSpacing=iniColSpacing;this.aMinPerpEdge=[iniMinPerpEdge,iniMinPerpEdge,iniMinPerpEdge,iniMinPerpEdge];this.aMinEdgeDistance=[iniEdgeDistance,iniEdgeDistance,iniEdgeDistance,iniEdgeDistance];this.topEdge=iniTopEdge;this.bottomEdge=iniBottomEdge;this.leftEdge=iniLeftEdge;this.rightEdge=iniRightEdge;}
AnchorGeometryClass.prototype.BoltGroupHeight=function()
{return(this.rows-1)*this.rowSpacing;}
AnchorGeometryClass.prototype.BoltGroupWidth=function()
{return(this.columns-1)*this.colSpacing;}
AnchorGeometryClass.prototype.MinPerpendicularEdge=function(edge)
{switch(Number(edge))
{case Edge.Top:case Edge.Bottom:return Math.min(this.leftEdge,this.rightEdge);case Edge.Left:case Edge.Right:return Math.min(this.topEdge,this.bottomEdge);default:return 0.0;}}
AnchorGeometryClass.prototype.MaxEdge=function()
{var M=-1.0;var edgeDistance=[Number(this.topEdge),Number(this.bottomEdge),Number(this.rightEdge),Number(this.leftEdge)];for(var i=0;i<edgeDistance.length;i++)
{if(edgeDistance[i]>M)
{M=edgeDistance[i];}}
return Number(M);}
AnchorGeometryClass.prototype.MaxEdgeToALimit=function(v)
{var M=0;var edgeDistance=[Number(this.topEdge),Number(this.bottomEdge),Number(this.rightEdge),Number(this.leftEdge)];for(var i=0;i<edgeDistance.length;i++)
{if(edgeDistance[i]<v&edgeDistance[i]>M)
{M=edgeDistance[i];}}
return Number(M);}
AnchorGeometryClass.prototype.MinEdge=function()
{var M=1.0e10;var edgeDistance=[Number(this.topEdge),Number(this.bottomEdge),Number(this.rightEdge),Number(this.leftEdge)];for(var i=0;i<edgeDistance.length;i++)
{if(edgeDistance[i]<M)
{M=edgeDistance[i];}}
return Number(M);}
AnchorGeometryClass.prototype.MinSpacing=function()
{return Math.min(this.rowSpacing,this.colSpacing);}
AnchorGeometryClass.prototype.MaxSpacing=function()
{return Math.max(this.rowSpacing,this.colSpacing);}
AnchorGeometryClass.prototype.EdgesLessThan=function(x)
{var N=0;var edgeDistance=[Number(this.topEdge),Number(this.bottomEdge),Number(this.rightEdge),Number(this.leftEdge)];for(var i=0;i<edgeDistance.length;i++)
{if(edgeDistance[i]<x)
{N++;}}
return N;}
AnchorGeometryClass.prototype.NumberOfBolts=function()
{return this.rows*this.columns;}
var iniFc=4;var iniThickness=18;function AnchorConcreteClass()
{this.fc=iniFc;this.thickness=iniThickness;this.barsCrossTensionFailure=false;this.barsPreventTensionBreakout=false;this.shearXNumber4Bars=false;this.shearXStirrups=false;this.shearXNoBreakout=false;this.shearYNumber4Bars=false;this.shearYStirrups=false;this.shearYNoBreakout=false;}
var iniVX=3;var iniVY=3;var iniNZ=10;var ETFactoredLoadSource=["ACI 318-08","ACI 318-08 - Appendix D"];function AnchorLoadClass()
{this.vX=iniVX;this.vY=iniVY;this.nZ=iniNZ;this.categoryCOrHigher=false;this.factorLoadSource=ETFactoredLoadSource[0];}
AnchorLoadClass.prototype.Chapter9=function()
{return(this.factorLoadSource===ETFactoredLoadSource[0]);}
function AnchorACIDesignClass()
{}
AnchorACIDesignClass.prototype.chapter9PhiFactors=[[0.75,0.75],[0.65,0.65],[0.75,0.70],[0.75,0.70]];AnchorACIDesignClass.prototype.appendixCPhiFactors=[[0.80,0.80],[0.75,0.75],[0.85,0.85],[0.85,0.75]];AnchorACIDesignClass.prototype.SeismicFactor=function(highSeismic)
{if(highSeismic)
{return 0.75;}
return 1.0;}
AnchorACIDesignClass.prototype.GetPhiFactor=function(index,condition,chapter9)
{if(chapter9)
{return this.chapter9PhiFactors[index][condition];}
return this.appendixCPhiFactors[index][condition];}
AnchorACIDesignClass.prototype.MaxEdgeDistance=function(oGeometry,oBolt)
{var maxEdge=oGeometry.MaxEdgeToALimit(1.5*oBolt.embedDepth);return maxEdge;}
AnchorACIDesignClass.prototype.NumberOfNearEdges=function(oGeometry,oBolt)
{var h15=1.5*oBolt.embedDepth;return oGeometry.EdgesLessThan(h15);}
AnchorACIDesignClass.prototype.EffectiveEmbed=function(oGeometry,oBolt)
{var embed=oBolt.embedDepth;if(this.NumberOfNearEdges(oGeometry,oBolt)>=3)
{embed=Math.max(this.MaxEdgeDistance(oGeometry,oBolt)/1.5,Math.max(oGeometry.rowSpacing,oGeometry.colSpacing)/3);}
return embed;}
AnchorACIDesignClass.prototype.EdgeEffectTensionFactor=function(oGeometry,oBolt)
{var psi=1.0;if(oGeometry.MinEdge()<=1.5*this.EffectiveEmbed(oGeometry,oBolt))
{psi=0.7+0.3*(oGeometry.MinEdge()/(1.5*this.EffectiveEmbed(oGeometry,oBolt)));}
return psi;}
AnchorACIDesignClass.prototype.Ca2_N=function(oGeometry,oBolt)
{var ca2=1.5*this.EffectiveEmbed(oGeometry,oBolt);var minPerpEdge=0.0;var minGeometryEdge=oGeometry.MinEdge();if(minGeometryEdge===Number(oGeometry.topEdge))
{minPerpEdge=oGeometry.MinPerpendicularEdge(Edge.Top);}
if(minGeometryEdge===Number(oGeometry.bottomEdge))
{minPerpEdge=oGeometry.MinPerpendicularEdge(Edge.Bottom);}
if(minGeometryEdge===Number(oGeometry.rightEdge))
{minPerpEdge=oGeometry.MinPerpendicularEdge(Edge.Right);}
if(minGeometryEdge===Number(oGeometry.leftEdge))
{minPerpEdge=oGeometry.MinPerpendicularEdge(Edge.Left);}
if(minPerpEdge<ca2)
{ca2=minPerpEdge;}
return ca2;}
AnchorACIDesignClass.prototype.Ca2_Vx=function(oGeometry)
{var ca2_vx=oGeometry.MinPerpendicularEdge(Edge.Right);return ca2_vx;}
AnchorACIDesignClass.prototype.Ca2_Vy=function(oGeometry)
{var ca2_vy=oGeometry.MinPerpendicularEdge(Edge.Top);return ca2_vy;}
AnchorACIDesignClass.prototype.InteractionCheck=function(Vua,phiVn,Nua,phiNn)
{var InteractionValue=Math.pow((Math.abs(Nua)/Math.abs(phiNn)),(5/3))+
Math.pow((Math.abs(Vua)/Math.abs(phiVn)),(5/3));return InteractionValue;}
AnchorACIDesignClass.prototype.Nsa=function(oBolt,oGeometry)
{var nsa=oGeometry.NumberOfBolts()*oBolt.GetArea()*oBolt.tensileStrength;return nsa;}
AnchorACIDesignClass.prototype.Ncb=function(oGeometry,oBolt,fpc)
{var ncb=this.Anc(oGeometry,oBolt)/this.Anco(oGeometry,oBolt)*this.EdgeEffectTensionFactor(oGeometry,oBolt)*this.Nb(oGeometry,oBolt,fpc);return ncb;}
AnchorACIDesignClass.prototype.Anco=function(oGeometry,oBolt)
{var anco=9*Math.pow(this.EffectiveEmbed(oGeometry,oBolt),2.0);return anco;}
AnchorACIDesignClass.prototype.Anc=function(oGeometry,oBolt)
{var h15=1.5*this.EffectiveEmbed(oGeometry,oBolt);var edgeTop=Math.min(h15,oGeometry.topEdge);var edgeBottom=Math.min(h15,oGeometry.bottomEdge);var edgeRight=Math.min(h15,oGeometry.rightEdge);var edgeLeft=Math.min(h15,oGeometry.leftEdge);var Anc=(edgeTop+oGeometry.BoltGroupHeight()+edgeBottom)*(edgeLeft+oGeometry.BoltGroupWidth()+edgeRight);if(Anc>oGeometry.NumberOfBolts()*this.Anco(oGeometry,oBolt))
{Anc=oGeometry.NumberOfBolts()*this.Anco(oGeometry,oBolt);}
return Anc;}
AnchorACIDesignClass.prototype.Nb=function(oGeometry,oBolt,fpc){var Nb=(24*Math.sqrt(fpc*1000)*Math.pow(this.EffectiveEmbed(oGeometry,oBolt),1.5))/1000;var areEmbedLimitsMet=false;if(this.EffectiveEmbed(oGeometry,oBolt)>=11&&this.EffectiveEmbed(oGeometry,oBolt)<=25){areEmbedLimitsMet=true;}
switch(oBolt.anchorType){case ETAnchorType[0]:if(areEmbedLimitsMet===true){Nb=(16*Math.sqrt(fpc*1000)*Math.pow(this.EffectiveEmbed(oGeometry,oBolt),5.0/3.0))/1000;}
break;case ETAnchorType[1]:if(areEmbedLimitsMet===true){Nb=(16*Math.sqrt(fpc*1000)*Math.pow(this.EffectiveEmbed(oGeometry,oBolt),5.0/3.0))/1000;}
break;case ETAnchorType[2]:if(areEmbedLimitsMet===true){Nb=(16*Math.sqrt(fpc*1000)*Math.pow(this.EffectiveEmbed(oGeometry,oBolt),5.0/3.0))/1000;}
break;}
return Nb;}
AnchorACIDesignClass.prototype.considerSideFaceBlowout=function(oGeometry,oBolt,ca1)
{if(oBolt.IsAnchorHooked())
{return false;}
var a=false;var isLessThanHef=false;if(ca1<0.4*oBolt.embedDepth)
{isLessThanHef=true;}
if(oGeometry.NumberOfBolts()===1)
{if(isLessThanHef===true)
{a=true;}}
if(oGeometry.NumberOfBolts()>1)
{if(isLessThanHef===true)
{if(oGeometry.MinSpacing()<6*ca1)
{a=true;}}}
return a;}
AnchorACIDesignClass.prototype.Nsbg=function(oGeometry,oBolt,fpc)
{var ca1=oGeometry.MinEdge();var ca2=this.Ca2_N(oGeometry,oBolt);var nsb=(160*ca1*Math.sqrt(oBolt.GetBearingArea())*Math.sqrt(fpc*1000))/1000;if(this.considerSideFaceBlowout(oGeometry,oBolt,ca1)===true)
{if(oGeometry.NumberOfBolts()===1)
{var m=Math.min(3,ca2/ca1);if(ca2<3*ca1)
{nsb=(1+m)/4*nsb;}}
if(oGeometry.NumberOfBolts()>1)
{nsb=(1+oGeometry.MinSpacing()/(6*ca1))*nsb;}}
else{nsb=1.0e20;}
return nsb;}
AnchorACIDesignClass.prototype.Condition=function(oConcrete)
{if(oConcrete.barsCrossTensionPlane||oConcrete.barsPreventTensionBreakout)
{return 0;}
else
{return 1;}}
AnchorACIDesignClass.prototype.EffectiveHookLength=function(oBolt)
{var hookLength=oBolt.hookLength;if(hookLength>4.5*oBolt.GetDiameter())
{hookLength=4.5*oBolt.GetDiameter();}
return hookLength;}
AnchorACIDesignClass.prototype.Np=function(oGeometry,oBolt,fpc){var np=0.0;if(oBolt.IsAnchorHooked()){var hookLength=this.EffectiveHookLength(oBolt);if(hookLength>=3*oBolt.GetDiameter()){np=0.9*fpc*hookLength*oBolt.GetDiameter();}
else{np=0;}}
else{np=8*oBolt.GetBearingArea()*fpc;}
return np;}
AnchorACIDesignClass.prototype.Npn=function(oGeometry,oBolt,fpc)
{var np=this.Np(oGeometry,oBolt,fpc);var npn=np*oGeometry.NumberOfBolts();return npn;}
AnchorACIDesignClass.prototype.Vsa=function(oBolt,oGeometry)
{var vsa=oGeometry.NumberOfBolts()*0.6*oBolt.GetArea()*oBolt.tensileStrength;if(oBolt.IsHeadedStud())
{vsa=oGeometry.NumberOfBolts()*oBolt.GetArea()*oBolt.tensileStrength;}
if(oBolt.groutPads)
{vsa=0.8*vsa;}
return vsa;}
AnchorACIDesignClass.prototype.Vb=function(oBolt,oGeometry,ca1,fpc)
{var le=Math.min(oBolt.embedDepth,8*oBolt.GetDiameter());var vb=(7*Math.pow((le/oBolt.GetDiameter()),0.2)*Math.sqrt(oBolt.GetDiameter())*Math.sqrt(fpc*1000)*Math.pow(ca1,1.5))/1000;return vb;}
AnchorACIDesignClass.prototype.EffectiveShearEdgeDistance=function(oGeometry,ca1,ca2,thickness)
{var edges=oGeometry.EdgesLessThan(1.5*ca1);var effThickness=Math.min(1.5*ca1,thickness);if(edges>=3)
{var ca1_eff=Math.max(ca2/1.5,Math.max((effThickness/1.5),oGeometry.MaxSpacing()/3));if(ca1<ca1_eff)
{return ca1;}
else
{return ca1_eff;}}
return ca1;}
AnchorACIDesignClass.prototype.EdgeShearFactor=function(ca1,ca2)
{var Psi_edV=1.0;if(ca2<1.5*ca1)
{Psi_edV=0.7+0.3*(ca2/(1.5*ca1));}
return Psi_edV;}
AnchorACIDesignClass.prototype.CrackedConcShearFactor=function(noShearBreakout,supp4BarReinf,stirrups)
{var Psi_cV=1.0;if(supp4BarReinf===true)
{Psi_cV=1.2;}
if(supp4BarReinf===true&&stirrups===true)
{Psi_cV=1.4;}
if(noShearBreakout===true)
{Psi_cV=1e20;}
return Psi_cV;}
AnchorACIDesignClass.prototype.ConcreteThicknessFactor=function(ca1,ha)
{var Psi_hV=0;if(ha<1.5*ca1)
{Psi_hV=Math.sqrt(1.5*ca1/ha);}
else
{Psi_hV=1.0;}
return Psi_hV;}
AnchorACIDesignClass.prototype.Avco=function(ca1)
{var avco=4.5*Math.pow(ca1,2.0);return avco;}
AnchorACIDesignClass.prototype.Avc_X=function(oGeometry,ca1,thickness)
{var topDimension=Math.min(1.5*ca1,oGeometry.topEdge);var bottomDimension=Math.min(1.5*ca1,oGeometry.bottomEdge);var effThickness=Math.min(1.5*ca1,thickness);var avc=(topDimension+oGeometry.rowSpacing*(oGeometry.rows-1)+bottomDimension)*effThickness;avc=Math.min(avc,oGeometry.NumberOfBolts()*this.Avco(ca1));return avc;}
AnchorACIDesignClass.prototype.shearEdgeVx=function(oGeometry,oLoad)
{var shearEdge=0;if(oLoad.vX>0)
{shearEdge=oGeometry.rightEdge;}
if(oLoad.vX<0)
{shearEdge=oGeometry.leftEdge;}
if(oLoad.vX===0)
{shearEdge=Math.min(oGeometry.rightEdge,oGeometry.leftEdge);}
return shearEdge;}
AnchorACIDesignClass.prototype.Ca1_Vx=function(oBolt,oGeometry,oLoad,oConcrete)
{var ca2=this.Ca2_Vx(oGeometry);var shearEdge=this.shearEdgeVx(oGeometry,oLoad);var ca1=shearEdge;ca1=this.EffectiveShearEdgeDistance(oGeometry,ca1,ca2,oConcrete.thickness);if(oBolt.anchorsWelded)
{ca1=shearEdge+oGeometry.colSpacing;}
return ca1;}
AnchorACIDesignClass.prototype.Vcb_X=function(oBolt,oGeometry,oLoad,oConcrete)
{var vcb=1e20;var ca2=this.Ca2_Vx(oGeometry);var shearEdge=this.shearEdgeVx(oGeometry,oLoad);var ca1=shearEdge;ca1=this.EffectiveShearEdgeDistance(oGeometry,ca1,ca2,oConcrete.thickness);var avc=this.Avc_X(oGeometry,ca1,oConcrete.thickness);var anco=this.Avco(ca1);var psi_ec=this.EdgeShearFactor(ca1,ca2);var psi_ed=this.CrackedConcShearFactor(oConcrete.shearXNoBreakout,oConcrete.shearXNumber4Bars,oConcrete.shearXStirrups);var psi_c=this.ConcreteThicknessFactor(ca1,oConcrete.thickness);var vb=this.Vb(oBolt,oGeometry,ca1,oConcrete.fc);vcb=avc/anco*psi_ec*psi_ed*psi_c*vb*oGeometry.columns;if(oBolt.anchorsWelded)
{ca1=shearEdge+oGeometry.colSpacing;avc=this.Avc_X(oGeometry,ca1,oConcrete.thickness);anco=this.Avco(ca1);psi_ec=this.EdgeShearFactor(ca1,ca2);psi_c=this.ConcreteThicknessFactor(ca1,oConcrete.thickness);vb=this.Vb(oBolt,oGeometry,ca1,oConcrete.fc);var vcbWelded=avc/anco*psi_ec*psi_ed*psi_c*vb*oGeometry.columns;vcb=Math.max(vcb,vcbWelded);}
return vcb;}
AnchorACIDesignClass.prototype.Avc_Y=function(oGeometry,ca1,thickness)
{var leftDimension=Math.min(1.5*ca1,oGeometry.leftEdge);var rightDimension=Math.min(1.5*ca1,oGeometry.rightEdge);var effThickness=Math.min(1.5*ca1,thickness);var avc=(leftDimension+oGeometry.colSpacing*(oGeometry.columns-1)+rightDimension)*effThickness;avc=Math.min(avc,oGeometry.NumberOfBolts()*this.Avco(ca1));return avc;}
AnchorACIDesignClass.prototype.shearEdgeVy=function(oGeometry,oLoad)
{var shearEdge=0;if(oLoad.vY>0)
{shearEdge=oGeometry.topEdge;}
if(oLoad.vY<0)
{shearEdge=oGeometry.bottomEdge;}
if(oLoad.vY===0)
{shearEdge=Math.min(oGeometry.topEdge,oGeometry.bottomEdge);}
return shearEdge;}
AnchorACIDesignClass.prototype.Ca1_Vy=function(oBolt,oGeometry,oLoad,oConcrete)
{var ca2=this.Ca2_Vy(oGeometry);var shearEdge=this.shearEdgeVy(oGeometry,oLoad);var ca1=shearEdge;ca1=this.EffectiveShearEdgeDistance(oGeometry,ca1,ca2,oConcrete.thickness);if(oBolt.anchorsWelded)
{ca1=shearEdge+oGeometry.rowSpacing;}
return ca1;}
AnchorACIDesignClass.prototype.Vcb_Y=function(oBolt,oGeometry,oLoad,oConcrete)
{var vcb=1e20;var ca2=this.Ca2_Vy(oGeometry);var shearEdge=this.shearEdgeVy(oGeometry,oLoad);var ca1=shearEdge;ca1=this.EffectiveShearEdgeDistance(oGeometry,ca1,ca2,oConcrete.thickness);var avc=this.Avc_Y(oGeometry,ca1,oConcrete.thickness);var anco=this.Avco(ca1);var psi_ec=this.EdgeShearFactor(ca1,ca2);var psi_ed=this.CrackedConcShearFactor(oConcrete.shearYNoBreakout,oConcrete.shearYNumber4Bars,oConcrete.shearYStirrups);var psi_c=this.ConcreteThicknessFactor(ca1,oConcrete.thickness);var vb=this.Vb(oBolt,oGeometry,ca1,oConcrete.fc);vcb=avc/anco*psi_ec*psi_ed*psi_c*vb*oGeometry.rows;if(oBolt.anchorsWelded)
{ca1=shearEdge+oGeometry.rowSpacing;avc=this.Avc_Y(oGeometry,ca1,oConcrete.thickness);anco=this.Avco(ca1);psi_ec=this.EdgeShearFactor(ca1,ca2);psi_c=this.ConcreteThicknessFactor(ca1,oConcrete.thickness);vb=this.Vb(oBolt,oGeometry,ca1,oConcrete.fc);var vcbWelded=avc/anco*psi_ec*psi_ed*psi_c*vb*oGeometry.rows;vcb=Math.max(vcb,vcbWelded);}
return vcb;}
AnchorACIDesignClass.prototype.Kcp=function(oBolt)
{var kcp=1.0;if(oBolt.embedDepth>=2.5)
{kcp=2.0;}
return kcp;}
AnchorACIDesignClass.prototype.Vcp=function(oGeometry,oBolt,fpc)
{var kcp=this.Kcp(oBolt);var vcp=kcp*this.Ncb(oGeometry,oBolt,fpc);return vcp;}
function AnchorProblemClass()
{this.maxTension=1e20;this.tensionCapacityMessage="";this.phiTensionSteel=0;this.phiNsa=0;this.phiTensionConcreteBreakOut=0;this.Anc=0;this.Anco=0;this.PsiedN=0;this.Nb=0;this.Hef_ConcBreakout=0;this.ncb=0;this.kc=24;this.phiPullout=0;this.Np=0;this.Npn=0;this.sideFaceBlowOutApplies=false;this.phiSideFace=0;this.Ca1SideFace=0;this.Nsb=0;this.maxShearX=1e20;this.maxShearY=1e20;this.shearXCapacityMessage="";this.shearYCapacityMessage="";this.phiVxSteel=0;this.phiVySteel=0;this.vsaX=0;this.vsaY=0;this.phiShearXBreakout=0;this.phiShearYBreakout=0;this.ca1ShearX=0;this.ca1ShearY=0;this.avcShearX=0;this.avcShearY=0;this.avcoShearX=0;this.avcoShearY=0;this.psiEdvShearX=0;this.psiEdvShearY=0;this.psiCvShearX=0;this.psiCvShearY=0;this.psiHvShearX=0;this.psiHvShearY=0;this.VbShearX=0;this.VbShearY=0;this.vcbX=0;this.vcbY=0;this.phiPryoutShearX=0;this.phiPryoutShearY=0;this.kcpShearX=0;this.kcpShearY=0;this.vcpX=0;this.vcpY=0;this.interactionX=0;this.interactionY=0;}
AnchorProblemClass.prototype.CalculateTensionCapacity=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.maxTension=1e20;for(var i=0;i<2;i++)
{var btc=this.BoltTensionCapacity(oAnchorDesign,oLoad,oBolt,oGeometry);if(btc<this.maxTension)
{this.maxTension=btc;this.tensionCapacityMessage="Bolt Tension Controls";}
var cbtc=this.ConcreteBreakoutTensionCapacity(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);if(cbtc<this.maxTension)
{this.maxTension=cbtc;this.tensionCapacityMessage="Breakout Controls";}
var cpc=this.ConcretePulloutCapacity(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);if(cpc<this.maxTension)
{this.maxTension=cpc;this.tensionCapacityMessage="Pullout Controls";}
var csfbc=this.ConcreteSideFaceBlowoutCapacity(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);if(csfbc<this.maxTension)
{this.maxTension=csfbc;}}
return this.maxTension;}
AnchorProblemClass.prototype.BoltTensionCapacity=function(oAnchorDesign,oLoad,oBolt,oGeometry)
{this.phiTensionSteel=oAnchorDesign.GetPhiFactor(0,0,oLoad.Chapter9());this.phiNsa=oAnchorDesign.Nsa(oBolt,oGeometry)*this.phiTensionSteel;return this.phiNsa;}
AnchorProblemClass.prototype.ConcreteBreakoutTensionCapacity=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.phiTensionConcreteBreakOut=oAnchorDesign.GetPhiFactor(3,oAnchorDesign.Condition(oConcrete),oLoad.Chapter9());var seismicFactor=oAnchorDesign.SeismicFactor(oLoad.categoryCOrHigher);this.Anc=oAnchorDesign.Anc(oGeometry,oBolt);this.Anco=oAnchorDesign.Anco(oGeometry,oBolt);this.PsiedN=oAnchorDesign.EdgeEffectTensionFactor(oGeometry,oBolt);this.Nb=oAnchorDesign.Nb(oGeometry,oBolt,oConcrete.fc);this.Hef_ConcBreakout=oAnchorDesign.EffectiveEmbed(oGeometry,oBolt);this.ncb=oAnchorDesign.Ncb(oGeometry,oBolt,oConcrete.fc)*this.phiTensionConcreteBreakOut*seismicFactor;if(oConcrete.barsPreventTensionBreakout)
{this.ncb=1e20;}
return this.ncb;}
AnchorProblemClass.prototype.ConcretePulloutCapacity=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete){this.phiPullout=oAnchorDesign.GetPhiFactor(3,1,oLoad.Chapter9());var seismicFactor=oAnchorDesign.SeismicFactor(oLoad.categoryCOrHigher);this.Np=oAnchorDesign.Np(oGeometry,oBolt,oConcrete.fc);this.Npn=oAnchorDesign.Npn(oGeometry,oBolt,oConcrete.fc)*this.phiPullout*seismicFactor;return this.Npn;}
AnchorProblemClass.prototype.ConcreteSideFaceBlowoutCapacity=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.phiSideFace=oAnchorDesign.GetPhiFactor(3,oAnchorDesign.Condition(oConcrete.barsCrossTensionFailure,oConcrete.barsPreventTensionBreakout),oLoad.Chapter9());var seismicFactor=oAnchorDesign.SeismicFactor(oLoad.categoryCOrHigher);this.Ca1SideFace=oGeometry.MinEdge();this.sideFaceBlowOutApplies=oAnchorDesign.considerSideFaceBlowout(oGeometry,oBolt);this.Nsb=oAnchorDesign.Nsbg(oGeometry,oBolt,oConcrete.fc,this.Ca1SideFace)*this.phiSideFace*seismicFactor;return this.Nsb;}
AnchorProblemClass.prototype.CalculateShearXCapacity=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.maxShearX=1e20;for(var i=0;i<2;++i)
{var bsc=this.BoltShearCapacityX(oAnchorDesign,oLoad,oBolt,oGeometry);if(bsc<this.maxShearX)
{this.maxShearX=bsc;this.shearXCapacityMessage="Bolt Shear Controls";}
var cbsc=this.ConcreteBreakoutShearCapacityX(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);if(cbsc<this.maxShearX)
{this.maxShearX=cbsc;this.shearXCapacityMessage="Breakout Controls";}
var cpc=this.ConcretePryoutCapacityX(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);if(cpc<this.maxShearX)
{this.maxShearX=cpc;this.shearXCapacityMessage="Pryout Controls";}}
return this.maxShearX;}
AnchorProblemClass.prototype.BoltShearCapacityX=function(oAnchorDesign,oLoad,oBolt,oGeometry)
{this.phiVxSteel=oAnchorDesign.GetPhiFactor(1,0,oLoad.Chapter9());this.vsaX=oAnchorDesign.Vsa(oBolt,oGeometry)*this.phiVxSteel;return this.vsaX;}
AnchorProblemClass.prototype.ConcreteBreakoutShearCapacityX=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.phiShearXBreakout=oAnchorDesign.GetPhiFactor(2,oAnchorDesign.Condition(oConcrete.shearXStirrups,oConcrete.shearXNoBreakout),oLoad.Chapter9());var seismicFactor=oAnchorDesign.SeismicFactor(oLoad.categoryCOrHigher);this.ca1ShearX=oAnchorDesign.Ca1_Vx(oBolt,oGeometry,oLoad,oConcrete);this.vcbX=oAnchorDesign.Vcb_X(oBolt,oGeometry,oLoad,oConcrete)*this.phiShearXBreakout*seismicFactor;this.avcShearX=oAnchorDesign.Avc_X(oGeometry,this.ca1ShearX,oConcrete.thickness);this.avcoShearX=oAnchorDesign.Avco(this.ca1ShearX);this.psiEdvShearX=oAnchorDesign.EdgeShearFactor(this.ca1ShearX,oAnchorDesign.Ca2_Vx(oGeometry));this.psiCvShearX=oAnchorDesign.CrackedConcShearFactor(oConcrete.shearXNoBreakout,oConcrete.shearXNumber4Bars,oConcrete.shearXStirrups);this.psiHvShearX=oAnchorDesign.ConcreteThicknessFactor(this.ca1ShearX,oConcrete.thickness);this.VbShearX=oAnchorDesign.Vb(oBolt,oGeometry,this.ca1ShearX,oConcrete.fc);return this.vcbX;}
AnchorProblemClass.prototype.ConcretePryoutCapacityX=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.phiPryoutShearX=oAnchorDesign.GetPhiFactor(2,1,oLoad.Chapter9());var seismicFactor=oAnchorDesign.SeismicFactor(oLoad.categoryCOrHigher);this.kcpShearX=oAnchorDesign.Kcp(oBolt);this.vcpX=oAnchorDesign.Vcp(oGeometry,oBolt,oConcrete.fc)*this.phiPryoutShearX*seismicFactor;return this.vcpX;}
AnchorProblemClass.prototype.CalculateShearYCapacity=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.maxShearY=1e20;for(var i=0;i<2;++i)
{var bsc=this.BoltShearCapacityY(oAnchorDesign,oLoad,oBolt,oGeometry);if(bsc<this.maxShearY)
{this.maxShearY=bsc;this.shearYCapacityMessage="Bolt Shear Controls";}
var cbsc=this.ConcreteBreakoutShearCapacityY(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);if(cbsc<this.maxShearY)
{this.maxShearY=cbsc;this.shearYCapacityMessage="Breakout Controls";}
var cpc=this.ConcretePryoutCapacityY(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);if(cpc<this.maxShearY)
{this.maxShearY=cpc;this.shearYCapacityMessage="Pryout Controls";}}
return this.maxShearY;}
AnchorProblemClass.prototype.BoltShearCapacityY=function(oAnchorDesign,oLoad,oBolt,oGeometry)
{this.phiVySteel=oAnchorDesign.GetPhiFactor(1,0,oLoad.Chapter9());this.vsaY=oAnchorDesign.Vsa(oBolt,oGeometry)*this.phiVySteel;return this.vsaY;}
AnchorProblemClass.prototype.ConcreteBreakoutShearCapacityY=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.phiShearYBreakout=oAnchorDesign.GetPhiFactor(2,oAnchorDesign.Condition(oConcrete.shearYStirrups,oConcrete.shearYNoBreakout),oLoad.Chapter9());var seismicFactor=oAnchorDesign.SeismicFactor(oLoad.categoryCOrHigher);this.ca1ShearY=oAnchorDesign.Ca1_Vy(oBolt,oGeometry,oLoad,oConcrete);this.vcbY=oAnchorDesign.Vcb_Y(oBolt,oGeometry,oLoad,oConcrete)*this.phiShearYBreakout*seismicFactor;this.avcShearY=oAnchorDesign.Avc_Y(oGeometry,this.ca1ShearY,oConcrete.thickness);this.avcoShearY=oAnchorDesign.Avco(this.ca1ShearY);this.psiEdvShearY=oAnchorDesign.EdgeShearFactor(this.ca1ShearY,oAnchorDesign.Ca2_Vy(oGeometry));this.psiCvShearY=oAnchorDesign.CrackedConcShearFactor(oConcrete.shearYNoBreakout,oConcrete.shearYNumber4Bars,oConcrete.shearYStirrups);this.psiHvShearY=oAnchorDesign.ConcreteThicknessFactor(this.ca1ShearY,oConcrete.thickness);this.VbShearY=oAnchorDesign.Vb(oBolt,oGeometry,this.ca1ShearY,oConcrete.fc);return this.vcbY;}
AnchorProblemClass.prototype.ConcretePryoutCapacityY=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.phiPryoutShearY=oAnchorDesign.GetPhiFactor(2,1,oLoad.Chapter9());var seismicFactor=oAnchorDesign.SeismicFactor(oLoad.categoryCOrHigher);this.kcpShearY=oAnchorDesign.Kcp(oBolt);this.vcpY=oAnchorDesign.Vcp(oGeometry,oBolt,oConcrete.fc)*this.phiPryoutShearY*seismicFactor;return this.vcpY;}
AnchorProblemClass.prototype.CalculateInteractionValueX=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.interactionX=oAnchorDesign.InteractionCheck(oLoad.vX,this.maxShearX,oLoad.nZ,this.maxTension);return this.interactionX;}
AnchorProblemClass.prototype.CalculateInteractionValueY=function(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete)
{this.interactionY=oAnchorDesign.InteractionCheck(oLoad.vY,this.maxShearY,oLoad.nZ,this.maxTension);return this.interactionY;}
function AnchorProjectInfoClass()
{this.title="";this.client="";this.designer="";this.jobID="";this.notes="";}
var ANCHOR_TYPE_SELECT="anchor-type-select";var NUT_TYPE_SELECT="nut-type-select";var ANCHOR_DIAMETER_SELECT="anchor-diameter-select";var HOOK_LENGTH_INPUT="hook-length-input";var EMBED_DEPTH_INPUT="embed-depth-input";var TENSILE_STRENGTH_INPUT="tensile-strength-input";var ANCHORS_WELDED_CHECK="anchors-welded-check";var GROUT_PADS_CHECK="grout-pads-check";var NUM_ROWS_INPUT="num-rows-input";var NUM_COLS_INPUT="num-cols-input";var ROW_SPACING_INPUT="row-spacing-input";var COL_SPACING_INPUT="col-spacing-input";var TOP_EDGE_INPUT="top-edge-input";var BOTTOM_EDGE_INPUT="bottom-edge-input";var LEFT_EDGE_INPUT="left-edge-input";var RIGHT_EDGE_INPUT="right-edge-input";var CONCRETE_STRENGTH_INPUT="concrete-strength-input";var CONCRETE_THICKNESS_INPUT="concrete-thickness-input";var TENSION_BARS_CHECK="tension-bars-check";var TENSION_BREAKOUT_CHECK="tension-breakout-check";var SHEARX_4BAR_CHECK="shearx-4bar-check";var SHEARX_STIRRUPS_CHECK="shearx-stirrup-check";var SHEARX_BREAKOUT_CHECK="shearx-breakout-check";var SHEARY_4BAR_CHECK="sheary-4bar-check";var SHEARY_STIRRUPS_CHECK="sheary-stirrup-check";var SHEARY_BREAKOUT_CHECK="sheary-breakout-check";var LOAD_FACTOR_SELECT="load-factor-select";var LOAD_TENSION_INPUT="load-tension-input";var LOAD_XSHEAR_INPUT="load-xshear-input";var LOAD_YSHEAR_INPUT="load-yshear-intput";var LOAD_CORHIGHER_CHECK="load-corhigher-check";var PROJECT_TITLE_INPUT="project-title-input";var PROJECT_CLIENT_INPUT="project-client-input";var PROJECT_ID_INPUT="project-id-input";var PROJECT_DESIGNER_INPUT="project-designer-input";var PROJECT_NOTES_INPUT="project-notes-input";var iniPrecision=3;function GetAnswerString(value,unitsStr)
{var answerStr="N/A";if(value<1e12)
{answerStr=value.toPrecision(iniPrecision).toString()+" "+unitsStr;}
return answerStr;}
function GetBoolCookie(name)
{return getCookie("VisualAnchor_"+name);}
function GetNumberCookie(name)
{return Number(getCookie("VisualAnchor_"+name));}
function VisualAnchorView()
{}
VisualAnchorView.prototype.CreateAnchorDialog=function(divID,oAnchorBolt)
{var htmlStr='<table>';var index=GetNumberCookie(ANCHOR_TYPE_SELECT);htmlStr+='<tr><td style="width:120px">Anchor Type:&nbsp;&nbsp; </td><td style="width:100px"><select id="'+ANCHOR_TYPE_SELECT+'" onchange="updateAnchorBolt();">';for(var i=0;i<ETAnchorType.length;i++)
{if(index===i)
{htmlStr+='<option selected="yes">'+ETAnchorType[i]+'</option>';}
else
{htmlStr+='<option>'+ETAnchorType[i]+'</option>';}}
htmlStr+='</select></tr>';index=GetNumberCookie(NUT_TYPE_SELECT);htmlStr+='<tr><td>Nut Type: </td><td><select id="'+NUT_TYPE_SELECT+'" style="width:100%" onchange="updateAnchorBolt();">';for(var i=0;i<ETNutType.length;i++)
{if(index===i)
{htmlStr+='<option selected="yes">'+ETNutType[i].label+'</option>';}
else
{htmlStr+='<option>'+ETNutType[i].label+'</option>';}}
htmlStr+='</select></tr>';var cookieValue=GetNumberCookie(HOOK_LENGTH_INPUT);if(!cookieValue){cookieValue=iniHookLength;}
htmlStr+='<tr ><td style="width:120px">Hook Length (in): </td>';htmlStr+='<td style="width:100px">';htmlStr+='<input id="'+HOOK_LENGTH_INPUT+'" type="text" style="width:100%" onchange="updateAnchorBolt();" value="'+cookieValue+'"/></td></tr>';index=GetNumberCookie(ANCHOR_DIAMETER_SELECT);htmlStr+='<tr><td style="width:120px">Diameter: </td><td style="width:100px"><select style="width:100%" id="'+ANCHOR_DIAMETER_SELECT+'" onchange="updateAnchorBolt();">';for(var i=0;i<ETDiameter.length;i++)
{if(index===i)
{htmlStr+='<option selected="yes">'+ETDiameter[i].label+'</option>';}
else
{htmlStr+='<option>'+ETDiameter[i].label+'</option>';}}
htmlStr+='</select></tr>';cookieValue=GetNumberCookie(EMBED_DEPTH_INPUT);if(!cookieValue){cookieValue=iniEmbedDepth;}
htmlStr+='<tr><td style="width:120px">Embed Depth (in): </td>';htmlStr+='<td style="width:100px">';htmlStr+='<input id="'+EMBED_DEPTH_INPUT+'" style="width:100%" type="text" onchange="updateAnchorBolt();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(TENSILE_STRENGTH_INPUT);if(!cookieValue){cookieValue=iniTensileStrength;}
htmlStr+='<tr><td>Tensile Strength, futa (ksi): </td>';htmlStr+='<td>';htmlStr+='<input id="'+TENSILE_STRENGTH_INPUT+'" style="width:100%"  type="text" onchange="updateAnchorBolt();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetBoolCookie(ANCHORS_WELDED_CHECK);var checkStr='';if(cookieValue&&cookieValue==="true"){checkStr='checked="yes"';}
htmlStr+='<tr ><td>Anchors Welded to Base Plate</td>';htmlStr+='<td >';htmlStr+='<input id="'+ANCHORS_WELDED_CHECK+'" style="width:100%"  type="checkbox" '+checkStr+' onclick="updateAnchorBolt();"/></td></tr>';cookieValue=GetBoolCookie(GROUT_PADS_CHECK);checkStr='';if(cookieValue&&cookieValue==="true"){checkStr='checked="yes"';}
htmlStr+='<tr class="plain eventinfo"><td>Grout Pads</td>';htmlStr+='<td class="plain eventinfo">';htmlStr+='<input id="'+GROUT_PADS_CHECK+'" style="width:100%"  type="checkbox" '+checkStr+' onclick="updateAnchorBolt();"/></td></tr>';htmlStr+='</table>';document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateAnchorDialogView=function(oAnchorBolt){var nutTypeList=document.getElementById(NUT_TYPE_SELECT);var hookLengthInput=document.getElementById(HOOK_LENGTH_INPUT);if(oAnchorBolt.anchorType==="Hooked Bolt")
{nutTypeList.disabled=true;hookLengthInput.disabled=false;}
else if(oAnchorBolt.anchorType==="Headed Stud")
{nutTypeList.disabled=true;hookLengthInput.disabled=true;}
else
{nutTypeList.disabled=false;hookLengthInput.disabled=true;}}
VisualAnchorView.prototype.UpdateAnchorOutputView=function(divID,oAnchorBolt)
{var htmlStr="<table><tr>";htmlStr+="<tr><th>"+oAnchorBolt.anchorType+"</th></tr>";if(oAnchorBolt.anchorType==="Hooked Bolt")
{htmlStr+="<tr><th>"+oAnchorBolt.hookLength+" \" hook</th></tr>";}
else if(oAnchorBolt.anchorType==="Headed Stud")
{}
else
{htmlStr+="<tr><th>"+ETNutType[oAnchorBolt.nutTypeIndex].label+" Nut</th></tr>";}
htmlStr+="<tr><th>"+ETDiameter[oAnchorBolt.diameterIndex].label+" x "+oAnchorBolt.embedDepth+"\" Embed.</th></tr>";htmlStr+="<tr><th>`f_(uta) = "+oAnchorBolt.tensileStrength+"` ksi</th></tr>";if(oAnchorBolt.anchorsWelded)
{htmlStr+="<tr><td><em>- Anchors Welded to Base Plate</em></td></tr>";}
if(oAnchorBolt.groutPads)
{htmlStr+="<tr><td><em>- Grout Pads</em></td></tr>";}
else
{htmlStr+="<tr><td><em>- No Grout Pads</em></td></tr>";}
htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;AMprocessNode(document.getElementById(divID));}
VisualAnchorView.prototype.CreateGeometryDialog=function(divID,oAnchorGeometry)
{var htmlStr='<table>';var cookieValue=GetNumberCookie(NUM_ROWS_INPUT);if(!cookieValue){cookieValue=iniRows;}
htmlStr+='<tr ><td style="width:130px">Number of Rows: </td>';htmlStr+='<td style="width:90px">';htmlStr+='<input id="'+NUM_ROWS_INPUT+'" type=int style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(NUM_COLS_INPUT);if(!cookieValue){cookieValue=iniColumns;}
htmlStr+='<tr ><td>Number of Columns: </td>';htmlStr+='<td >';htmlStr+='<input id="'+NUM_COLS_INPUT+'" type=int style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(ROW_SPACING_INPUT);if(!cookieValue){cookieValue=iniRowSpacing;}
htmlStr+='<tr ><td>Row Spacing (in): </td>';htmlStr+='<td >';htmlStr+='<input id="'+ROW_SPACING_INPUT+'" type="text" style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(COL_SPACING_INPUT);if(!cookieValue){cookieValue=iniColSpacing;}
htmlStr+='<tr ><td>Column Spacing (in): </td>';htmlStr+='<td >';htmlStr+='<input id="'+COL_SPACING_INPUT+'" type="text" style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(TOP_EDGE_INPUT);if(!cookieValue){cookieValue=iniTopEdge;}
htmlStr+='<tr ><td>Top Edge (in): </td>';htmlStr+='<td >';htmlStr+='<input id="'+TOP_EDGE_INPUT+'" type="text" style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(BOTTOM_EDGE_INPUT);if(!cookieValue){cookieValue=iniBottomEdge;}
htmlStr+='<tr ><td>Bottom Edge (in): </td>';htmlStr+='<td >';htmlStr+='<input id="'+BOTTOM_EDGE_INPUT+'" type="text" style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(LEFT_EDGE_INPUT);if(!cookieValue){cookieValue=iniLeftEdge;}
htmlStr+='<tr ><td>Left Edge (in): </td>';htmlStr+='<td >';htmlStr+='<input id="'+LEFT_EDGE_INPUT+'" type="text" style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';cookieValue=GetNumberCookie(RIGHT_EDGE_INPUT);if(!cookieValue){cookieValue=iniRightEdge;}
htmlStr+='<tr ><td>Right Edge (in): </td>';htmlStr+='<td >';htmlStr+='<input id="'+RIGHT_EDGE_INPUT+'" type="text" style="width:100%" onchange="updateGeometry();" value="'+cookieValue+'"/></td></tr>';htmlStr+='</table>';document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateGeometryDialogView=function(oAnchorGeometry)
{}
VisualAnchorView.prototype.UpdateGeometryOutputView=function(oAnchorGeometry)
{}
VisualAnchorView.prototype.CreateConcreteDialog=function(divID,oAnchorConcrete)
{var htmlStr='<table>';htmlStr+='<tr class="plain eventinfo"><td style="width:110px">f\'c (ksi): </td>';htmlStr+='<td class="plain eventinfo" style="width:110px">';htmlStr+='<input id="'+CONCRETE_STRENGTH_INPUT+'" type="text" style="width:100%" onchange="updateConcrete();" value="'+iniFc+'"/></td></tr>';htmlStr+='<tr class="plain eventinfo"><td>Thickness (in): </td>';htmlStr+='<td class="plain eventinfo">';htmlStr+='<input id="'+CONCRETE_THICKNESS_INPUT+'" type="text" style="width:100%" onchange="updateConcrete();" value="'+iniThickness+'"/></td></tr>';htmlStr+='</table>';htmlStr+='<fieldset class="input-fieldset"><legend>Tension Steel</legend><table>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+TENSION_BARS_CHECK+'" type="checkbox" onclick="updateConcrete();"/> Bars cross tension failure plane <em>(D.5.2.9)</em></td></tr>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+TENSION_BREAKOUT_CHECK+'" type="checkbox" onclick="updateConcrete();"/> Bars sized to prevent Tension Concrete Breakout <em>(D.5.2.9)</em></td></tr>';htmlStr+='</table></fieldset>';htmlStr+='<fieldset class="input-fieldset"><legend>Shear Steel - X Direction</legend><table>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+SHEARX_4BAR_CHECK+'" type="checkbox" onclick="updateConcrete();"/> No. 4 bar or greater between anchor and edge <em>(D.6.2.7)</em></td></tr>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+SHEARX_STIRRUPS_CHECK+'" type="checkbox" onclick="updateConcrete();"/> Enclosed by stirrups (spaced at 4\" max) <em>(D.6.2.7)</em></td></tr>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+SHEARX_BREAKOUT_CHECK+'" type="checkbox" onclick="updateConcrete();"/> Horizontal bars sized to prevent Concrete Breakout <em>(D.6.2.9)</em></td></tr>';htmlStr+='</table></fieldset>';htmlStr+='<fieldset class="input-fieldset"><legend>Shear Steel - Y Direction</legend><table>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+SHEARY_4BAR_CHECK+'" type="checkbox" onclick="updateConcrete();"/> No. 4 bar or greater between anchor and edge <em>(D.6.2.7)</em></td></tr>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+SHEARY_STIRRUPS_CHECK+'" type="checkbox" onclick="updateConcrete();"/> Enclosed by stirrups (spaced at 4\" max) <em>(D.6.2.7)</em></td></tr>';htmlStr+='<tr class="plain eventinfo">';htmlStr+='<td><input id="'+SHEARY_BREAKOUT_CHECK+'" type="checkbox" onclick="updateConcrete();"/> Horizontal bars sized to prevent Concrete Breakout <em>(D.6.2.9)</em></td></tr>';htmlStr+='</table></fieldset>';document.getElementById(divID).innerHTML=htmlStr;this.UpdateConcreteDialogView(oAnchorConcrete);}
VisualAnchorView.prototype.UpdateConcreteDialogView=function(oAnchorConcrete)
{var barsCrossTensionPlane=document.getElementById(TENSION_BARS_CHECK).checked;var shearXNumber4Bars=document.getElementById(SHEARX_4BAR_CHECK).checked;var shearYNumber4Bars=document.getElementById(SHEARY_4BAR_CHECK).checked;if(barsCrossTensionPlane===true)
{document.getElementById(TENSION_BREAKOUT_CHECK).disabled=false;}
else
{document.getElementById(TENSION_BREAKOUT_CHECK).disabled=true;}
if(shearXNumber4Bars===true)
{document.getElementById(SHEARX_STIRRUPS_CHECK).disabled=false;}
else
{document.getElementById(SHEARX_STIRRUPS_CHECK).disabled=true;}
if(shearYNumber4Bars===true)
{document.getElementById(SHEARY_STIRRUPS_CHECK).disabled=false;}
else
{document.getElementById(SHEARY_STIRRUPS_CHECK).disabled=true;}}
VisualAnchorView.prototype.UpdateConcreteOutputView=function(divID,oAnchorConcrete)
{var htmlStr="<table>";htmlStr+="<tr><th width='300px'>`f'c = "+oAnchorConcrete.fc+"` ksi</th></tr>";htmlStr+="<tr><th>`t = "+oAnchorConcrete.thickness+"` in</th></tr>";if(oAnchorConcrete.barsCrossTensionFailure)
{htmlStr+="<tr><th>Tension Steel</th></tr>";htmlStr+="<tr><td>- Tension bars cross failure plane</td></tr>";if(oAnchorConcrete.barsPreventTensionBreakout)
{htmlStr+="<tr><td>- Tension bars sized to prevent breakout</td></tr>";}}
if(oAnchorConcrete.shearXNumber4Bars||oAnchorConcrete.shearXNoBreakout)
{htmlStr+="<tr><th>X Shear Steel</th></tr>";if(oAnchorConcrete.shearXNumber4Bars)
{htmlStr+="<tr><td>- No. 4 bar or greater between anchor and edge</td></tr>";if(oAnchorConcrete.shearXStirrups)
{htmlStr+="<tr><td>- Enclosed by stirrups (spaced at 4\" max)</td></tr>";}}
if(oAnchorConcrete.shearXNoBreakout)
{htmlStr+="<tr><td>- Horizontal bars sized to prevent breakout</td></tr>";}}
if(oAnchorConcrete.shearYNumber4Bars||oAnchorConcrete.shearYNoBreakout)
{htmlStr+="<tr><th>Y Shear Steel</th></tr>";if(oAnchorConcrete.shearYNumber4Bars)
{htmlStr+="<tr><td>- No. 4 bar or greater between anchor and edge</td></tr>";if(oAnchorConcrete.shearYStirrups)
{htmlStr+="<tr><td>- Enclosed by stirrups (spaced at 4\" max)</td></tr>";}}
if(oAnchorConcrete.shearYNoBreakout)
{htmlStr+="<tr><td>- Horizontal bars sized to prevent breakout</td></tr>";}}
htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;AMprocessNode(document.getElementById(divID));}
VisualAnchorView.prototype.CreateLoadDialog=function(divID,oAnchorLoad)
{var htmlStr='<table>';htmlStr+='<tr><td style="width:80px">Load Source: </td><td><select id="'+LOAD_FACTOR_SELECT+'" style="width:140px" onchange="updateLoad();">';for(var i=0;i<ETFactoredLoadSource.length;i++)
{htmlStr+='<option>'+ETFactoredLoadSource[i]+'</option>';}
htmlStr+='</select></tr>';htmlStr+='<tr ><td>Tension (k): </td>';htmlStr+='<td >';htmlStr+='<input id="'+LOAD_TENSION_INPUT+'" type="text" style="width:100%" onchange="updateLoad();" value="'+iniNZ+'"/></td></tr>';htmlStr+='<tr ><td>X Shear (k): </td>';htmlStr+='<td >';htmlStr+='<input id="'+LOAD_XSHEAR_INPUT+'" type="text" style="width:100%" onchange="updateLoad();" value="'+iniVX+'"/></td></tr>';htmlStr+='<tr ><td>Y Shear (k): </td>';htmlStr+='<td >';htmlStr+='<input id="'+LOAD_YSHEAR_INPUT+'" type="text" style="width:100%" onchange="updateLoad();" value="'+iniVY+'"/></td></tr>';htmlStr+='<tr ><td>Seismic Design Category \"C\" or Higher</td>';htmlStr+='<td >';htmlStr+='<input id="'+LOAD_CORHIGHER_CHECK+'" type="checkbox" onclick="updateLoad();"/></td></tr>';htmlStr+='</table>';document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateLoadDialogView=function(oAnchorLoad)
{}
VisualAnchorView.prototype.UpdateLoadOutputView=function(divID,oAnchorLoad)
{var htmlStr="<table valign='top'>";htmlStr+="<tr><th>"+oAnchorLoad.factorLoadSource+"</th></tr>";htmlStr+="<tr><th>Tension = "+oAnchorLoad.nZ+" kips</th></tr>";htmlStr+="<tr><th>Shear X = "+oAnchorLoad.vX+" kips</th></tr>";htmlStr+="<tr><th>Shear Y = "+oAnchorLoad.vY+" kips</th></tr>";if(oAnchorLoad.categoryCOrHigher)
{htmlStr+="<tr><td><em>Category \"C\" or higher: Seismic Provisions Apply</em></td></tr>";}
htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.CreateProjectInfoDialog=function(divID,oAnchorProjectInfo)
{var htmlStr='<fieldset class="input-fieldset"><legend>Project Info</legend><table>';htmlStr+='<tr class="plain eventinfo"><td style="width:70px">Title: </td>';htmlStr+='<td class="plain eventinfo">';htmlStr+='<input id="'+PROJECT_TITLE_INPUT+'" type="text"  style="width:170px" onchange="updateProjectInfo();" value=""/></td></tr>';htmlStr+='<tr class="plain eventinfo"><td>Client: </td>';htmlStr+='<td class="plain eventinfo">';htmlStr+='<input id="'+PROJECT_CLIENT_INPUT+'" type="text" style="width:170px" onchange="updateProjectInfo();" value=""/></td></tr>';htmlStr+='<tr class="plain eventinfo"><td>Job ID: </td>';htmlStr+='<td class="plain eventinfo">';htmlStr+='<input id="'+PROJECT_ID_INPUT+'" type="text" style="width:170px" onchange="updateProjectInfo();" value=""/></td></tr>';htmlStr+='<tr class="plain eventinfo"><td>Designer: </td>';htmlStr+='<td class="plain eventinfo">';htmlStr+='<input id="'+PROJECT_DESIGNER_INPUT+'" type="text" style="width:170px" onchange="updateProjectInfo();" value=""/></td></tr>';htmlStr+='</table></fieldset>';document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateProjectInfoDialogView=function(oAnchorProjectInfo)
{}
VisualAnchorView.prototype.UpdateProjectInfoOutputView=function(oAnchorProjectInfo)
{}
VisualAnchorView.prototype.UpdateProjectInfoSummary=function(divID,oAnchorProjectInfo)
{var currentTime=new Date();var month=currentTime.getMonth()+1;var day=currentTime.getDate();var year=currentTime.getFullYear();var todayStr=month+"/"+day+"/"+year;var htmlStr="<table><tr width='800px'>";htmlStr+="<th width='355px' align='left'>Project: "+oAnchorProjectInfo.title+"</th>";htmlStr+="<th width='355px' align='right'>Date: "+todayStr+"</th>";htmlStr+="<th rowspan='3' width='90px' align='right' ><img alt='' height='84px' src='../../images/ies/ieslogo2010-email.gif' width='87px'></th></tr>";htmlStr+="<tr><th align='left'>Client: "+oAnchorProjectInfo.client+"</th>";htmlStr+="<th align='right'>Job ID: "+oAnchorProjectInfo.jobID+"</th></tr>";htmlStr+="<tr><th align='left'>Designer: "+oAnchorProjectInfo.designer+"</th>";htmlStr+="<th align='right'>IES VisualAnchor 1.0</th></tr>";htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateTensileSolution=function(divID,oAnchorProblem,oLoad,oBOlt,oGeometry,oConcrete)
{var htmlStr="<table><tr><th align='left'>Tensile Capacity = "+oAnchorProblem.maxTension.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='left'><em>"+oAnchorProblem.tensionCapacityMessage+"</em></th></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><td align='left'><em>a. Bolt Tension = "+GetAnswerString(oAnchorProblem.phiNsa,"kips")+"</em></td></tr>";htmlStr+="<tr><td align='left'><em>b. Concrete Breakout = "+GetAnswerString(oAnchorProblem.ncb,"kips")+"</em></td></tr>";htmlStr+="<tr><td align='left'><em>c. Pullout = "+GetAnswerString(oAnchorProblem.Npn,"kips")+"</em></td></tr>";htmlStr+="<tr><td align='left'><em>d. Side-Face Blowout = "+GetAnswerString(oAnchorProblem.Nsb,"kips")+"</em></td></tr>";htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateTensileCapacityCalcs=function(divID,oAnchorProblem,oLoad,oBolt,oGeometry,oConcrete)
{var htmlStr="<table><tr><th>Tensile Capacity = "+oAnchorProblem.maxTension.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='center'><em>"+oAnchorProblem.tensionCapacityMessage+"</em></th></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>a. Bolt Tension (D.5.1)</td></th>";htmlStr+="<tr><td>`phiN_(sa) = phi  n  A_(se)  f_(uta)`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiTensionSteel+"`</td></tr>";htmlStr+="<tr><td>`n = "+oGeometry.NumberOfBolts()+"`</td></tr>";htmlStr+="<tr><td>`A_(se) = "+oBolt.GetArea()+"` in^2</td></tr>";htmlStr+="<tr><td>`f_(uta) = "+oBolt.tensileStrength+"` ksi</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.phiNsa,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>b. Concrete Breakout (D.5.2)</td></th>";htmlStr+="<tr><td>`phiN_(cb) = phi  A_(nc)/A_(nco)  psi_(ec)  psi_(ed)  psi_(c)  psi_(cp)  N_b`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiTensionConcreteBreakOut+"`</td></tr>";htmlStr+="<tr><td>`A_(nc) = "+oAnchorProblem.Anc.toPrecision(iniPrecision)+"` in^2</td></tr>";htmlStr+="<tr><td>`A_(nco) = "+oAnchorProblem.Anco.toPrecision(iniPrecision)+"` in^2</td></tr>";htmlStr+="<tr><td>`psi_(ec) = 1.0`</td></tr>";htmlStr+="<tr><td>`psi_(ed) = "+oAnchorProblem.PsiedN.toPrecision(iniPrecision)+"`</td></tr>";htmlStr+="<tr><td>`psi_c = 1.0`</td></tr>";htmlStr+="<tr><td>`psi_(cp) = 1.0`</td></tr>";htmlStr+="<tr><td>`N_b = "+oAnchorProblem.Nb.toPrecision(iniPrecision)+"` kips</td></tr>";htmlStr+="<tr><td>`h_(ef) = "+oAnchorProblem.Hef_ConcBreakout.toPrecision(iniPrecision)+"` in</td></tr>";htmlStr+="<tr><td>`k_c = "+oAnchorProblem.kc+"`</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.ncb,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>c. Pullout (D.5.3)</td></th>";htmlStr+="<tr><td>`phiN_(pn) = phi  psi_c  N_p`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiPullout+"`</td></tr>";htmlStr+="<tr><td>`psi_c = 1.0`</td></tr>";htmlStr+="<tr><td>`N_p = "+oAnchorProblem.Np.toPrecision(iniPrecision)+"` kips</td></tr>";if(oBolt.IsAnchorHooked())
{htmlStr+="<tr><td>`e_n = "+oBolt.hookLength.toPrecision(iniPrecision)+"` in</td></tr>";}
else
{htmlStr+="<tr><td>`A_(brg) = "+oBolt.GetBearingArea()+"` in^2</td></tr>";}
htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.Npn,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>d. Side-Face Blowout (D.5.4)</td></th>";htmlStr+="<tr><td>`phiN_(sb) = phi (1+s/(6  ca_1 ) ) 160  ca_1  sqrt(A_(brg) f\'c)`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiSideFace+"`</td></tr>";htmlStr+="<tr><td>`ca_1 = "+oAnchorProblem.Ca1SideFace.toPrecision(3)+"`</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.Nsb,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;AMprocessNode(document.getElementById(divID));}
VisualAnchorView.prototype.UpdateShearXSolution=function(divID,oAnchorProblem,oLoad,oBolt,oGeometry,oConcrete)
{var htmlStr="<table><tr><th align='left'>Shear X Capacity = "+oAnchorProblem.maxShearX.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='left'><em>"+oAnchorProblem.shearXCapacityMessage+"</em></th></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><td align='left'><em>a. Bolt Shear = "+GetAnswerString(oAnchorProblem.vsaX,"kips")+"</em></td></th>";htmlStr+="<tr><td align='left'><em>b. Concrete Breakout = "+GetAnswerString(oAnchorProblem.vcbX,"kips")+"</em></td></th>";htmlStr+="<tr><td align='left'><em>c. Concrete Pryout = "+GetAnswerString(oAnchorProblem.vcpX,"kips")+"</em></td></th>";htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateShearXCapacityCalcs=function(divID,oAnchorProblem,oLoad,oBolt,oGeometry,oConcrete)
{var htmlStr="<table><tr><th>Shear X Capacity = "+oAnchorProblem.maxShearX.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='center'><em>"+oAnchorProblem.shearXCapacityMessage+"</em></th></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>a. Bolt Shear (D.6.1)</td></th>";htmlStr+="<tr><td>`phiV_(sa) = phi  n  A_(se)  f_(uta)`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiVxSteel+"`</td></tr>";htmlStr+="<tr><td>`n = "+oGeometry.NumberOfBolts()+"`</td></tr>";htmlStr+="<tr><td>`A_(se) = "+oBolt.GetArea()+"` in^2</td></tr>";htmlStr+="<tr><td>`f_(uta) = "+oBolt.tensileStrength+"` ksi</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.vsaX,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>b. Concrete Breakout (D.6.2)</td></th>";htmlStr+="<tr><td>`phiV_(cb) = phi  A_(vc)/A_(vco)  psi_(ec)  psi_(ed)  psi_(c)  V_b`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiShearXBreakout+"`</td></tr>";htmlStr+="<tr><td>`A_(vc) = "+oAnchorProblem.avcShearX.toPrecision(iniPrecision)+"` in^2</td></tr>";htmlStr+="<tr><td>`A_(vco) = "+oAnchorProblem.avcoShearX.toPrecision(iniPrecision)+"` in^2</td></tr>";htmlStr+="<tr><td>`psi_(ec) = 1.0`</td></tr>";htmlStr+="<tr><td>`psi_(ed) = "+oAnchorProblem.psiEdvShearX.toPrecision(iniPrecision)+"`</td></tr>";htmlStr+="<tr><td>`psi_c = 1.0`</td></tr>";htmlStr+="<tr><td>`psi_h = 1.0`</td></tr>";htmlStr+="<tr><td>`V_b = "+oAnchorProblem.VbShearX.toPrecision(iniPrecision)+"` kips</td></tr>";htmlStr+="<tr><td>`ca_1 = "+oAnchorProblem.ca1ShearX.toPrecision(iniPrecision)+"` in</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.vcbX,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>c. Concrete Pryout (D.6.3)</td></th>";htmlStr+="<tr><td>`phiV_(cp) = phi  k_(cp)  N_(cb)`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiPryoutShearX+"`</td></tr>";htmlStr+="<tr><td>`k_(cp) = "+oAnchorProblem.kcpShearX.toPrecision(iniPrecision)+"`</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.vcpX,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;AMprocessNode(document.getElementById(divID));}
VisualAnchorView.prototype.UpdateShearYSolution=function(divID,oAnchorProblem,oLoad,oBolt,oGeometry,oConcrete)
{var htmlStr="<table><tr><th align='left'>Shear Y Capacity = "+oAnchorProblem.maxShearY.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='left'><em>"+oAnchorProblem.shearYCapacityMessage+"</em></th></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><td align='left'><em>a. Bolt Shear = "+GetAnswerString(oAnchorProblem.vsaY,"kips")+"</em></td></th>";htmlStr+="<tr><td align='left'><em>b. Concrete Breakout = "+GetAnswerString(oAnchorProblem.vcbY,"kips")+"</em></td></th>";htmlStr+="<tr><td align='left'><em>c. Concrete Pryout = "+GetAnswerString(oAnchorProblem.vcpY,"kips")+"</em></td></th>";htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;}
VisualAnchorView.prototype.UpdateShearYCapacityCalcs=function(divID,oAnchorProblem,oLoad,oBolt,oGeometry,oConcrete)
{var htmlStr="<table><tr><th>Shear Y Capacity = "+oAnchorProblem.maxShearY.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='center'><em>"+oAnchorProblem.shearYCapacityMessage+"</em></th></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>a. Bolt Shear (D.6.1)</td></th>";htmlStr+="<tr><td>`phiV_(sa) = phi  n  A_(se)  f_(uta)`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiVySteel+"`</td></tr>";htmlStr+="<tr><td>`n = "+oGeometry.NumberOfBolts()+"`</td></tr>";htmlStr+="<tr><td>`A_(se) = "+oBolt.GetArea()+"` in^2</td></tr>";htmlStr+="<tr><td>`f_(uta) = "+oBolt.tensileStrength+"` ksi</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.vsaY,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>b. Concrete Breakout (D.6.2)</td></th>";htmlStr+="<tr><td>`phiV_(cb) = phi  A_(vc)/A_(vco)  psi_(ec)  psi_(ed)  psi_(c)  V_b`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiShearYBreakout+"`</td></tr>";htmlStr+="<tr><td>`A_(vc) = "+oAnchorProblem.avcShearY.toPrecision(iniPrecision)+"` in^2</td></tr>";htmlStr+="<tr><td>`A_(vco) = "+oAnchorProblem.avcoShearY.toPrecision(iniPrecision)+"` in^2</td></tr>";htmlStr+="<tr><td>`psi_(ec) = 1.0`</td></tr>";htmlStr+="<tr><td>`psi_(ed) = "+oAnchorProblem.psiEdvShearY.toPrecision(iniPrecision)+"`</td></tr>";htmlStr+="<tr><td>`psi_c = 1.0`</td></tr>";htmlStr+="<tr><td>`psi_h = 1.0`</td></tr>";htmlStr+="<tr><td>`V_b = "+oAnchorProblem.VbShearY.toPrecision(iniPrecision)+"` kips</td></tr>";htmlStr+="<tr><td>`ca_1 = "+oAnchorProblem.ca1ShearY.toPrecision(iniPrecision)+"` in</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.vcbY,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="<tr><th align='left'>c. Concrete Pryout (D.6.3)</td></th>";htmlStr+="<tr><td>`phiV_(cp) = phi  k_(cp)  N_(cb)`</td></tr>";htmlStr+="<tr><td>`phi = "+oAnchorProblem.phiPryoutShearY+"`</td></tr>";htmlStr+="<tr><td>`k_(cp) = "+oAnchorProblem.kcpShearY.toPrecision(iniPrecision)+"`</td></tr>";htmlStr+="<tr><td align='right'><em>Answer: "+GetAnswerString(oAnchorProblem.vcpY,"kips")+"</em></td></tr>";htmlStr+="<tr></tr>";htmlStr+="</table>";document.getElementById(divID).innerHTML=htmlStr;AMprocessNode(document.getElementById(divID));}
VisualAnchorView.prototype.UpdateInteractionCalcs=function(divID,oAnchorProblem,oLoad,oBolt,oGeometry,oConcrete)
{var tableStyle="rgb(195, 255, 195)";var designMessageStr="DESIGN IS ADEQUATE <img width='20px' src='images/check.png'>";if(oAnchorProblem.interactionX>1||oAnchorProblem.interactionY>1)
{designMessageStr="DESIGN IS INADEQUATE <img width='20px' src='images/x.png'>";tableStyle="rgb(255, 195, 195)";}
var htmlStr="<table style='width:700px; background-color:transparent' >";htmlStr+="<tr><th align='center' valign='middle' colspan='2' style='font-size:large' >"+designMessageStr+"</th></tr>";htmlStr+="<tr>";htmlStr+="<th><table style='background-color:transparent'>";htmlStr+="<tr><th align='left' style='width:500px'>Tensile Capacity: `phiN_n` = "+oAnchorProblem.maxTension.toPrecision(3)+" kips (<em>"+oAnchorProblem.tensionCapacityMessage+"</em>)</th></tr>";htmlStr+="<tr><th align='left'>Shear X Capacity: `phiV_(n_x)` = "+oAnchorProblem.maxShearX.toPrecision(3)+" kips (<em>"+oAnchorProblem.shearXCapacityMessage+"</em>)</th></tr>";htmlStr+="<tr><th align='left'>Shear Y Capacity: `phiV_(n_y)` = "+oAnchorProblem.maxShearY.toPrecision(3)+" kips (<em>"+oAnchorProblem.shearYCapacityMessage+"</em>)</th></tr>";htmlStr+="<tr><th align='left'>Tension: `N_(ua)` = "+oLoad.nZ.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='left'>Shear X: `V_(ua_x)` = "+oLoad.vX.toPrecision(3)+" kips</th></tr>";htmlStr+="<tr><th align='left'>Shear Y: `V_(ua_y)` = "+oLoad.vY.toPrecision(3)+" kips</th></tr>";htmlStr+="</table></th>";htmlStr+="<th><table style='background-color:transparent'>";htmlStr+="<tr><td align='center' valign='middle'>`(N_(ua)/(phiN_n))^(5/3)+(V_(ua)/(phiV_n))^(5/3) <= 1`</td></tr>";htmlStr+="<tr><th align='center'><em>X Interaction = "+oAnchorProblem.interactionX.toPrecision(iniPrecision)+"</em>";if(oAnchorProblem.interactionX.toPrecision(iniPrecision)>=1.0)
{htmlStr+=" <img width='20px' src='images/x.png'>";}
else
{htmlStr+=" <img width='20px' src='images/check.png'>";}
htmlStr+="</th></tr>";htmlStr+="<tr><th align='center'><em>Y Interaction = "+oAnchorProblem.interactionY.toPrecision(iniPrecision)+"</em>";if(oAnchorProblem.interactionY.toPrecision(iniPrecision)>=1.0)
{htmlStr+=" <img width='20px' src='images/x.png'>";}
else
{htmlStr+=" <img width='20px' src='images/check.png'>";}
htmlStr+="</th></tr>";htmlStr+="</table></th></tr>";htmlStr+="</table>";document.getElementById(divID).style.backgroundColor=tableStyle;document.getElementById(divID).innerHTML=htmlStr;AMprocessNode(document.getElementById(divID));}
VisualAnchorView.prototype.UpdatePicture=function(jg,oAnchorProblem,oLoad,oBolt,oGeometry,oConcrete){var canvas_w=400;var canvas_h=300;var canvas_cx=parseInt(canvas_w/2);var canvas_cy=parseInt(canvas_h/2);var nRows=oGeometry.rows;var nCols=oGeometry.columns;var rowSpacing=oGeometry.rowSpacing;var colSpacing=oGeometry.colSpacing;var pattern_w=Math.max(1,(nCols-1))*colSpacing;var pattern_h=Math.max(1,(nRows-1))*rowSpacing;var sketch_w=pattern_w*1.5;var sketch_h=pattern_h*1.5;var scale=Math.min(canvas_h/sketch_h,canvas_w/sketch_w);var bolt_r=10;var bolt_dx=parseInt(scale*colSpacing);var bolt_dy=parseInt(scale*rowSpacing);var bolt_row_label_tweak=0;if(2==nRows){bolt_row_label_tweak=parseInt(scale*rowSpacing/4);}
var bolt_start_x=parseInt(canvas_w/2-parseInt(scale*pattern_w/2));if(nCols===1){bolt_start_x=parseInt(canvas_w/2);}
var bolt_start_y=parseInt(canvas_h/2-parseInt(scale*pattern_h/2));if(nRows===1){bolt_start_y=parseInt(canvas_h/2);}
var bolt_end_x=parseInt(bolt_start_x+bolt_dx*(nCols-1));var bolt_end_y=parseInt(bolt_start_y+bolt_dy*(nRows-1));var rect_left=parseInt(bolt_start_x/2);var rect_w=parseInt(canvas_w-bolt_start_x);var rect_top=parseInt(bolt_start_y/2);var rect_h=parseInt(canvas_h-bolt_start_y);jg.clear();jg.setPrintable(true);jg.setStroke(Stroke.DOTTED);jg.drawLine(bolt_start_x,0,bolt_start_x,canvas_h);jg.drawLine(bolt_end_x,0,bolt_end_x,canvas_h);jg.drawLine(0,bolt_start_y,canvas_w,bolt_start_y);jg.drawLine(0,bolt_end_y,canvas_w,bolt_end_y);if(!window.ActiveXObject){jg.setColor("#dddddd");jg.fillRect(rect_left,rect_top,rect_w,rect_h);}
jg.setStroke(2);jg.setColor("#000000");var cut_size=10;if(oGeometry.leftEdge>10){var xpoints=new Array(rect_left,rect_left,rect_left-cut_size,rect_left+cut_size,rect_left,rect_left);var mid_point_y=rect_top+parseInt(rect_h*0.5);var ypoints=new Array(rect_top,mid_point_y-2*cut_size,mid_point_y-cut_size,mid_point_y+cut_size,mid_point_y+2*cut_size,rect_top+rect_h)
jg.drawPolyline(xpoints,ypoints);}
else{jg.drawLine(rect_left,rect_top,rect_left,rect_top+rect_h);}
var rect_right=rect_left+rect_w;if(oGeometry.rightEdge>10){var xpoints=new Array(rect_right,rect_right,rect_right-cut_size,rect_right+cut_size,rect_right,rect_right);var mid_point_y=rect_top+parseInt(rect_h*0.5);var ypoints=new Array(rect_top,mid_point_y-2*cut_size,mid_point_y-cut_size,mid_point_y+cut_size,mid_point_y+2*cut_size,rect_top+rect_h);jg.drawPolyline(xpoints,ypoints);}
else{jg.drawLine(rect_right,rect_top,rect_right,rect_top+rect_h);}
if(oGeometry.topEdge>10){var mid_point_x=rect_left+parseInt(rect_w*0.5);var xpoints=new Array(rect_left,mid_point_x-2*cut_size,mid_point_x-cut_size,mid_point_x+cut_size,mid_point_x+2*cut_size,rect_right);var ypoints=new Array(rect_top,rect_top,rect_top-cut_size,rect_top+cut_size,rect_top,rect_top);jg.drawPolyline(xpoints,ypoints);}
else{jg.drawLine(rect_left,rect_top,rect_right,rect_top);}
var rect_bottom=rect_top+rect_h;if(oGeometry.bottomEdge>10){var mid_point_x=rect_left+parseInt(rect_w*0.5);var xpoints=new Array(rect_left,mid_point_x-2*cut_size,mid_point_x-cut_size,mid_point_x+cut_size,mid_point_x+2*cut_size,rect_right);var ypoints=new Array(rect_bottom,rect_bottom,rect_bottom-cut_size,rect_bottom+cut_size,rect_bottom,rect_bottom);jg.drawPolyline(xpoints,ypoints);}
else{jg.drawLine(rect_left,rect_bottom,rect_right,rect_bottom);}
jg.setStroke(1);var bolt_x=bolt_start_x;var bolt_y=bolt_start_y;for(var iy=0;iy<nRows;iy++){for(var ix=0;ix<nCols;ix++){jg.setColor("#ff6666");jg.fillEllipse(bolt_x-3,bolt_y-3,bolt_r,bolt_r);jg.setColor("#000000");jg.drawEllipse(bolt_x-3,bolt_y-3,bolt_r,bolt_r);bolt_x+=bolt_dx;}
bolt_x=bolt_start_x
bolt_y+=bolt_dy;}
jg.setStroke(1);jg.setColor("#444444");var dimTickLength=20;var dimHalfTick=parseInt(dimTickLength/2);if(nRows>1){jg.drawLine(bolt_start_x-dimHalfTick,bolt_start_y,bolt_start_x+dimHalfTick,bolt_start_y);jg.drawLine(bolt_start_x-dimHalfTick,bolt_start_y+bolt_dy,bolt_start_x+dimHalfTick,bolt_start_y+bolt_dy);jg.drawLine(bolt_start_x,bolt_start_y,bolt_start_x,bolt_start_y+bolt_dy);jg.drawString(oGeometry.rowSpacing+" in",bolt_start_x+dimHalfTick,parseInt(bolt_start_y+bolt_dy/2+bolt_row_label_tweak));}
if(nCols>1){jg.drawLine(bolt_start_x,bolt_start_y-dimHalfTick,bolt_start_x,bolt_start_y+dimHalfTick);jg.drawLine(bolt_start_x+bolt_dx,bolt_start_y-dimHalfTick,bolt_start_x+bolt_dx,bolt_start_y+dimHalfTick);jg.drawLine(bolt_start_x,bolt_start_y,bolt_start_x+bolt_dx,bolt_start_y);jg.drawString(oGeometry.colSpacing+" in",parseInt(bolt_start_x+bolt_dx/2),bolt_start_y+dimTickLength/2);}
jg.drawLine(bolt_start_x,canvas_cy-dimHalfTick,bolt_start_x,canvas_cy+dimHalfTick);jg.drawLine(rect_left,canvas_cy,bolt_start_x,canvas_cy);jg.drawString(oGeometry.leftEdge+" in",rect_left+10,canvas_cy);jg.drawLine(bolt_end_x,canvas_cy-dimHalfTick,bolt_end_x,canvas_cy+dimHalfTick);jg.drawLine(rect_left+rect_w,canvas_cy,bolt_end_x,canvas_cy);jg.drawString(oGeometry.rightEdge+" in",bolt_end_x+10,canvas_cy);jg.drawLine(canvas_cx-dimHalfTick,bolt_start_y,canvas_cx+dimHalfTick,bolt_start_y);jg.drawLine(canvas_cx,bolt_start_y,canvas_cx,rect_top);jg.drawString(oGeometry.topEdge+" in",canvas_cx+10,parseInt((rect_top+bolt_start_y)/2)-6);jg.drawLine(canvas_cx-dimHalfTick,bolt_end_y,canvas_cx+dimHalfTick,bolt_end_y);jg.drawLine(canvas_cx,bolt_end_y,canvas_cx,rect_top+rect_h);jg.drawString(oGeometry.bottomEdge+" in",canvas_cx+10,parseInt((rect_top+rect_h+bolt_end_y)/2)-6);var arrow_length=40;jg.drawLine(20,rect_top+rect_h+20,20+arrow_length,rect_top+rect_h+20);jg.drawString("x",25+arrow_length,rect_top+rect_h+10);jg.drawLine(20,rect_top+rect_h+20,20,rect_top+rect_h+20-arrow_length);jg.drawString("y",20,rect_top+rect_h+20-arrow_length-20);jg.paint();}
function processPositiveInt(inputField,originalValue,maxVal){try{var inpVal=parseInt(inputField.value,10);if(isNaN(inpVal)||inpVal<=0){var msg="Please enter a positive integer.";var err=new Error(msg);if(!err.message){err.message=msg;}
throw err;}
else if(inpVal>maxVal)
{var msg="Number must be less than "+parseInt(maxVal);var err=new Error(msg);if(!err.message){err.message=msg;}
throw err;}
return true;}catch(e){alert(e.message);inputField.focus();inputField.select();inputField.value=originalValue;return false;}}
function processFloat(inputField,originalValue){try{var inpVal=parseFloat(inputField.value,10);if(isNaN(inpVal)){var msg="Please enter a number.";var err=new Error(msg);if(!err.message){err.message=msg;}
throw err;}
return true;}catch(e){alert(e.message);inputField.focus();inputField.select();inputField.value=originalValue;return false;}}
function processPositiveFloat(inputField,originalValue){try{var inpVal=parseFloat(inputField.value,10);if(isNaN(inpVal)||inpVal<=0){var msg="Please enter a positive number.";var err=new Error(msg);if(!err.message){err.message=msg;}
throw err;}
return true;}catch(e){alert(e.message);inputField.focus();inputField.select();inputField.value=originalValue;return false;}}
function processFloatRange(inputField,minAllowable,maxAllowable,originalValue,additionalMessage){try
{var inpVal=parseFloat(inputField.value,10);if(isNaN(inpVal)||inpVal<minAllowable||inpVal>maxAllowable)
{var msg="";if(additionalMessage)
{msg+=additionalMessage+"\n";}
msg+="Please enter a number between: "+minAllowable+" and "+maxAllowable;var err=new Error(msg);if(!err.message)
{err.message=msg;}
throw err;}
return true;}catch(e){alert(e.message);inputField.focus();inputField.select();inputField.value=originalValue;return false;}}
var iniPrecision=3;function validateHookLength(oAnchorBolt)
{if(oAnchorBolt.IsAnchorHooked())
{var diam=Number(oAnchorBolt.GetDiameter());var minLength=3*diam;var maxLength=12*diam;if(Number(oAnchorBolt.hookLength)<minLength||Number(oAnchorBolt.hookLength)>maxLength)
{var msg="Hook Length must be between 3 * Bolt Diameter and 12 * Bolt Diameter (D.1):\n\n";if(Number(oAnchorBolt.hookLength)<minLength)
{msg+="Try a longer Hook Length per D.1 (up to "+maxLength.toPrecision(iniPrecision)+" inches)\n\n";}
else
{msg+="Try a shorter Hook Length per D.1 (down to "+minLength.toPrecision(iniPrecision)+" inches)\n\n";}
alert(msg);}}}
function SetVisualAnchorCookie(inputID,value)
{setCookie("VisualAnchor_"+inputID,value,9999);}
function VisualAnchorController()
{}
VisualAnchorController.prototype.UpdateAnchorBolt=function(oAnchorBolt,oConcrete)
{var anchorTypeList=document.getElementById(ANCHOR_TYPE_SELECT);var nutTypeList=document.getElementById(NUT_TYPE_SELECT);var anchorDiameterList=document.getElementById(ANCHOR_DIAMETER_SELECT);var aBolt=new AnchorBoltClass();aBolt.anchorType=ETAnchorType[anchorTypeList.selectedIndex];aBolt.nutTypeIndex=nutTypeList.selectedIndex;aBolt.diameterIndex=anchorDiameterList.selectedIndex;if(aBolt.GetBearingArea()<=0)
{alert("Warning: Arbg = 0 because the selected nut type or stud size is not avaialable.");}
oAnchorBolt.anchorType=ETAnchorType[anchorTypeList.selectedIndex];SetVisualAnchorCookie(ANCHOR_TYPE_SELECT,anchorTypeList.selectedIndex);oAnchorBolt.nutTypeIndex=nutTypeList.selectedIndex;SetVisualAnchorCookie(NUT_TYPE_SELECT,nutTypeList.selectedIndex);oAnchorBolt.diameterIndex=anchorDiameterList.selectedIndex;SetVisualAnchorCookie(ANCHOR_DIAMETER_SELECT,nutTypeList.selectedIndex);if(processPositiveFloat(document.getElementById(HOOK_LENGTH_INPUT),anchorDiameterList.hookLength))
{var hookLength=document.getElementById(HOOK_LENGTH_INPUT).value;oAnchorBolt.hookLength=Number(hookLength);SetVisualAnchorCookie(HOOK_LENGTH_INPUT,hookLength);}
var maxAllowableEmbed=Math.min(25,oConcrete.thickness);if(processFloatRange(document.getElementById(EMBED_DEPTH_INPUT),0.01,maxAllowableEmbed,oAnchorBolt.embedDepth,"Embeddment depth limit exceeded (D.4.2.2)"))
{var embedDepth=document.getElementById(EMBED_DEPTH_INPUT).value;oAnchorBolt.embedDepth=Number(embedDepth);SetVisualAnchorCookie(EMBED_DEPTH_INPUT,embedDepth);}
var maxAllowableFuta=125;if(processFloatRange(document.getElementById(TENSILE_STRENGTH_INPUT),1,maxAllowableFuta,oAnchorBolt.tensileStrength,"Steel tensile strength exceeded (D.5.1.2)"))
{var tensileStrength=document.getElementById(TENSILE_STRENGTH_INPUT).value;oAnchorBolt.tensileStrength=Number(tensileStrength);SetVisualAnchorCookie(TENSILE_STRENGTH_INPUT,tensileStrength);}
var anchorsWelded=document.getElementById(ANCHORS_WELDED_CHECK).checked;oAnchorBolt.anchorsWelded=anchorsWelded;SetVisualAnchorCookie(ANCHORS_WELDED_CHECK,anchorsWelded);var groutPads=document.getElementById(GROUT_PADS_CHECK).checked;oAnchorBolt.groutPads=groutPads;SetVisualAnchorCookie(GROUT_PADS_CHECK,groutPads);validateHookLength(oAnchorBolt);}
var maxBolts=30;VisualAnchorController.prototype.UpdateGeometry=function(oAnchorGeometry,oAnchorBolt)
{if(processPositiveInt(document.getElementById(NUM_ROWS_INPUT),oAnchorGeometry.rows,maxBolts))
{var rows=document.getElementById(NUM_ROWS_INPUT).value;oAnchorGeometry.rows=parseInt(rows);document.getElementById(NUM_ROWS_INPUT).value=oAnchorGeometry.rows;SetVisualAnchorCookie(NUM_ROWS_INPUT,rows);}
if(processPositiveInt(document.getElementById(NUM_COLS_INPUT),oAnchorGeometry.columns,maxBolts))
{var columns=document.getElementById(NUM_COLS_INPUT).value;oAnchorGeometry.columns=parseInt(columns);document.getElementById(NUM_COLS_INPUT).value=oAnchorGeometry.columns;SetVisualAnchorCookie(NUM_COLS_INPUT,columns);}
var maxSpacing=3*oAnchorBolt.embedDepth;var minSpacing=4*oAnchorBolt.GetDiameter();if(processFloatRange(document.getElementById(ROW_SPACING_INPUT),minSpacing,maxSpacing,oAnchorGeometry.rowSpacing,"Row spacing limit exceeded. Anchors must be in a group (D.8.1 and D.1)"))
{var rowSpacing=document.getElementById(ROW_SPACING_INPUT).value;oAnchorGeometry.rowSpacing=parseFloat(rowSpacing);SetVisualAnchorCookie(ROW_SPACING_INPUT,rowSpacing);}
if(processFloatRange(document.getElementById(COL_SPACING_INPUT),minSpacing,maxSpacing,oAnchorGeometry.colSpacing,"Column spacing limit exceeded. Anchors must be in a group (D.8.1 and D.1)"))
{var colSpacing=document.getElementById(COL_SPACING_INPUT).value;oAnchorGeometry.colSpacing=parseFloat(colSpacing);SetVisualAnchorCookie(COL_SPACING_INPUT,colSpacing);}
if(processPositiveFloat(document.getElementById(TOP_EDGE_INPUT),oAnchorGeometry.topEdge))
{var topEdge=document.getElementById(TOP_EDGE_INPUT).value;oAnchorGeometry.topEdge=parseFloat(topEdge);SetVisualAnchorCookie(TOP_EDGE_INPUT,topEdge);}
if(processPositiveFloat(document.getElementById(BOTTOM_EDGE_INPUT),oAnchorGeometry.bottomEdge))
{var bottomEdge=document.getElementById(BOTTOM_EDGE_INPUT).value;oAnchorGeometry.bottomEdge=parseFloat(bottomEdge);SetVisualAnchorCookie(BOTTOM_EDGE_INPUT,bottomEdge);}
if(processPositiveFloat(document.getElementById(LEFT_EDGE_INPUT),oAnchorGeometry.leftEdge))
{var leftEdge=document.getElementById(LEFT_EDGE_INPUT).value;oAnchorGeometry.leftEdge=parseFloat(leftEdge);SetVisualAnchorCookie(LEFT_EDGE_INPUT,leftEdge);}
if(processPositiveFloat(document.getElementById(RIGHT_EDGE_INPUT),oAnchorGeometry.rightEdge))
{var rightEdge=document.getElementById(RIGHT_EDGE_INPUT).value;oAnchorGeometry.rightEdge=parseFloat(rightEdge);SetVisualAnchorCookie(RIGHT_EDGE_INPUT,rightEdge);}}
VisualAnchorController.prototype.UpdateConcrete=function(oAnchorConcrete)
{var maxAllowableFc=10;if(processFloatRange(document.getElementById(CONCRETE_STRENGTH_INPUT),0.1,maxAllowableFc,oAnchorConcrete.fc,"Concrete compressive strength (f'c) exceeded (D.3.5)"))
{var concreteStrength=document.getElementById(CONCRETE_STRENGTH_INPUT).value;oAnchorConcrete.fc=concreteStrength;}
if(processPositiveFloat(document.getElementById(CONCRETE_THICKNESS_INPUT),oAnchorConcrete.thickness))
{var thickness=document.getElementById(CONCRETE_THICKNESS_INPUT).value;oAnchorConcrete.thickness=thickness;}
var barsCrossTensionFailure=document.getElementById(TENSION_BARS_CHECK).checked;oAnchorConcrete.barsCrossTensionFailure=barsCrossTensionFailure;var barsPreventTensionBreakout=document.getElementById(TENSION_BREAKOUT_CHECK).checked;oAnchorConcrete.barsPreventTensionBreakout=barsPreventTensionBreakout;var shearXNumber4Bars=document.getElementById(SHEARX_4BAR_CHECK).checked;oAnchorConcrete.shearXNumber4Bars=shearXNumber4Bars;var shearXStirrups=document.getElementById(SHEARX_STIRRUPS_CHECK).checked;oAnchorConcrete.shearXStirrups=shearXStirrups;var shearXNoBreakout=document.getElementById(SHEARX_BREAKOUT_CHECK).checked;oAnchorConcrete.shearXNoBreakout=shearXNoBreakout;var shearYNumber4Bars=document.getElementById(SHEARY_4BAR_CHECK).checked;oAnchorConcrete.shearYNumber4Bars=shearYNumber4Bars;var shearYStirrups=document.getElementById(SHEARY_STIRRUPS_CHECK).checked;oAnchorConcrete.shearYStirrups=shearYStirrups;var shearYNoBreakout=document.getElementById(SHEARY_BREAKOUT_CHECK).checked;oAnchorConcrete.shearYNoBreakout=shearYNoBreakout;}
VisualAnchorController.prototype.UpdateLoad=function(oAnchorLoad)
{var factoredLoadSource=document.getElementById(LOAD_FACTOR_SELECT);oAnchorLoad.factorLoadSource=ETFactoredLoadSource[factoredLoadSource.selectedIndex];if(processFloat(document.getElementById(LOAD_TENSION_INPUT),oAnchorLoad.nZ))
{var nZ=document.getElementById(LOAD_TENSION_INPUT).value;oAnchorLoad.nZ=parseFloat(nZ);}
if(processFloat(document.getElementById(LOAD_XSHEAR_INPUT),oAnchorLoad.vX))
{var vX=document.getElementById(LOAD_XSHEAR_INPUT).value;oAnchorLoad.vX=Number(vX);}
if(processFloat(document.getElementById(LOAD_YSHEAR_INPUT),oAnchorLoad.vY))
{var vY=document.getElementById(LOAD_YSHEAR_INPUT).value;oAnchorLoad.vY=Number(vY);}
var categoryCOrHigher=document.getElementById(LOAD_CORHIGHER_CHECK).checked;oAnchorLoad.categoryCOrHigher=categoryCOrHigher;}
VisualAnchorController.prototype.UpdateProjectInfo=function(oAnchorProjectInfo)
{var title=document.getElementById(PROJECT_TITLE_INPUT).value;oAnchorProjectInfo.title=title;var client=document.getElementById(PROJECT_CLIENT_INPUT).value;oAnchorProjectInfo.client=client;var jobID=document.getElementById(PROJECT_ID_INPUT).value;oAnchorProjectInfo.jobID=jobID;var designer=document.getElementById(PROJECT_DESIGNER_INPUT).value;oAnchorProjectInfo.designer=designer;}
VisualAnchorController.prototype.UpdateSolution=function(oBolt,oGeometry,oConcrete,oLoad,oAnchorDesign,oAnchorProblem)
{oAnchorProblem.CalculateTensionCapacity(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);oAnchorProblem.CalculateShearXCapacity(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);oAnchorProblem.CalculateShearYCapacity(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);oAnchorProblem.CalculateInteractionValueX(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);oAnchorProblem.CalculateInteractionValueY(oAnchorDesign,oLoad,oBolt,oGeometry,oConcrete);}
var MATHPLAYER="math-player";var ANCHOR_INPUT="anchor-input";var GEOMETRY_INPUT="geometry-input";var CONCRETE_INPUT="concrete-input";var LOAD_INPUT="load-input";var PROJECT_INFO_INPUT="project-info-input";var PROJECT_INFO_SUMMARY="project-info-summary";var ANCHOR_SUMMARY="anchor-summary";var CONCRETE_SUMMARY="concrete-summary";var LOAD_SUMMARY="load-summary";var PICTURE_SUMMARY="picture-summary";var PICTURE_CANVAS="canvas";var OUTPUT_SUMMARY="output-summary";var SOLUTION_SUMMARY="solution-summary";var TENSILE_SOLUTION="tensile-solution";var SHEARX_SOLUTION="shearx-solution";var SHEARY_SOLUTION="sheary-solution";var TENSILE_CAPACITY_SUMMARY="tensile-capacity-summary";var SHEARX_CAPACITY_SUMMARY="shearx-capacity-summary";var SHEARY_CAPACITY_SUMMARY="sheary-capacity-summary";var INTERACTION_CHECK_SUMMARY="interaction-check-summary";var WORKSPACE_COLUMN="workspace-column";var AnchorBolt=new AnchorBoltClass();var AnchorGeometry=new AnchorGeometryClass();var AnchorConcrete=new AnchorConcreteClass();var AnchorLoad=new AnchorLoadClass();var ProjectInfo=new AnchorProjectInfoClass();var AnchorDesign=new AnchorACIDesignClass();var AnchorProblem=new AnchorProblemClass();var View=new VisualAnchorView();var Controller=new VisualAnchorController();var AnchorGraphics;var messageDialog=new YAHOO.widget.SimpleDialog("messageDialog",{width:"400px",fixedcenter:true,visible:false,draggable:false,close:true,modal:true,zindex:6,text:"Do you want to continue?",icon:YAHOO.widget.SimpleDialog.ICON_HELP,constraintoviewport:true,buttons:[{text:"Ok",handler:handleMessageDialogOk,isDefault:true}]});messageDialog.setHeader("VisualAnchor Message");messageDialog.render("messageBox");var mathPlayerDialog=new YAHOO.widget.SimpleDialog("mathPlayerDialog",{width:"400px",fixedcenter:true,visible:false,draggable:false,close:true,modal:true,zindex:6,text:"We recommend upgrading to the latest version of Mathplayer",icon:YAHOO.widget.SimpleDialog.ICON_HELP,constraintoviewport:true,buttons:[{text:"Upgrade",handler:handleUpgradeMathPlayer,isDefault:true},{text:"Maybe Later",handler:handleMaybeLater,isDefault:false}]});mathPlayerDialog.setHeader("VisualAnchor Requirement");mathPlayerDialog.render("messageBox");function handleMessageDialogOk(){this.hide();}
function handleUpgradeMathPlayer(){this.hide();}
function handleMaybeLater(){this.hide();}
function setCookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString());}
function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length;}
return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function isIEWindows()
{return((navigator.appName=="Microsoft Internet Explorer")&&(navigator.appVersion.indexOf("Windows")!=-1));}
function isMPInstalled()
{try
{var oMP=new ActiveXObject("MathPlayer.Factory.1");return true;}
catch(e)
{return false;}}
function isMathPlayerNeeded()
{if(!isIEWindows())
{return false;}
if(isMPInstalled())
{return false;}
var htmlStr="<div style='background: #FFCC33; margin: 70px; padding: 10px; display: inline-block; clear: both;'>";htmlStr+="<h2 class='red' style='background: #FFCC33;'>MathPlayer is Required in Internet Explorer</h2>";htmlStr+="<p style='background: #FFCC33;'>You will need to install MathPlayer, which is available for free download:<br />";htmlStr+="<a href='http://www.dessci.com/en/products/mathplayer/download.htm'>MathPlayer Setup and Information</a></p>";htmlStr+="<p style='background: #FFCC33;'>(Note: Mathplayer is not necessary in Firefox or Chrome, which are <b>smarter</b> than IE6, IE7, or IE8.)</p></div>";document.getElementById(MATHPLAYER).innerHTML=htmlStr;return true;}
window.onload=function()
{init();}
function init()
{isMathPlayerNeeded();View.CreateAnchorDialog(ANCHOR_INPUT,AnchorBolt);View.CreateGeometryDialog(GEOMETRY_INPUT,AnchorGeometry);View.CreateConcreteDialog(CONCRETE_INPUT,AnchorConcrete);View.CreateLoadDialog(LOAD_INPUT,AnchorLoad);View.CreateProjectInfoDialog(PROJECT_INFO_INPUT,ProjectInfo);AnchorGraphics=new jsGraphics(PICTURE_CANVAS);updateAnchorBolt();updateGeometry();updateConcrete();updateLoad();updateProjectInfo();}
function updateAnchorBolt()
{Controller.UpdateAnchorBolt(AnchorBolt,AnchorConcrete);Controller.UpdateSolution(AnchorBolt,AnchorGeometry,AnchorConcrete,AnchorLoad,AnchorDesign,AnchorProblem);View.UpdateAnchorDialogView(AnchorBolt);View.UpdateAnchorOutputView(ANCHOR_SUMMARY,AnchorBolt);View.UpdateTensileSolution(TENSILE_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateTensileCapacityCalcs(TENSILE_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXSolution(SHEARX_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXCapacityCalcs(SHEARX_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYSolution(SHEARY_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYCapacityCalcs(SHEARY_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateInteractionCalcs(OUTPUT_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);}
function updateGeometry()
{Controller.UpdateGeometry(AnchorGeometry,AnchorBolt);Controller.UpdateSolution(AnchorBolt,AnchorGeometry,AnchorConcrete,AnchorLoad,AnchorDesign,AnchorProblem);View.UpdateGeometryDialogView(AnchorGeometry);View.UpdateGeometryOutputView(AnchorGeometry);View.UpdatePicture(AnchorGraphics,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateTensileSolution(TENSILE_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateTensileCapacityCalcs(TENSILE_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXSolution(SHEARX_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXCapacityCalcs(SHEARX_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYSolution(SHEARY_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYCapacityCalcs(SHEARY_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateInteractionCalcs(OUTPUT_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);}
function updateConcrete()
{Controller.UpdateConcrete(AnchorConcrete);Controller.UpdateSolution(AnchorBolt,AnchorGeometry,AnchorConcrete,AnchorLoad,AnchorDesign,AnchorProblem);View.UpdateConcreteDialogView(AnchorConcrete);View.UpdateConcreteOutputView(CONCRETE_SUMMARY,AnchorConcrete);View.UpdateTensileSolution(TENSILE_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateTensileCapacityCalcs(TENSILE_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXSolution(SHEARX_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXCapacityCalcs(SHEARX_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYSolution(SHEARY_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYCapacityCalcs(SHEARY_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateInteractionCalcs(OUTPUT_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);}
function updateLoad()
{Controller.UpdateLoad(AnchorLoad);Controller.UpdateSolution(AnchorBolt,AnchorGeometry,AnchorConcrete,AnchorLoad,AnchorDesign,AnchorProblem);View.UpdateLoadDialogView(AnchorLoad);View.UpdateLoadOutputView(LOAD_SUMMARY,AnchorLoad);View.UpdateTensileSolution(TENSILE_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateTensileCapacityCalcs(TENSILE_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXSolution(SHEARX_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearXCapacityCalcs(SHEARX_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYSolution(SHEARY_SOLUTION,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateShearYCapacityCalcs(SHEARY_CAPACITY_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);View.UpdateInteractionCalcs(OUTPUT_SUMMARY,AnchorProblem,AnchorLoad,AnchorBolt,AnchorGeometry,AnchorConcrete);}
function updateProjectInfo()
{Controller.UpdateProjectInfo(ProjectInfo);View.UpdateProjectInfoDialogView(ProjectInfo);View.UpdateProjectInfoSummary(PROJECT_INFO_SUMMARY,ProjectInfo);View.UpdateProjectInfoOutputView(ProjectInfo);}