

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.texaschildrens.org/allabout/maps/default.aspx">Map & Directions</a>'
menu1[1]='<a href="http://www.texaschildrens.org/allabout/visitingthehospital/default.aspx">Visit the Hospital</a>'
menu1[2]='<a href="http://www.texaschildrens.org/allabout/international/default.aspx">International Services</a>'
menu1[3]='<a href="http://www.texaschildrens.org/allabout/careers/default.aspx">Careers</a>'
menu1[4]='<a href="http://www.texaschildrens.org/allabout/news/default.aspx">Newsroom</a>'
menu1[5]='<a href="http://www.texaschildrens.org/advocacy/default.aspx">Legislative Advocacy</a>'
menu1[6]='<a href="http://www.texaschildrens.org/allabout/sitemap.aspx">Site Map</a>'
menu1[7]='<a href="http://www.texaschildrens.org/allabout/visitingthehospital/contactus.aspx">Contact Us</a>'

//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="http://www.texaschildrens.org/carecenters/directory.aspx">Directory</a>'
menu2[1]='<a href="http://www.texaschildrens.org/carecenters/cancer/default.aspx">Cancer Center</a>'
menu2[2]='<a href="http://www.texaschildrens.org/carecenters/fetalsurgery/default.aspx">Fetal Center</a>'
menu2[3]='<a href="http://www.texaschildrens.org/carecenters/heart/default.aspx">Heart Center</a>'
menu2[4]='<a href="http://www.texaschildrens.org/carecenters/neuro/neurology/Default.aspx">Neurology</a>'
menu2[5]='<a href="http://www.texaschildrens.org/carecenters/newborn/default.aspx">Newborn Center</a>'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="http://www.texaschildrens.org/parents/tips.aspx">Your Childs Health</a>'
menu3[1]='<a href="http://www.texaschildrens.org/parents/advice/palintro.aspx">Parent Advice Line</a>'
menu3[2]='<a href="http://www.texaschildrens.org/parents/parentsconnection/December07.aspx">Parents E-newsletter</a>'
menu3[3]='<a href="http://www.texaschildrens.org/parents/patientgreeting/default.aspx">Patient Greetings</a>'

//Contents for menu 4
var menu4=new Array()
menu4[0]='<a href="http://www.texaschildrens.org/professionals/refphysicians/default.aspx">Referring Physicians</a>'
menu4[1]='<a href="http://www.texaschildrens.org/professionals/nursing/default.aspx">Nursing</a>'
menu4[2]='<a href="http://www.texaschildrens.org/professionals/physicianliaisons/default.aspx">Physician Liaison Program</a>'
menu4[3]='<a href="http://www.texaschildrens.org/professionals/professionaleducation/default.aspx">Professional Education</a>'
menu4[4]='<a href="http://www.texaschildrens.org/professionals/fellowshipsinternships/default.aspx">Fellowship & Residency</a>'
menu4[5]='<a href="http://www.texaschildrens.org/professionals/telehealth/default.aspx">TeleHealth</a>'
menu4[6]='<a href="http://www.texaschildrens.org/carecenters/kangaroocrew/default.aspx">Kangaroo Crew</a>'
menu4[7]='<a href="http://www.texaschildrens.org/allabout/careers/default.aspx">Careers</a>'

//Contents for menu 5
var menu5=new Array()
menu5[0]='<a href="http://www.texaschildrens.org/waystogive/financialsupport/default.aspx">Donate</a>'
menu5[1]='<a href="http://www.texaschildrens.org/waystogive/getinvolved.aspx ">Get Involved</a>'
menu5[2]='<a href="http://www.texaschildrens.org/waystogive/stayinformed/default.aspx">Stay Informed</a>'
menu5[3]='<a href="http://www.texaschildrens.org/waystogive/contact.aspx">Contact Us</a>'
menu5[4]='<a href="http://www.texaschildrens.org/miraclenetwork/default.aspx ">Children\'s Miracle Network </a>'

//Contents for menu 6
var menu6=new Array()
menu6[0]='<a href="http://www.texaschildrens.org/parents/parentsconnection/December07.aspx">Parents E-newsletter</a>'
menu6[1]='<a href="http://www.texaschildrens.org/miraclenetwork/default.aspx">Children\'s Miracle Network</a>'
menu6[2]='<a href="http://www.texaschildrens.org/allabout/visitingthehospital/carepage.aspx">Patient Web Sites</a>'
menu6[3]='<a href="http://www.texaschildrens.org/allabout/international/default.aspx">International Services</a>'
menu6[4]='<a href="http://www.texaschildrens.org/parents/patientgreeting/default.aspx">Send a Patient Greeting</a>'
menu6[5]='<a href="http://www.texaschildrens.org/waystogive/financialsupport/default.aspx">Make a Donation</a>'
menu6[6]='<a href="http://www.texaschildrenspediatrics.org" target="_default">Texas Children\'s Pediatric Associates</a>'
menu6[7]='<a href="http://www.texaschildrens.org/healthcenters/default.aspx">Texas Children\'s Health Centers</a>'
menu6[8]='<a href="http://www.texaschildrenshealthplan.org" target="_default">Texas Children\'s Health Plan</a>'
menu6[9]='<a href="http://www.tchvision2010.org" target="_default">Vision 2010</a>'
menu6[10]='<a href="http://www.texaschildrens.org/carecenters/kidscourageous/default.aspx">Kids Courageous</a>'
menu6[11]='<a href="http://www.texaschildrens.org/toystore/default.aspx">Toy Store</a>'

var menuwidth='120px' //default menu width
var menubgcolor='#D2D6D4' //menu bgcolor
var disappeardelay=50 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

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=="left")? 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="-500px"

  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 topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
    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)
    { //move up?
      edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight

      if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
        edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
    }
  }

  return edgeoffset
}

function populatemenu(what)
{
  if (ie4||ns6)
    dropmenuobj.innerHTML=what.join("")
}

function Newdropdownmenu(asItemId, asMaxNbr)
{
  var asObject;
  var asObject2;
  var imgBefore = 0;
  var imgAfter = 0;
  var maxTabs = asMaxNbr;

  clearMenuOptions();

  asObject = document.getElementById('imgMain0000' + asItemId);
  asObject.src = asObject.lowsrc;
  
  if (asItemId != maxTabs)
  {
    asObject2 = document.getElementById('imgSub0000' + asItemId);
    asObject2.src = asObject2.lowsrc;
  }
  

  imgAfter = asItemId - 1;

  if ( asItemId != 1)
  {
    document.getElementById('imgSub0000' + imgAfter).src = document.getElementById('imgSub0000' + imgAfter).imgAfter;
  
    if (document.getElementById('imgSub0000' + imgAfter).imgMid)
      document.getElementById('imgSub0000' + imgAfter).src = document.getElementById('imgSub0000' + imgAfter).imgMid;
  }
  
}

function clearMenuOptions(asMaxNbr)
{
  var maxTabs = asMaxNbr;

  for (var i=1; i <= maxTabs; i++)
  {
    asObject = document.getElementById('imgMain0000' + i);
    asObject2 = document.getElementById('imgSub0000' + i);

    asObject.src = asObject.imgRolln;
    if (i != maxTabs)
    {
      asObject2.src = asObject2.imgRolln;
    }
  }
}

/*
Parameters:
asPriItemId - mouseover image
priImg1 - change To Image

asAltItemId - neighbor image
altImg1 - change To Image
*/
function dropDownImageChanger(asPriItemId, priImg1, asAltItemId, altImg1)
{
  var asPriObject;
  var asAltObject;
 
  if (document.getElementById('imgMain0000' + asPriItemId))
  {
    asPriObject = document.getElementById('imgMain0000' + asPriItemId);
    asPriObject.src = priImg1;
  }
  
  if (document.getElementById('imgMain0000' + asAltItemId))
  {
    asAltObject = document.getElementById('imgMain0000' + asAltItemId);
    asAltObject.src = altImg1;

  }
}

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
