function solve() {
  var s = Math.abs(document.checkMath.s.value)
  var x = Math.abs(document.checkMath.x.value)
  if ( x> s) {
     noGood()
     return false
  }

  var d = (document.checkMath.d.value)
  var v = (document.checkMath.v.value)
  var y = .5*(Math.sqrt((Math.pow(s,2))-(Math.pow(x,2))))

  for (var count=0; count=100; count++) {
  var m = (Math.pow((x/2),2))
  var n = (Math.sqrt(4*Math.pow(y,2)+Math.pow((x/2),2)))
  var s1 = (m/(2*y))
  var s2 = (Math.log((2*y+n)/(x/2)))
  var s3 = s1*s2
  var s4 = n+s3
  if (s4<s) {
     break
  }
  y=y-.1
  }
      x = x/2
      y = (Math.round(10*y))/10
  var f = (.291*v*v)
  var p = (f*d*x)
  var t0 = ((p*x)/(2*y))
  var t1 = (Math.sqrt(p*p+t0*t0))
      t1 = (Math.round(t1))

      p = (Math.round(p))
  var p1 = (2*p)
  var tanTheta = (p/t0)
  var theta = (Math.atan(tanTheta))
      theta = (Math.round(theta*57.3))  

  document.checkMath.y.value = y + " feet"
  document.checkMath.t1.value = t1 + " pounds"

  document.checkMath.p1.value = p1 + " pounds"
  document.checkMath.theta.value = theta + " degrees"
  if (t1>1960) {
     overLoad()
     return false
  }
  
}
function noGood() {
  alert ("The anchor spacing must be less than the barrier length!")
}
function overLoad() {
  alert ("The cable load exceeds 1960 pounds.")
}
function notice() {
  alert ("NOTICE The use of the data presented here is completely "+
"at the discretion of the user. Aer-Flo Canvas Products Inc."+
"makes no warranty as to the suitability of the developed "+
"data and will not be responsible for the consequences of its use.")
}
