// Original script: Copyright (c) 1996-1997 Tomer Shiran. All rights reserved.
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
// Improvements: Copyright (c) 2008 Ralph Sickinger, WILLCOR, Inc.

var caution = false
var nodecnt = 0
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "")
  if (!caution || (name + "=" + escape(value)).length <= 4000)
    document.cookie = curCookie
  else
    if (confirm("Cookie exceeds 4KB and will be cut!"))
      document.cookie = curCookie
}
function getCookie(name) {
  var prefix = name + "="
  var cookieStartIndex = document.cookie.indexOf(prefix)
  if (cookieStartIndex == -1)
    return null
  var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
  if (cookieEndIndex == -1)
    cookieEndIndex = document.cookie.length
  return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT"
  }
}
function fixDate(date) {
  var base = new Date(0)
  var skew = base.getTime()
  if (skew > 0)
    date.setTime(date.getTime() - skew)
}
function item(parent, caption, file, id, depth) {
  if (parent) { nodecnt++ }

  this.parent = parent
  this.text = caption
  this.id = id
  this.file = file
  this.depth = depth
}
function makeArray(length) {
  this.length = length
}
function makeDatabase() {
  var ix = 0
  outline = new makeArray(142)

//        outline[0] = new item(false, "<i>Summary</i>","summary","",0)

        outline[ix] = new item(false, "MIL-STD-961E","index","",0)
        ix++
        outline[ix] = new item(false, "FOREWORD","2","",0)
        ix++
        outline[ix] = new item(false, "1. SCOPE","3","",0)
        ix++
        outline[ix] = new item(true, "2. APPLICABLE DOCUMENTS","4","1",0)
        ix++
        outline[ix] = new item(false, "2.1 General","41","",1)
        ix++
        outline[ix] = new item(true, "2.2 Government documents","42","2",1)
        ix++
        outline[ix] = new item(false, "2.2.1 Specifications, standards, and handbooks","421","",2)
        ix++
        outline[ix] = new item(false, "2.2.2 Other Governmental documents, drawings, and publications","422","",2)
        ix++
        outline[ix] = new item(false, "2.3 Non-Government publications","43","",1)
        ix++
        outline[ix] = new item(false, "2.4 Order of precedence","44","",1)
        ix++
        outline[ix] = new item(true, "3. DEFINITIONS","5","3",0)
        ix++
        outline[ix] = new item(false, "3.1 - 3.20","51","",1)
        ix++
        outline[ix] = new item(false, "3.21 - 3.40","52","",1)
        ix++
        outline[ix] = new item(false, "3.41 - 3.52","53","",1)
        ix++
        outline[ix] = new item(true, "4. GENERAL REQUIREMENTS","6","4",0)
        ix++
        outline[ix] = new item(false, "4.1 General","61","",1)
        ix++
        outline[ix] = new item(false, "4.2 Coverage","62","",1)
        ix++
        outline[ix] = new item(false, "4.3 Data requirements","63","",1)
        ix++
        outline[ix] = new item(false, "4.4 Contractual and administrative requirements","64","",1)
        ix++
        outline[ix] = new item(false, "4.5 Classified material","65","",1)
        ix++
        outline[ix] = new item(false, "4.6 Text","66","",1)
        ix++
        outline[ix] = new item(false, "4.7 Measurements","67","",1)
        ix++
        outline[ix] = new item(false, "4.8 Metric practices","68","",1)
        ix++
        outline[ix] = new item(false, "4.9 Paragraph numbering","69","",1)
        ix++
        outline[ix] = new item(false, "4.10 Paragraph identification","6a","",1)
        ix++
        outline[ix] = new item(false, "4.11 Specification identifier","6b","",1)
        ix++
        outline[ix] = new item(false, "4.12 Page number","6c","",1)
        ix++
        outline[ix] = new item(false, "4.13 Tables","6d","",1)
        ix++
        outline[ix] = new item(false, "4.14 Figures","6e","",1)
        ix++
        outline[ix] = new item(false, "4.15 Footnotes and notes","6f","",1)
        ix++
        outline[ix] = new item(false, "4.16 Foldouts","6g","",1)
        ix++
        outline[ix] = new item(false, "4.17 Definitions","6h","",1)
        ix++
        outline[ix] = new item(false, "4.18 Cross-reference","6i","",1)
        ix++
        outline[ix] = new item(false, "4.19 References to other documents","6j","",1)
        ix++
        outline[ix] = new item(false, "4.20 Approved document format","6k","",1)
        ix++
        outline[ix] = new item(true, "5. DETAILED REQUIREMENTS","7","5",0)
        ix++
        outline[ix] = new item(false, "5.1 General","71","",1)
        ix++
        outline[ix] = new item(false, "5.2 Draft note","72","",1)
        ix++
        outline[ix] = new item(true, "5.3 Cover page","73","6",1)
        ix++
        outline[ix] = new item(false, "5.3.1 Program-unique specifications","731","",2)
        ix++
        outline[ix] = new item(false, "5.3.2 Defense specifications","732","",2)
        ix++
        outline[ix] = new item(true, "5.4 First page information for defense specifications without cover page","74","7",1)
        ix++
        outline[ix] = new item(false, "5.4.1 Defense specification identifiers","741","",2)
        ix++
        outline[ix] = new item(false, "5.4.2 Date of specification","742","",2)
        ix++
        outline[ix] = new item(false, "5.4.3 Measurement system identification","743","",2)
        ix++
        outline[ix] = new item(false, "5.4.4 Superseding document indicator","744","",2)
        ix++
        outline[ix] = new item(false, "5.4.5 Heading","745","",2)
        ix++
        outline[ix] = new item(true, "5.4.6 Specification titles","746","8",2)
        ix++
        outline[ix] = new item(false, "5.4.6.1 Itern names","7461","",3)
        ix++
        outline[ix] = new item(false, "5.4.6.2 General rules","7462","",3)
        ix++
        outline[ix] = new item(false, "5.4.6.3 First part of title","7463","",3)
        ix++
        outline[ix] = new item(false, "5.4.6.4 Second part of title","7464","",3)
        ix++
        outline[ix] = new item(false, "5.4.7 Inactivation and reactivation note","747","",2)
        ix++
        outline[ix] = new item(false, "5.4.8 Preambles","748","",2)
        ix++
        outline[ix] = new item(false, "5.4.9 Contact information","749","",2)
        ix++
        outline[ix] = new item(false, "5.4.10 Designation of federal supply class (FSC), group (FSG), or area assignment","74a","",2)
        ix++
        outline[ix] = new item(false, "5.4.11 AMSC number","74b","",2)
        ix++
        outline[ix] = new item(false, "5.4.12 Restriction statements","74c","",2)
        ix++
        outline[ix] = new item(false, "5.5 Sectional arrangement of specifications","75","",1)
        ix++
        outline[ix] = new item(true, "5.6 Section 1 - Scope","76","9",1)
        ix++
        outline[ix] = new item(false, "5.6.1 Scope","761","",2)
        ix++
        outline[ix] = new item(true, "5.6.2 Classification and part or identifying number (PIN)","762","@",2)
        ix++
        outline[ix] = new item(false, "5.6.2.1 Classification","7621","",3)
        ix++
        outline[ix] = new item(false, "5.6.2.2 PIN","7622","",3)
        ix++
        outline[ix] = new item(false, "5.6.3 Additional scope requirements for program-unique specifications only","763","",2)
        ix++
        outline[ix] = new item(true, "5.7 Section 2 - Applicable Documents","77","A",1)
        ix++
        outline[ix] = new item(false, "5.7.1 Listing of applicable documents","771","",2)
        ix++
        outline[ix] = new item(true, "5.7.2 Government documents","772","B",2)
        ix++
        outline[ix] = new item(false, "5.7.2.1 Government specifications, standards, and handbooks","7721","",3)
        ix++
        outline[ix] = new item(false, "5.7.2.2 Other Government documents, drawings, and publications","7722","",3)
        ix++
        outline[ix] = new item(false, "5.7.3 Non-government standards and other publications","773","",2)
        ix++
        outline[ix] = new item(false, "5.7.4 Order of precedence","774","",2)
        ix++
        outline[ix] = new item(false, "5.8 Section 3 - Requirements","78","",1)
        ix++
        outline[ix] = new item(false, "5.9 Section 4 - Verification","79","",1)
        ix++
        outline[ix] = new item(false, "5.10 Section 5 - Packaging","7a","",1)
        ix++
        outline[ix] = new item(false, "5.11 Section 6 - Notes","7b","",1)
        ix++
        outline[ix] = new item(false, "5.12 Concluding material","7c","",1)
        ix++
        outline[ix] = new item(false, "5.13 Appendix","7d","",1)
        ix++
        outline[ix] = new item(false, "5.14 Index","7e","",1)
        ix++
        outline[ix] = new item(false, "5.15 Supplement","7f","",1)
        ix++
        outline[ix] = new item(false, "5.16 Specification sheets","7g","",1)
        ix++
        outline[ix] = new item(false, "5.17 Revision","7h","",1)
        ix++
        outline[ix] = new item(false, "5.18 Amendments","7i","",1)
        ix++
        outline[ix] = new item(false, "5.19 Notices","7j","",1)
        ix++
        outline[ix] = new item(false, "6. NOTES","8","",0)
        ix++
        outline[ix] = new item(true, "FIGURES","9","C",0)
        ix++
        outline[ix] = new item(false, "1. Checklist for drafting specifications","91","",1)
        ix++
        outline[ix] = new item(false, "2. Example of cover page for program-unique specifications","92","",1)
        ix++
        outline[ix] = new item(false, "3. Example of cover page for defense specification","93","",1)
        ix++
        outline[ix] = new item(false, "4. Example of section 1","94","",1)
        ix++
        outline[ix] = new item(false, "5. Example of section 2","95","",1)
        ix++
        outline[ix] = new item(false, "6. Example of requirements in performance specification","96","",1)
        ix++
        outline[ix] = new item(false, "7. Example of requirements in detail specification","97","",1)
        ix++
        outline[ix] = new item(false, "8. Example of section 4","98","",1)
        ix++
        outline[ix] = new item(false, "9. Example of section 6","99","",1)
        ix++
        outline[ix] = new item(false, "10. Example of a supplement","9a","",1)
        ix++
        outline[ix] = new item(false, "11. Example of specification sheet","9b","",1)
        ix++
        outline[ix] = new item(false, "12. Example of amendment","9c","",1)
        ix++
        outline[ix] = new item(false, "13. Example of inactive for new design notice","9d","",1)
        ix++
        outline[ix] = new item(false, "14. Example of cancellation notice","9e","",1)
        ix++
        outline[ix] = new item(false, "15. Example of cancellation notice with superseding document","9f","",1)
        ix++
        outline[ix] = new item(false, "16. Example of reinstatement notice","9g","",1)
        ix++
        outline[ix] = new item(false, "17. Example of reactivation notice","9h","",1)
        ix++
        outline[ix] = new item(false, "18. Examples of administrative notice","9i","",1)
        ix++
        outline[ix] = new item(true, "APPENDIX","a","D",0)
        ix++
        outline[ix] = new item(false, "A.1 Scope","a1","",1)
        ix++
        outline[ix] = new item(false, "A.2 Top-Level Program-Unique Performance Requirements","a2","",1)
        ix++
        outline[ix] = new item(true, "A.3 Description of Requirements Often Found in Specifications","a3","E",1)
        ix++
        outline[ix] = new item(false, "A.3.1 General","a31","",2)
        ix++
        outline[ix] = new item(false, "A.3.2 Reliability","a32","",2)
        ix++
        outline[ix] = new item(false, "A.3.3 Maintainability","a33","",2)
        ix++
        outline[ix] = new item(false, "A.3.4 Deployability","a34","",2)
        ix++
        outline[ix] = new item(false, "A.3.5 Availability","a35","",2)
        ix++
        outline[ix] = new item(false, "A.3.6 Environmental conditions","a36","",2)
        ix++
        outline[ix] = new item(false, "A.3.7 Transportability","a37","",2)
        ix++
        outline[ix] = new item(false, "A.3.8 Materials and processes","a38","",2)
        ix++
        outline[ix] = new item(false, "A.3.9 Electromagnetic radiation","a39","",2)
        ix++
        outline[ix] = new item(false, "A.3.10 Nameplates or product markings","a3a","",2)
        ix++
        outline[ix] = new item(false, "A.3.11 Producibility","a3b","",2)
        ix++
        outline[ix] = new item(false, "A.3.12 Interchangeability","a3c","",2)
        ix++
        outline[ix] = new item(false, "A.3.13 Safety","a3d","",2)
        ix++
        outline[ix] = new item(false, "A.3.14 Human factors engineering","a3e","",2)
        ix++
        outline[ix] = new item(false, "A.3.15 Security and privacy","a3f","",2)
        ix++
        outline[ix] = new item(false, "A.3.16 Computer resource requirements","a3g","",2)
        ix++
        outline[ix] = new item(false, "A.3.17 Logistics","a3h","",2)
        ix++
        outline[ix] = new item(false, "A.3.18 Interface requirements","a3i","",2)
        ix++
        outline[ix] = new item(false, "A.3.19 Computer hardware requirements","a3j","",2)
        ix++
        outline[ix] = new item(false, "A.3.20 Computer communications requirements","a3k","",2)
        ix++
        outline[ix] = new item(false, "A.3.21 Computer software requirements","a3l","",2)
        ix++
        outline[ix] = new item(false, "A.3.22 CSCI internal interfaces","a3m","",2)
        ix++
        outline[ix] = new item(false, "A.3.23 CSCI internal data requirements","a3n","",2)
        ix++
        outline[ix] = new item(false, "A.3.24 Design and construction","a3o","",2)
        ix++
        outline[ix] = new item(false, "A.3.25 Software design","a3p","",2)
        ix++
        outline[ix] = new item(false, "A.3.26 Workmanship","a3q","",2)
        ix++
        outline[ix] = new item(false, "A.3.27 Product characteristics","a3r","",2)
        ix++
        outline[ix] = new item(false, "A.3.28 Chemical, electrical, and mechanical properties","a3s","",2)
        ix++
        outline[ix] = new item(false, "A.3.29 Stability","a3t","",2)
        ix++
        outline[ix] = new item(true, "INDEX","b","F",0)
        ix++
        outline[ix] = new item(false, "A - F","b1","",1)
        ix++
        outline[ix] = new item(false, "G-O","b2","",1)
        ix++
        outline[ix] = new item(false, "P-W","b3","",1)
        ix++
        outline[ix] = new item(false, "CONCLUDING MATERIAL","c","",0)
        ix++

  setStates()
  setImages()
}

function resetStates() {
  setCookie("mil-std-961e_outline", "-")
}

function setStates() {
  var storedValue = getCookie("mil-std-961e_outline")
  var parentExpanded = true
  var lastExp = 0
  var text = ""
  var k = 0

  storedValue += "-"
  for (var i = 0; i < outline.length; ++i) {
    if (outline[i].parent) {
      text = "-" + outline[i].id + "-"
      if (storedValue.indexOf(text) != -1)
        outline[i].state = true
      else
        outline[i].state = false
    }
  }

  for (var i = 0; i < outline.length; ++i) {
    if (outline[i].parent) {
      if ((outline[i].depth == 0) || (outline[i].depth <= lastExp) || (parentExpanded)) {
        outline[i].visible = true
        if (outline[i].state)
          lastExp = outline[i].depth + 1
        else
          if (outline[i].depth < lastExp)
            lastExp = outline[i].depth
      } else
        outline[i].visible = false
      parentExpanded = (outline[i].state && outline[i].visible)
    } else {
      if (parentExpanded)
        outline[i].visible = true
      else
        outline[i].visible = false
    }
  }
}
function setImages() {
  for (var i = 0; i < outline.length; ++i) {
    if (outline[i].visible)
      if (outline[i].parent)
        if (((outline[i+1].parent) && (outline[i+1].depth <= outline[i].depth)))
          outline[i].pic = '<IMG SRC="../../minus.gif" BORDER=0>'
        else
          if (outline[i].state)
            outline[i].pic = '<A HREF="javascript:toggle(' + i + ')"><IMG SRC="../../minus.gif" BORDER=0></A>'
          else
            outline[i].pic = '<A HREF="javascript:toggle(' + i + ')"><IMG SRC="../../plus.gif" BORDER=0></A>'
      else
        outline[i].pic = '<IMG SRC="../../leaf.gif" BORDER=0>'
  }
}
function toggle(num) {
  outline[num].state = !outline[num].state

  setStorage()
  history.go(0)
}
function setStorage() {
  var text = "-"
  for (var i = 0; i < outline.length; ++i) {
    if ((outline[i].parent) && (outline[i].state)) {
      text += (outline[i].id)
      text += '-'
    }
  }

  setCookie("mil-std-961e_outline", text)
}
function drawTree(myname) {
  document.write('<table>');
  for (var i = 0; i < outline.length; ++i) {
    if (outline[i].visible) {
      document.write('<tr><td align=right valign=top colspan=',(outline[i].depth + 1),'>')
      document.write(outline[i].pic, ' ')
      document.write('</td><td colspan=',(4-outline[i].depth))
      if (myname == outline[i].file)
        document.write(' class="boldredtxt"><b>', outline[i].text, '</b>')
      else
        document.write('><a href="',outline[i].file,'.html">', outline[i].text, '</a>')
      document.write('</td></tr>')
    } else {
      var previous = i
      for (var k = i + 1; k < outline.length && outline[k].depth >= outline[previous].depth; ++k) {
        ++i
      }
    }
  }
  document.write('<tr>');
  for (var j = 0; j < 12; ++j) { document.write('<td width=12>&nbsp;</td>') }
  document.write('</tr></table>');
}
makeDatabase()


