// 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(120)

//        outline[0] = new item(false, "<i>Summary</i>","summary","",0)

        outline[ix] = new item(false, "1.0  Introduction","index","",0)
        ix++
        outline[ix] = new item(true, "2.0  Executive Summary","2","1",0)
        ix++
        outline[ix] = new item(false, "2.1  Program Management","21","",1)
        ix++
        outline[ix] = new item(false, "2.2  General Battery Requirements","22","",1)
        ix++
        outline[ix] = new item(false, "2.3  Battery Types","23","",1)
        ix++
        outline[ix] = new item(true, "3.0  Program Management","3","2",0)
        ix++
        outline[ix] = new item(false, "Program Management Overview","31","",1)
        ix++
        outline[ix] = new item(false, "3.1  Terminology","32","",1)
        ix++
        outline[ix] = new item(false, "3.2 Battery Type","33","",1)
        ix++
        outline[ix] = new item(false, "3.3  Standardization","34","",1)
        ix++
        outline[ix] = new item(false, "3.4  Life Cycle Planning","35","",1)
        ix++
        outline[ix] = new item(false, "3.5  Schedule","36","",1)
        ix++
        outline[ix] = new item(false, "3.6  Documentation","37","",1)
        ix++
        outline[ix] = new item(false, "3.7  Reliability, Maintainability, and Availability","38","",1)
        ix++
        outline[ix] = new item(false, "3.8  Safety Issues","39","",1)
        ix++
        outline[ix] = new item(false, "3.9  What To Watch For in Battery Design and Manufacturing","3a","",1)
        ix++
        outline[ix] = new item(false, "3.10  What to Watch for in Battery Integration","3b","",1)
        ix++
        outline[ix] = new item(true, "4.0  General Battery Considerations","4","3",0)
        ix++
        outline[ix] = new item(false, "4.1  Selecting A Battery","41","",1)
        ix++
        outline[ix] = new item(false, "4.2  Specifications","42","",1)
        ix++
        outline[ix] = new item(false, "4.3  Cell and Battery Configuration","43","",1)
        ix++
        outline[ix] = new item(false, "4.4  Quality Control","44","",1)
        ix++
        outline[ix] = new item(false, "4.5  Testing","45","",1)
        ix++
        outline[ix] = new item(false, "4.6  Failure Modes and Analysis","46","",1)
        ix++
        outline[ix] = new item(false, "4.7  Packaging, Handling...","47","",1)
        ix++
        outline[ix] = new item(true, "5.0  Lead Acid Batteries","5","4",0)
        ix++
        outline[ix] = new item(false, "5.1  Introduction","51","",1)
        ix++
        outline[ix] = new item(false, "5.2  Applications","52","",1)
        ix++
        outline[ix] = new item(true, "5.3  Design","53","5",1)
        ix++
        outline[ix] = new item(false, "5.3 Design (Part 1)","531","",2)
        ix++
        outline[ix] = new item(false, "5.3 Design (Part 2)","532","",2)
        ix++
        outline[ix] = new item(true, "5.4  Manufacturing and Quality Assurance","54","6",1)
        ix++
        outline[ix] = new item(false, "Lead Alloy","541","",2)
        ix++
        outline[ix] = new item(false, "Grid Fabrication","542","",2)
        ix++
        outline[ix] = new item(false, "Oxides","543","",2)
        ix++
        outline[ix] = new item(false, "Sulfuric Acid","544","",2)
        ix++
        outline[ix] = new item(false, "Plate Manufacture","545","",2)
        ix++
        outline[ix] = new item(false, "Plate Curing","546","",2)
        ix++
        outline[ix] = new item(false, "Separator","547","",2)
        ix++
        outline[ix] = new item(false, "Containers and Covers","548","",2)
        ix++
        outline[ix] = new item(false, "Cell Fabrication","549","",2)
        ix++
        outline[ix] = new item(false, "Filling","54a","",2)
        ix++
        outline[ix] = new item(false, "Container Formation","54b","",2)
        ix++
        outline[ix] = new item(false, "Cleaning","54c","",2)
        ix++
        outline[ix] = new item(false, "Dry Charge","54d","",2)
        ix++
        outline[ix] = new item(false, "Electrolyte Immobilization","54e","",2)
        ix++
        outline[ix] = new item(false, "Battery Fabrication From Cells","54f","",2)
        ix++
        outline[ix] = new item(false, "Marking/Finishing","54g","",2)
        ix++
        outline[ix] = new item(false, "5.5  Testing","55","",1)
        ix++
        outline[ix] = new item(false, "5.6  Packaging  Handling...","56","",1)
        ix++
        outline[ix] = new item(false, "5.7  Safety","57","",1)
        ix++
        outline[ix] = new item(true, "6.0  Nickel Cadmium Batteries","6","7",0)
        ix++
        outline[ix] = new item(false, "6.1  Introduction","61","",1)
        ix++
        outline[ix] = new item(false, "6.2  Applications","62","",1)
        ix++
        outline[ix] = new item(false, "6.3   Design","63","",1)
        ix++
        outline[ix] = new item(false, "6.4   Manufacturing and Quality Assurance","64","",1)
        ix++
        outline[ix] = new item(false, "6.5   Testing","65","",1)
        ix++
        outline[ix] = new item(false, "6.6   Packaging, Handling...","66","",1)
        ix++
        outline[ix] = new item(false, "6.7   Safety","67","",1)
        ix++
        outline[ix] = new item(true, "7.0  Dry Cells","7","8",0)
        ix++
        outline[ix] = new item(false, "7.1  Introduction","71","",1)
        ix++
        outline[ix] = new item(true, "7.2  Applications","72","9",1)
        ix++
        outline[ix] = new item(false, "Uses","721","",2)
        ix++
        outline[ix] = new item(true, "System Comparison","722","@",2)
        ix++
        outline[ix] = new item(false, "Performance Characteristics","7221","",3)
        ix++
        outline[ix] = new item(false, "Voltage Profiles","7222","",3)
        ix++
        outline[ix] = new item(false, "Power and Energy Density","7223","",3)
        ix++
        outline[ix] = new item(false, "Effect of Temperature","7224","",3)
        ix++
        outline[ix] = new item(false, "Shelf Life","7225","",3)
        ix++
        outline[ix] = new item(false, "Characteristics of Commercially Available Batteries","7226","",3)
        ix++
        outline[ix] = new item(false, "Shape and Configuration","7227","",3)
        ix++
        outline[ix] = new item(false, "Battery Protection","7228","",3)
        ix++
        outline[ix] = new item(true, "7.3  Design","73","A",1)
        ix++
        outline[ix] = new item(false, "Cell Design","731","",2)
        ix++
        outline[ix] = new item(false, "Basic Composition Of Common Dry Cells","732","",2)
        ix++
        outline[ix] = new item(false, "Cathode Material","733","",2)
        ix++
        outline[ix] = new item(false, "Venting","734","",2)
        ix++
        outline[ix] = new item(false, "7.4  Manufacturing and Quality Assurance","74","",1)
        ix++
        outline[ix] = new item(false, "7.5  Testing","75","",1)
        ix++
        outline[ix] = new item(false, "7.6  Packaging, Handling...","76","",1)
        ix++
        outline[ix] = new item(false, "7.7  Safety","77","",1)
        ix++
        outline[ix] = new item(true, "8.0  Thermal Batteries","8","B",0)
        ix++
        outline[ix] = new item(false, "8.1  Introduction","81","",1)
        ix++
        outline[ix] = new item(false, "8.2  Applications","82","",1)
        ix++
        outline[ix] = new item(true, "8.3  Design","83","C",1)
        ix++
        outline[ix] = new item(false, "8.3 Design - Part 1","831","",2)
        ix++
        outline[ix] = new item(false, "8.3 Design - Part 2","832","",2)
        ix++
        outline[ix] = new item(false, "8.4  Manufacturing and Quality Assurance","84","",1)
        ix++
        outline[ix] = new item(false, "8.5  Testing","85","",1)
        ix++
        outline[ix] = new item(false, "8.6  Packaging, Handling...","86","",1)
        ix++
        outline[ix] = new item(false, "8.7  Safety","87","",1)
        ix++
        outline[ix] = new item(true, "9.0  Lithium Primary Batteries","9","D",0)
        ix++
        outline[ix] = new item(true, "9.1  Introduction","91","E",1)
        ix++
        outline[ix] = new item(false, "General","911","",2)
        ix++
        outline[ix] = new item(false, "Types of Lithium Primary Cells","912","",2)
        ix++
        outline[ix] = new item(false, "Performance Characteristics (9.1)","913","",2)
        ix++
        outline[ix] = new item(false, "9.2  Applications","92","",1)
        ix++
        outline[ix] = new item(true, "9.3  Design","93","F",1)
        ix++
        outline[ix] = new item(false, "9.3 Lithium Primary Batteries Design Part 1","931","",2)
        ix++
        outline[ix] = new item(false, "9.3 Lithium Primary Batteries Design Part 2","932","",2)
        ix++
        outline[ix] = new item(false, "9.3 Lithium Primary Batteries Design Part 3","933","",2)
        ix++
        outline[ix] = new item(false, "9.4  Manufacturing and Quality Assurance","94","",1)
        ix++
        outline[ix] = new item(false, "9.5  Testing","95","",1)
        ix++
        outline[ix] = new item(false, "9.6  Packaging, Handling...","96","",1)
        ix++
        outline[ix] = new item(false, "9.7  Safety","97","",1)
        ix++
        outline[ix] = new item(false, "10.0  Summary","a","",0)
        ix++
        outline[ix] = new item(true, "Appendices","b","G",0)
        ix++
        outline[ix] = new item(false, "Appendix A.  Acronyms","b1","",1)
        ix++
        outline[ix] = new item(true, "Appendix B.  Definitions","b2","H",1)
        ix++
        outline[ix] = new item(false, "Appendix B. Definitions (A - B)","b21","",2)
        ix++
        outline[ix] = new item(false, "Appendix B. Definitions (C - D)","b22","",2)
        ix++
        outline[ix] = new item(false, "Appendix B. Definitions (E - L)","b23","",2)
        ix++
        outline[ix] = new item(false, "Appendix B. Definitions (M - R)","b24","",2)
        ix++
        outline[ix] = new item(false, "Appendix B. Definitions (S-W)","b25","",2)
        ix++
        outline[ix] = new item(true, "Appendix C. Specifications and Standards","b3","I",1)
        ix++
        outline[ix] = new item(false, "1. Military Standards and Specifications","b31","",2)
        ix++
        outline[ix] = new item(false, "2. Military Directives and Instructions","b32","",2)
        ix++
        outline[ix] = new item(false, "3. Federal Specifications","b33","",2)
        ix++
        outline[ix] = new item(false, "4. Industry Standards","b34","",2)
        ix++
        outline[ix] = new item(false, "References","c","",0)
        ix++

  setStates()
  setImages()
}

function resetStates() {
  setCookie("navso p-3676_outline", "-")
}

function setStates() {
  var storedValue = getCookie("navso p-3676_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("navso p-3676_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()

