// 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, "Title Page","index","",0)
        ix++
        outline[ix] = new item(false, "Disclaimers","2","",0)
        ix++
        outline[ix] = new item(false, "Acknowledgements","3","",0)
        ix++
        outline[ix] = new item(false, "Preface","4","",0)
        ix++
        outline[ix] = new item(true, "Leasons Learned","5","1",0)
        ix++
        outline[ix] = new item(false, "Philosophically Speaking","51","",1)
        ix++
        outline[ix] = new item(false, "The Machine","52","",1)
        ix++
        outline[ix] = new item(false, "Doing Your Homework","53","",1)
        ix++
        outline[ix] = new item(false, "Providing Information","54","",1)
        ix++
        outline[ix] = new item(false, "About Members","55","",1)
        ix++
        outline[ix] = new item(false, "About Staffs","56","",1)
        ix++
        outline[ix] = new item(false, "If That's Not Enough","57","",1)
        ix++
        outline[ix] = new item(false, "Glossary","6","",0)
        ix++
        outline[ix] = new item(true, "Congressional Organization","7","2",0)
        ix++
        outline[ix] = new item(true, "I - Anatomy of Congress","71","3",1)
        ix++
        outline[ix] = new item(true, "Chapter 1 The Perspective of Congress","711","4",2)
        ix++
        outline[ix] = new item(true, "Authority of the Congress","7111","5",3)
        ix++
        outline[ix] = new item(false, "Evolution and Expansion of Authority","71111","",4)
        ix++
        outline[ix] = new item(false, "How a Bill becomes Law","71112","",4)
        ix++
        outline[ix] = new item(true, "Chapter 2 Orgainzation of Congress","712","6",2)
        ix++
        outline[ix] = new item(false, "The Structure","7121","",3)
        ix++
        outline[ix] = new item(false, "\"Two Congresses\"","7122","",3)
        ix++
        outline[ix] = new item(false, "Characterizing Congress","7123","",3)
        ix++
        outline[ix] = new item(false, "Institutional Ways of Doing Business Fundamental Differences","7124","",3)
        ix++
        outline[ix] = new item(false, "Fundamental Differences","7125","",3)
        ix++
        outline[ix] = new item(false, "Congressional Support Agencies","7126","",3)
        ix++
        outline[ix] = new item(true, "Chapter 3 The Changing Nature of Congress","713","7",2)
        ix++
        outline[ix] = new item(false, "Other Significant Recent Changes","7131","",3)
        ix++
        outline[ix] = new item(true, "Chapter 4 Congressional Decision Making","714","8",2)
        ix++
        outline[ix] = new item(false, "Defense Committees","7141","",3)
        ix++
        outline[ix] = new item(false, "Organization and Nature of Appropriating Committees and Authorizing Committees","7142","",3)
        ix++
        outline[ix] = new item(false, "Subcommittees of the Appropriating Committees","7143","",3)
        ix++
        outline[ix] = new item(false, "Subcommittees of the Authorizing Committees","7144","",3)
        ix++
        outline[ix] = new item(false, "Pressures on Decision Makers","7145","",3)
        ix++
        outline[ix] = new item(false, "Detailed Oversight vis-a-vis Reasonable Direction","7146","",3)
        ix++
        outline[ix] = new item(false, "Map of Capitol Hill","7147","",3)
        ix++
        outline[ix] = new item(true, "Chapter 5 Congressional Committees","715","9",2)
        ix++
        outline[ix] = new item(false, "Committees at Work","7151","",3)
        ix++
        outline[ix] = new item(false, "Organization and Structure","7152","",3)
        ix++
        outline[ix] = new item(false, "Committee Chairmen","7153","",3)
        ix++
        outline[ix] = new item(false, "Committee Assignments","7154","",3)
        ix++
        outline[ix] = new item(true, "Chapter 6 Congressional Staffs","716","@",2)
        ix++
        outline[ix] = new item(false, "Roles of Staffs","7161","",3)
        ix++
        outline[ix] = new item(false, "Division of Work","7162","",3)
        ix++
        outline[ix] = new item(true, "Personal Staff and the Member Office","7163","A",3)
        ix++
        outline[ix] = new item(false, "Who They Are","71631","",4)
        ix++
        outline[ix] = new item(false, "How Staffs Operate","71632","",4)
        ix++
        outline[ix] = new item(false, "Member's Office","71633","",4)
        ix++
        outline[ix] = new item(true, "Committee Staffs","7164","B",3)
        ix++
        outline[ix] = new item(false, "Who Are They","71641","",4)
        ix++
        outline[ix] = new item(false, "Roles of Committee Staffs","71642","",4)
        ix++
        outline[ix] = new item(true, "Chapter 7 DoD Liaison with Congress","717","C",2)
        ix++
        outline[ix] = new item(false, "DoD Liaison Policy and Operations","7171","",3)
        ix++
        outline[ix] = new item(false, "AM Interactions with Congress","7172","",3)
        ix++
        outline[ix] = new item(false, "DoD Liaison Offices","7173","",3)
        ix++
        outline[ix] = new item(false, "Appropriations (Budgetary)","7174","",3)
        ix++
        outline[ix] = new item(false, "Authorization (Non-budgetary)","7175","",3)
        ix++
        outline[ix] = new item(false, "Comptroller Liaison","7176","",3)
        ix++
        outline[ix] = new item(false, "Legislative Affairs","7177","",3)
        ix++
        outline[ix] = new item(false, "Service/Defense Agency LLO Activities","7178","",3)
        ix++
        outline[ix] = new item(false, "Congressional Access to Classifeid and Sensitive Matter","7179","",3)
        ix++
        outline[ix] = new item(false, "Unauthorized Release of Information","717a","",3)
        ix++
        outline[ix] = new item(false, "Notification of Contract Award","717b","",3)
        ix++
        outline[ix] = new item(false, "Finding Out about the Status of Pending Legislation, Congressional Committee Hearings, and Floor Action","717c","",3)
        ix++
        outline[ix] = new item(true, "II - Congress and the Legislative Process","72","D",1)
        ix++
        outline[ix] = new item(true, "Chapter 8 Congressional Budget Process","721","E",2)
        ix++
        outline[ix] = new item(false, "Budget Process at Work","7211","",3)
        ix++
        outline[ix] = new item(false, "Congressional Budget Process Timetable","7212","",3)
        ix++
        outline[ix] = new item(false, "Budget Enforcement Act (BEA)","7213","",3)
        ix++
        outline[ix] = new item(false, "\"Two Step\" Budget Process","7214","",3)
        ix++
        outline[ix] = new item(true, "Concurrent Resolution on the Budget","7215","F",3)
        ix++
        outline[ix] = new item(false, "Budget Committees","72151","",4)
        ix++
        outline[ix] = new item(false, "Budget Resolution ","72152","",4)
        ix++
        outline[ix] = new item(false, "Reconciliation","72153","",4)
        ix++
        outline[ix] = new item(true, "Chapter 9 Congressional Hearings","722","G",2)
        ix++
        outline[ix] = new item(true, "Characteristics of Hearings","7221","H",3)
        ix++
        outline[ix] = new item(false, "Five Types of Hearings","72211","",4)
        ix++
        outline[ix] = new item(false, "Why Hearings are Held","72212","",4)
        ix++
        outline[ix] = new item(false, "Scenarios","72213","",4)
        ix++
        outline[ix] = new item(false, "Budget Resolution Process","72214","",4)
        ix++
        outline[ix] = new item(false, "Characteristics to Remember","72215","",4)
        ix++
        outline[ix] = new item(true, "DoD Witnesses","7222","I",3)
        ix++
        outline[ix] = new item(false, "Statements and Testimony","72221","",4)
        ix++
        outline[ix] = new item(false, "AM Assistance to Witnesses","72222","",4)
        ix++
        outline[ix] = new item(false, "AM as a Witness","72223","",4)
        ix++
        outline[ix] = new item(false, "Transcripts","7223","",3)
        ix++
        outline[ix] = new item(false, "Insertions of Material for the Record","7224","",3)
        ix++
        outline[ix] = new item(false, "Congressional Timetable","7225","",3)
        ix++
        outline[ix] = new item(true, "Chapter 10 Markup and Conference Committees","723","J",2)
        ix++
        outline[ix] = new item(false, "Markup","7231","",3)
        ix++
        outline[ix] = new item(false, "Conference Committees","7232","",3)
        ix++
        outline[ix] = new item(true, "Chapter 11 Authorization Process","724","K",2)
        ix++
        outline[ix] = new item(false, "Defense Programs","7241","",3)
        ix++
        outline[ix] = new item(false, "Committee Hearings","7242","",3)
        ix++
        outline[ix] = new item(false, "Floor Action by the House","7243","",3)
        ix++
        outline[ix] = new item(false, "Senate Action","7244","",3)
        ix++
        outline[ix] = new item(false, "Authroization Conference Committee","7245","",3)
        ix++
        outline[ix] = new item(true, "Chapter 12 Appropriations Process","725","L",2)
        ix++
        outline[ix] = new item(false, "Major Defense Appropriations Bill","7251","",3)
        ix++
        outline[ix] = new item(true, "DoD Appropriations Bill","7252","M",3)
        ix++
        outline[ix] = new item(false, "House Review","72521","",4)
        ix++
        outline[ix] = new item(false, "Senate Review","72522","",4)
        ix++
        outline[ix] = new item(false, "Approiations Conference Committee","7253","",3)
        ix++
        outline[ix] = new item(false, "Appeals","7254","",3)
        ix++
        outline[ix] = new item(false, "Continuing Resolution Authority (CRA)","7255","",3)
        ix++
        outline[ix] = new item(true, "III - Congress and the Oversight Function","73","N",1)
        ix++
        outline[ix] = new item(true, "Chapter 13 Congressional Oversight","731","O",2)
        ix++
        outline[ix] = new item(false, "Origin of Congressional Oversight","7311","",3)
        ix++
        outline[ix] = new item(false, "Need for Oversight","7312","",3)
        ix++
        outline[ix] = new item(false, "Impact of Oversight","7313","",3)
        ix++
        outline[ix] = new item(true, "Chapter 14 Congressional","732","P",2)
        ix++
        outline[ix] = new item(false, "Characteristics of Briefings","7321","",3)
        ix++
        outline[ix] = new item(false, "Functions of Briefings","7322","",3)
        ix++
        outline[ix] = new item(false, "Differences Between Briefing and Hearing","7323","",3)
        ix++
        outline[ix] = new item(true, "Chapter 15 Congressional Inquiries","733","Q",2)
        ix++
        outline[ix] = new item(false, "Informal Inquiries","7331","",3)
        ix++
        outline[ix] = new item(false, "Formal Inquiries","7332","",3)
        ix++
        outline[ix] = new item(true, "Chapter 16 Congressional Investigations","734","R",2)
        ix++
        outline[ix] = new item(false, "How an Investigation Generates","7341","",3)
        ix++
        outline[ix] = new item(false, "Investigative Hearings","7342","",3)
        ix++
        outline[ix] = new item(false, "GAO Surveys and Reviews","7343","",3)
        ix++
        outline[ix] = new item(false, "HAC Investigative Staff","7344","",3)
        ix++
        outline[ix] = new item(true, "Chapter 17 Congressional Tips","735","S",2)
        ix++
        outline[ix] = new item(false, "Where To, and When","7351","",3)
        ix++
        outline[ix] = new item(false, "What the AM should Do","7352","",3)
        ix++
        outline[ix] = new item(true, "Chapter 18 Congressional Data Reqirements and Reporting","736","T",2)
        ix++
        outline[ix] = new item(false, "Budget Justification Material and Other Reporting Information","7361","",3)
        ix++
        outline[ix] = new item(false, "Budget Justification Material","7362","",3)
        ix++
        outline[ix] = new item(false, "RDT&E Exhibits (R-Forms)","7363","",3)
        ix++
        outline[ix] = new item(false, "Procurement Exhibits (P-Forms)","7364","",3)
        ix++
        outline[ix] = new item(true, "Other Acquisition Information Reports","7365","U",3)
        ix++
        outline[ix] = new item(false, "SARs","73651","",4)
        ix++
        outline[ix] = new item(false, "Defense Acquisition Executive Summary (DAES)","73652","",4)
        ix++
        outline[ix] = new item(false, "Unit Cost Reporting","73653","",4)
        ix++
        outline[ix] = new item(false, "Studies and Analyses","73654","",4)
        ix++
        outline[ix] = new item(false, "A Closing Note to this Guide","7366","",3)
        ix++
        outline[ix] = new item(false, "Congressional Telephone Numbers","74","",1)
        ix++
        outline[ix] = new item(false, "Appendix A","75","",1)
        ix++
        outline[ix] = new item(false, "Appendix B","76","",1)
        ix++
        outline[ix] = new item(false, "Appendix C","77","",1)
        ix++
        outline[ix] = new item(false, "About  the Author","78","",1)
        ix++
        outline[ix] = new item(false, "Other Publications Available","79","",1)
        ix++

  setStates()
  setImages()
}

function resetStates() {
  setCookie("congress_outline", "-")
}

function setStates() {
  var storedValue = getCookie("congress_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("congress_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=',(5-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()


