   //////////////////////////////////////////////////////////////////////////////////////////
   /////////////////////////////////  Sliding Drop Down   ///////////////////////////////////
   //////////////////////////////////////////////////////////////////////////////////////////


   var currMenu;
   var currSubMenu;
   var currButton;
   var IE = document.all?true:false;
   var increment=2;
   var rate=5; //In milliseconds
   document.onmousemove = getMouseXY;
   var tempX = 0;
   var tempY = 0;


   function getMouseXY(e) 
   {
    var _x=0;
    var _y=0;
    
    if(window.document.body)
    {
     if(window.document.body.scrollLeft > 0) _x=window.document.body.scrollLeft;
     else
     {
      if(window.document.documentElement.scrollLeft)
      {
       if(window.document.documentElement.scrollLeft > 0) _x=window.document.documentElement.scrollLeft;
      }
     }
    }
   
    if(window.document.body)
    {
     if(window.document.body.scrollTop > 0) _y=window.document.body.scrollTop;
     else
     {
      if(window.document.documentElement.scrollTop)
      {
       if(window.document.documentElement.scrollTop > 0) _y=window.document.documentElement.scrollTop;
      }
     }
    }
   
    if (IE) 
    { // grab the x-y pos.s if browser is IE
     ///alert(event.clientX);
     tempX = event.clientX + _x;
     tempY = event.clientY + _y;
    }
    else 
    {  // grab the x-y pos.s if browser is NS
     tempX = e.pageX + _x;
     tempY = e.pageY + _y;
    }  
    if (tempX < 0){tempX = 0;}
    if (tempY < 0){tempY = 0;}  

    if(!inChild(document.getElementById('bar')) && !inDropDown())
    {
     if(currSubMenu)
     {
      if(currSubMenu.style.backgroundImage)
      {
       hideSubMenu(currSubMenu);
       dimMenuItem(currSubMenu);
      }
      currSubMenu=undefined;
     }
     if(currButton) slideUp_DD(currButton);
    }

    return true;
   }




   function adjustCoverPos()
   {
    var coverDiv=document.getElementById('cover');
    var headerPos=findPos(document.getElementById('header'));

    coverDiv.style.left=headerPos[0]+'px';
    coverDiv.style.top=headerPos[1]+5+'px';

    var menuButtons=document.getElementById("bar");
    var children = menuButtons.childNodes;
    for(iCntr=0; iCntr < children.length; iCntr++)
    {
     var child=children[iCntr];
     if(child.className == "menuButton")
     {
      var theMenuId=child.getAttribute("dd_menu");
      
      if(theMenuId)
      {
       var theMenu=document.getElementById(theMenuId);
       var currPos=findPos(child);
       var newPos=[currPos[0],currPos[1]+ child.offsetHeight];

       theMenu.style.left=newPos[0]+'px';
      }
     }
    }
   }



   function showCover()
   {
    var coverDiv=document.createElement("div");
    var headerPos=findPos(document.getElementById('header'));

    coverDiv.id="cover";
    coverDiv.style.zIndex=10;
    coverDiv.style.position="absolute";
    coverDiv.style.left=headerPos[0]+'px';
    coverDiv.style.top=headerPos[1]+5+'px';
    coverDiv.style.backgroundColor='#FFFFCB';
    coverDiv.style.height='20px';        
    coverDiv.style.width='952px';
    coverDiv.style.paddingTop='95px';
    coverDiv.style.backgroundImage='url(images/logo.gif)';
    coverDiv.style.backgroundRepeat='no-repeat';
    coverDiv.style.backgroundPosition='center center';

    var strHTML="<div id='bar' style='width:100%; height:25px; background-image:url(images/nav_bar.png); background-repeat: repeat-x;'>";
    strHTML+="<div id='home' class='menuButton' style='margin-left:60px; margin-top:3px; color:#fffed6; float:left; font-family:Microsoft Sans Serif; font-size:10pt; font-weight:700;'><span style='cursor:pointer'  onmouseover='showRed(this);' onmouseout='showYellow(this);' onclick='window.location=\"index.html\";'>Home</span></div>";
    strHTML+="<div id='staff' class='menuButton' style='margin-left:60px; margin-top:3px; color:#fffed6; float:left; font-family:Microsoft Sans Serif; font-size:10pt; font-weight:700;'><span style='cursor:pointer'  onmouseover='showRed(this);' onmouseout='showYellow(this);' onclick='window.location=\"about.html\";'>Staff</span></div>";
    strHTML+="<div id='services' class='menuButton' style='margin-left:60px; margin-top:3px; color:#fffed6; float:left; font-family:Microsoft Sans Serif; font-size:10pt; font-weight:700;'><span style='cursor:pointer'  onmouseover='showRed(this);' onmouseout='showYellow(this);' onclick='window.location=\"services.html\";'>Services</span></div>";
    strHTML+="<div id='clinic_news' class='menuButton' style='margin-left:60px; margin-top:3px; color:#fffed6; float:left; font-family:Microsoft Sans Serif; font-size:10pt; font-weight:700;'><span style='cursor:pointer'  onmouseover='showRed(this);' onmouseout='showYellow(this);' onclick='window.location=\"news.html\";'>Clinic News</span></div>";
    strHTML+="<div id='hours' class='menuButton' style='margin-left:60px; margin-top:3px; color:#fffed6; float:left; font-family:Microsoft Sans Serif; font-size:10pt; font-weight:700;'><span style='cursor:pointer'  onmouseover='showRed(this);' onmouseout='showYellow(this);' onclick='window.location=\"hours.html\";'>Hours & Map</span></div>";
    strHTML+="<div id='links' class='menuButton' style='margin-left:60px; margin-top:3px; color:#fffed6; float:left; font-family:Microsoft Sans Serif; font-size:10pt; font-weight:700;'><span style='cursor:pointer'  onmouseover='showRed(this);' onmouseout='showYellow(this);' onclick='window.location=\"pet_links.html\";'>Helpful Links</span></div>";
    strHTML+="<div id='tour' class='menuButton' style='margin-left:60px; margin-top:3px; color:#fffed6; float:left; font-family:Microsoft Sans Serif; font-size:10pt; font-weight:700;'><span style='cursor:pointer'  onmouseover='showRed(this);' onmouseout='showYellow(this);' onclick='window.location=\"tour.html\";'>Photo Gallery</span></div>";
    strHTML+="</div>";

    coverDiv.innerHTML=strHTML;
    document.body.appendChild(coverDiv);
    setUpSlideMenus();

   }



   function setUpSlideMenus()
   {
    var menuButtons=document.getElementById("bar");
    var children = menuButtons.childNodes;
    for(iCntr=0; iCntr < children.length; iCntr++)
    {
     var child=children[iCntr];
     if(child.className == "menuButton")
     {
      switch(child.id)
      {
       case 'clinic_news':
        var currPos=findPos(child);
        var newPos=[currPos[0],currPos[1]+ child.offsetHeight];

        var menu=document.createElement("DIV");
        menu.id="menu_clinic_news";
        menu.style.zIndex=1;
        menu.style.position="absolute";
        menu.style.left=newPos[0]+'px';
        menu.style.top=(newPos[1]+3)+'px';
        menu.style.backgroundColor="#ffffcb";
        menu.style.borderBottom="2px solid #9c600e";
        menu.style.borderLeft="2px solid #9c600e";
        menu.style.borderRight="2px solid #9c600e";
        menu.style.fontFamily="Microsoft Sans Serif";
        menu.style.fontSize="9pt";
        menu.style.textAlign="left"
        menu.setAttributeNode(document.createAttribute("currPos"));

        var theHTML="<div id='menu' name='menu' style='z-index:1; padding: 3px 3px 3px 3px;'>";
        /////theHTML+="<div id='news' style='height:15px; width:100px;z-index:1; color:#9c600e; cursor:pointer' onmouseover='hiliteMenuItem(this);' onmouseout='dimMenuItem(this);' onclick='window.location=\"news.html?pos=news\";'>Quarterly News</div>";////
        theHTML+="<div id='referral' style='height:15px; width:100px;z-index:1; color:#9c600e; cursor:pointer' onmouseover='hiliteMenuItem(this);' onmouseout='dimMenuItem(this);' onclick='window.location=\"news.html?pos=events\";'>Events</div>";
        theHTML+="</div>";
        menu.innerHTML=theHTML;
        document.body.appendChild(menu);
        menu.style.top=parseInt(menu.style.top)-menu.offsetHeight+'px';
        menu.setAttribute('currPos', 0);
        child.setAttributeNode(document.createAttribute("dd_menu"));
        child.setAttribute('dd_menu', menu.id);
        break;
      
       case 'services':
        var currPos=findPos(child);
        var newPos=[currPos[0],currPos[1]+ child.offsetHeight];

        var menu=document.createElement("DIV");
        menu.id="menu_services";
        menu.style.zIndex=1;
        menu.style.position="absolute";
        menu.style.left=newPos[0]+'px';
        menu.style.top=(newPos[1]+5)+'px';
        menu.style.backgroundColor="#ffffcb";
        menu.style.borderBottom="2px solid #9c600e";
        menu.style.borderLeft="2px solid #9c600e";
        menu.style.borderRight="2px solid #9c600e";
        menu.style.fontFamily="Microsoft Sans Serif";
        menu.style.fontSize="9pt";
        menu.style.textAlign="left"
        menu.setAttributeNode(document.createAttribute("currPos"));

        var theHTML="<div id='menu' name='menu' style='z-index:1; padding: 3px 3px 3px 3px;'>";
        theHTML+="<div id='forms' style='height:15px; width:100px;z-index:1; color:#9c600e; cursor:pointer' onmouseover='hiliteMenuItem(this);' onmouseout='dimMenuItem(this);' onclick='window.location=\"new_client_form.html\";'>New Client Form</div>";
        theHTML+="<div id='forms' style='height:15px; width:100px;z-index:1; color:#9c600e; cursor:pointer' onmouseover='hiliteMenuItem(this);' onmouseout='dimMenuItem(this);' onclick='window.location=\"evaluation_form.html\";'>Evaluation Form</div>";
        theHTML+="<div id='referral' style='height:15px; width:100px;z-index:1; color:#9c600e; cursor:pointer' onmouseover='hiliteMenuItem(this);' onmouseout='dimMenuItem(this);' onclick='window.location=\"referral.html\";'>Referral&nbsp;Program</div>";
        theHTML+="</div>";
        menu.innerHTML=theHTML;
        document.body.appendChild(menu);
        menu.style.top=parseInt(menu.style.top)-menu.offsetHeight+'px';
        menu.setAttribute('currPos', 0);
        child.setAttributeNode(document.createAttribute("dd_menu"));
        child.setAttribute('dd_menu', menu.id);
        break;

      }
     }
    }
   } 



   function showSubMenu(obj)
   {
    //tick_ffffcb.png
    //tick_9c600e.png
    var subMenu=document.createElement("DIV");
    var menuPos=findPos(obj);

    subMenu.style.zIndex=2;
    subMenu.style.position="absolute";
    subMenu.style.left=(menuPos[0]+obj.offsetWidth)+'px';
    subMenu.style.top=menuPos[1]+'px';
    subMenu.style.backgroundColor="#ffffcb";
    subMenu.style.borderTop="2px solid #9c600e";
    subMenu.style.borderBottom="2px solid #9c600e";
    subMenu.style.borderLeft="2px solid #9c600e";
    subMenu.style.borderRight="2px solid #9c600e";
    subMenu.style.fontFamily="Microsoft Sans Serif";
    subMenu.style.textAlign="left"
    subMenu.style.fontSize="9pt";
        
    switch(obj.id)
    {
     case 'news':
       subMenu.id="submenu_news";
       var theHTML="<div id='submenu' name='submenu' style='z-index:2; padding: 3px 3px 3px 3px;'>";
       theHTML+="<div id='updates' style='width:100px;z-index:2; color:#9c600e; cursor:pointer' onmouseover='hiliteSubMenuItem(this);' onmouseout='dimSubMenuItem(this);' onclick='window.location=\"news.html?pos=updates\";'>Clinic Updates</div>";
       theHTML+="<div id='news' style='width:100px;z-index:2; color:#9c600e; cursor:pointer' onmouseover='hiliteSubMenuItem(this);' onmouseout='dimSubMenuItem(this);' onclick='window.location=\"news.html?pos=news\";'>Quarterly News</div>";
       theHTML+="<div id='events' style='width:100px;z-index:2; color:#9c600e; cursor:pointer' onmouseover='hiliteSubMenuItem(this);' onmouseout='dimSubMenuItem(this);' onclick='window.location=\"news.html?pos=events\";'>Events</div>";
       theHTML+="<div id='specials' style='width:100px;z-index:2; color:#9c600e; cursor:pointer' onmouseover='hiliteSubMenuItem(this);' onmouseout='dimSubMenuItem(this);' onclick='window.location=\"news.html?pos=specials\";'>Specials</div>";
       theHTML+="</div>";
       subMenu.innerHTML=theHTML;
      break;

    }
    obj.setAttributeNode(document.createAttribute("dd_submenu"));
    obj.setAttribute('dd_submenu', subMenu.id);
 
    document.body.appendChild(subMenu);
   }


   function hideSubMenu(obj)
   {
    var subMenu;
    var submenu_id=obj.getAttribute("dd_submenu");
    if(submenu_id)
    {
     document.body.removeChild(document.getElementById(submenu_id));
     obj.removeAttributeNode(obj.getAttributeNode("dd_submenu"));
    }
   }

   function findPos(obj)
   {
    var curleft = curtop = 0;
    if(obj)
    {
     if (obj.offsetParent)
     {
      curleft = obj.offsetLeft;
      curtop = obj.offsetTop;
      while (obj = obj.offsetParent)
      {
       curleft += obj.offsetLeft;
       curtop += obj.offsetTop;
      }
     }
    }
    return [curleft,curtop];
   }


   function findPosSpecific(obj,ancestorid)
   {
    var curleft = curtop = 0;
    var ancestor=document.getElementById(ancestorid);
    if(obj && ancestor)
    {
     if (obj.offsetParent)
     {
      curleft = obj.offsetLeft;
      curtop = obj.offsetTop;
      while (obj & obj.id != ancestorid)
      {
       curleft += obj.offsetLeft;
       curtop += obj.offsetTop;
       obj = obj.offsetParent
      }
     }
    }
    return [curleft,curtop];
   }


   function slideDown_DD(obj)
   {
     var menu_id=obj.getAttribute("dd_menu");
     currButton=obj;
     currMenu=document.getElementById(menu_id);
     slidedown(menu_id);
   }

   function slidedown(id)
   {
    var obj=document.getElementById(id); 
    if(obj)   
    { 
     var currPos=parseInt(obj.getAttribute("currPos"));
     if(currPos < obj.offsetHeight)
     { 
      obj.style.top=parseInt(obj.style.top) + increment + 'px';
      currPos+=increment;
      obj.setAttribute('currPos', currPos);
      setTimeout("slidedown(\"" + id + "\")", rate);
     }
    }
   }


   function slideUp_DD(obj)
   {
     var menu_id=obj.getAttribute("dd_menu");
     slideup(menu_id);
   }


   function slideup(id)
   {
    var obj=document.getElementById(id); 
    if(obj)
    {
     var currPos=parseInt(obj.getAttribute("currPos"));
     if(currPos > 0)
     { 
      obj.style.top=parseInt(obj.style.top) - increment + 'px';
      currPos-=increment;
      obj.setAttribute('currPos', currPos);
      setTimeout("slideup(\"" + id + "\")", rate);
     }
     else 
     {
      currButton=null;
     }
    }
   }


   function inChild(obj)
   {

    if(obj)
    {
    var children = obj.childNodes;
    var iCntr;
    for(iCntr=0; iCntr < children.length; iCntr++)
    {
     var child=children[iCntr];
     if(child.className == "menuButton")
     {
      var currPos=findPos(child);
   
      if(tempX >= currPos[0] && tempX <= currPos[0]+ child.offsetWidth 
      && tempY >= currPos[1] && tempY <= currPos[1]+ child.offsetHeight+5)
      {
       return true;
      }
     }
    }
    }
    return false;
   } 

   function inDropDown()
   {
    if(currMenu != undefined)
    {
     var currPos=findPos(currMenu);
     if(tempX >= currPos[0] && tempX <= currPos[0]+ currMenu.offsetWidth 
     && tempY >= currPos[1] && tempY <= currPos[1]+ currMenu.offsetHeight)
     {
      return true;
     }
     else
     {
      var children = currMenu.childNodes;
      var iCntr;
      for(iCntr=0; iCntr < children.length; iCntr++)
      {
       var child=children[iCntr];
       if(child.id)
       {
        if(child.id='menu')
        {
         var selections=child.childNodes;
         var jCntr;
         for(jCntr=0; jCntr < selections.length; jCntr++)
         {
          var selection=selections[jCntr];
          var subMenuId=selection.getAttribute("dd_submenu");
          if(subMenuId)
          {
           var subMenu=document.getElementById(subMenuId);
           currPos=findPos(subMenu);
           if(tempX >= currPos[0] && tempX <= currPos[0]+ subMenu.offsetWidth 
           && tempY >= currPos[1] && tempY <= currPos[1]+ subMenu.offsetHeight)
           {
            return true;
           }
          }
         }
        }
       }
      }
     }
    }
    return false;
   }

   function hiliteMenuItem(obj)
   {
    //tick_ffffcb.png
    //tick_9c600e.png
    if(currSubMenu)
    {
     if(currSubMenu.style.backgroundImage)
     {
      currSubMenu.style.backgroundColor='#ffffcb';
      currSubMenu.style.color='#9c600e';
      currSubMenu.style.backgroundImage='url(images/tick_9c600e.png)';
      hideSubMenu(currSubMenu);
     }
     currSubMenu=undefined;
    }
    obj.style.backgroundColor='#9c600e';
    obj.style.color='#ffffcb';
    if(obj.style.backgroundImage)
    {
     obj.style.backgroundImage='url(images/tick_ffffcb.png)';
     showSubMenu(obj);
     currSubMenu=obj;
    }
   }


   function hiliteSubMenuItem(obj)
   {
    obj.style.backgroundColor='#9c600e';
    obj.style.color='#ffffcb';
   }

   function dimMenuItem(obj)
   {
    obj.style.backgroundColor='#ffffcb';
    obj.style.color='#9c600e';
    if(obj.style.backgroundImage)
    {
     obj.style.backgroundImage='url(images/tick_9c600e.png)';
    }
   }

   function dimSubMenuItem(obj)
   {
    obj.style.backgroundColor='#ffffcb';
    obj.style.color='#9c600e';
   }

   //////////////////////////////////////////////////////////////////////////////////////////
   //////////////////////////////////////////////////////////////////////////////////////////
   //////////////////////////////////////////////////////////////////////////////////////////
