//Papago 494 Navigation bar written by J.S.Babis
//Detects browser - only for MSIE and Netscape

isNS=(navigator.appName.indexOf("Netscape")!=-1)
isIE=(navigator.appName.indexOf("Microsoft")!=-1)

// Highlighted Color   #000000  Black
// Unhighlighted Color #0000ff  Royal Blue
// Menu Background     #e1f5ff  10% Black

//show or hide codes
shown=new Array()
shown[0]=(isIE) ? "hidden" : "hide"
shown[1]=(isIE) ? "visible" : "show"

function CreateDiv(divID,divY,divX,divW,divH,bCol,visb,zInd)
{
  bkCol=(bCol!="") ? ((isNS) ? " bgColor="+bCol : ";background:"+bCol ) : ""
  if (isIE)
  {
    document.writeln("<DIV ID=" + divID + " style=\"position:absolute;top:" + divY + ";left:" + divX + ";width:" + divW + ";height:" + divH + bkCol + ";visibility:" + shown[visb] + ";z-index:" + zInd + "\" onMouseOut=\"clearDiv('" + divID + "');\">")
  }
  if (isNS)
  {
    document.writeln("<LAYER ID=" + divID + " top=" + divY + " left=" + divX + " width=" + divW + " height=" + divH + bkCol + " visibility=" + shown[visb] + " z-index=" + zInd + ">")
  }
}

function EndDiv()
{
  (isIE) ? document.writeln("</DIV>") : document.writeln("</LAYER>")
}

Bars=new Array('Activities','Administration','Service','Chapters','Committees','History','Communications')

function expand(divID)
{
  for(x=0; x < Bars.length; x++)
  {
    ShowHide = (divID == Bars[x]) ? shown[1] : shown[0]
    if(isIE) document.all[Bars[x]].style.visibility = ShowHide
    if(isNS) document.layers[Bars[x]].visibility = ShowHide
  }
}

function clearDiv(divID)
{
  if (divID.match('Bar'))
  {
    divID = divID.substring(0,divID.length - 3)
  }

  if (!divID.match('Contact'))
  {
    if (window.event.y > parseInt(document.all[divID].style.top) + parseInt(document.all[divID].style.height) ||
        window.event.x > parseInt(document.all[divID].style.left) + parseInt(document.all[divID].style.width) ||
        window.event.x <= parseInt(document.all[divID].style.left) + 3)
    {
      if(isIE) document.all[divID].style.visibility = 'hidden'
      if(isNS) document.layers[divID].visibility = 'hide'
    }
  }
}

function addMenu(menuText,leftPos,curWidth,subCnt)
{
  menuText2 = menuText
  while (menuText2.match('_'))
  {
    menuText2 = menuText2.replace('_',' ')
  }
  CreateDiv(menuText + 'Bar',100,leftPos,curWidth,30,'',1,0)
  document.write("<a href=\"" + menuText + ".htm\" style=\"text-decoration=none\" onmouseover=expand('" + menuText + "')><font face =\"New Times Roman\" size=2 color=#000000><b>" + menuText2 + "</b></font></a>")
  EndDiv()

  if (subCnt > 0)
  {
    subLen = 25
    for(x=0; x < subCnt; x++)
    {
      curLen = subItems[x].length * 6.75
      if (subLen < curLen)
      {
        subLen = curLen
      }
    }

    if (subLen > 200)
    {
      subLen = 200
    }
    CreateDiv(menuText,120,leftPos,subLen,16 * subCnt,'#e1f5ff',0,1)
    for(x=0; x < subCnt; x++)
    {
      document.write("&nbsp;&nbsp;<a href=\"" + subURLs[x] + "\" style=\"text-decoration=none\">")
      document.write("<font face =\"New Times Roman\" size=2 color=#0000ff onMouseOver=\"this.style.color='#000000'; return true;\" onMouseOut=\"this.style.color=''; clearDiv('" + menuText + "');\">" + subItems[x] + "</font></a><br>")
    }
    EndDiv()
  }
}

subItems = new Array('Elections',
                     'Spring Call Out',
                     'Spring Ordeal',
                     'NOAC',
                     'Banquet',
                     'Fall Ordeal',
	               'Section Conclave',
                     'Vigil Weekend',
                     'Winter Ordeal',
                     '')
subURLs =  new Array('elections.htm',
                     'springcallout.htm',
                     'springordeal.htm',
                     'noac.htm',
                     'banquet.htm',
                     'fallordeal.htm',
		         'conclave.htm',
                     'vigilweekend.htm',
                     'winterordeal.htm',
                     '')
addMenu('Activities',15,100,10)

subItems = new Array('Lodge Officers & Advisors',
                     'Lodge Executive Council',
                     'Lodge Rules',
                     'Safeguarded Material')
subURLs =  new Array('administration.htm',
                     'lec.htm',
                     'bylaws.htm',
                     'safeguardedmaterial.htm')
addMenu('Administration',95,75,4)

subItems = new Array('Council Service Projects',
                     'Troop Representative Program',
                     'Scoutreach Mentoring Program',
                     'Camping Promotions',
                     'Brotherhood Membership',
                     '')
subURLs =  new Array('service.htm',
                     'trooprepresentativeprogram.htm',
                     'scoutreach.htm',
                     'camppromotion.htm',
                     'brotherhood.htm',
                     '')
addMenu('Service',205,75,6)

subItems = new Array('Oraibi Chapter',
	  'Santa Cruz Chapter',
                     'Talala Chapter',
                     'Victorio Chapter')
subURLs =  new Array('oraibichapter.htm',
	  'santacruzchapter.htm',
                     'talalachapter.htm',
                     'victoriochapter.htm')
addMenu('Chapters',280,75,4)

subItems = new Array('Ceremonies',
	 'Trading Post',
                    'Unit Elections',
	 'Vigil/Founders')
subURLs =  new Array('ceremonies.htm', 
	'tradingpost.htm',
	'elections.htm',
	'VigilAndFounders.htm')
addMenu('Committees',365,150,4)

subItems = new Array('History of Papago Lodge',
                     'Papago Pete',
                     'Awards and Recognitions',
	  'Patch History')
subURLs =  new Array('history.htm',
                     'historyofpapagopete.htm',
                     'awards.htm',
	  'patchhistory.htm')
addMenu('History',465,90,4)

subItems = new Array('Hohogram Newsletter',
                     'Lodge Calendar',
                     'Links')
subURLs =  new Array('Communications.htm',
                     '2008-2009_Lodge_Calendars.pdf',
                     'links.htm')
addMenu('Communications',540,90,3)
