function firstmenu(which)
{
  var URL = document.form.atob.options[document.form.atob.selectedIndex].value; 
  if(URL) {window.location.href = URL; } 
}

function secondmenu(which)
{
  var URL = document.form1.ctoi.options[document.form1.ctoi.selectedIndex].value; 
  if(URL) {window.location.href = URL; } 
}

function thirdmenu(which)
{
  var URL = document.form2.jtos.options[document.form2.jtos.selectedIndex].value; 
  if(URL) {window.location.href = URL; } 
}

function fourthmenu(which)
{
  var URL = document.form3.ttoz.options[document.form3.ttoz.selectedIndex].value; 
  if(URL) {window.location.href = URL; } 
}

//Contents for menu 1
var menu1=new Array();
menu1[0]='<form name="form"><select size="7" name="atob" onclick="firstmenu(document.form.atob)"><option value="actuaries/index.html">Actuaries at SSA<br>'
menu1[1]='<option value="COLA/index.html">Automatic Increases<br>'
menu1[2]='<option value="ProgData/benefits.html">Beneficiary Data<br>'
menu1[3]='<option value="ProgData/retirebenefit1.html">Benefit Calculation<br>'
menu1[4]='<option value="anypia/index.html">Benefit Estimate<br>'
menu1[5]='<option value="COLA/examplemax.html">Benefit Examples<br>'
menu1[6]='<option value="COLA/piaformula.html">Benefit Formula</select><br>'
      
//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<form name="form1"><select size="7" name="ctoi" onclick="secondmenu(document.form1.ctoi)"><option value="solvency/index.html">Changing Social Security<br>'
menu2[1]='<option value="COLA/colasummary.html">Cost-of-Living Adjustment<br>'
menu2[2]='<option value="COLA/countableincome.html">Countable Income for SSI<br>'
menu2[3]='<option value="FACTS/index.html">Fact Sheet<br>'
menu2[4]='<option value="TR/index.html">Financial Status<br>'
menu2[5]='<option value="ProgData/intRates.html">Interest Rates<br>'
menu2[6]='<option value="ProgData/investheld.html">Investments</select><br>'


//Contents for menu 3
var menu3=new Array()
menu3[0]='<form name="form2"><select size="9" name="jtos" onclick="thirdmenu(document.form2.jtos)"><option value="COLA/cbb.html">Maximum Taxable Earnings<br>'
menu3[1]='<option value="NOTES/actnote.html">Notes<br>'
menu3[2]='<option value="pubs.html">Publications<br>'
menu3[3]='<option value="solvency/index.html">Solvency Issues<br>'
menu3[4]='<option value="ssir/index.html">SSI Annual Report<br>'
menu3[5]='<option value="COLA/SSI.html">SSI Benefits<br>'
menu3[6]='<option value="STATS/index.html">Statistical Data<br>'
menu3[7]='<option value="NOTES/actstud.html">Studies<br>'
menu3[8]='<option value="COLA/sga.html">Substantial Gainful Activity</select><br>'

//Contents for menu 4
var menu4=new Array()
menu4[0]='<form name="form3"><select size="7" name="ttoz" onclick="fourthmenu(document.form3.ttoz)"><option value="ProgData/taxquery.html">Tax Data<br>'
menu4[1]='<option value="ProgData/taxRates.html">Tax Rates<br>'
menu4[2]='<option value="ProgData/funds.html">Trust Fund Data<br>'
menu4[3]='<option value="ProgData/fundFAQ.html">Trust Fund FAQs<br>'
menu4[4]='<option value="TR/index.html">Trustees Report<br>'
menu4[5]='<option value="COLA/cbb.html">Wage Base<br>'
menu4[6]='<option value="COLA/AWI.html">Wage Indexing</select><br>'


		
var menuwidth='165px' //default menu width
var menubgcolor='#D8D4D2'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="center")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
