function getElementLeft( which )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( which );

  else if( document.all ) // this is the way old msie versions work
      elem = document.all[which];

  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[which];

  return elem;
}

/*function selectTabLeft( whichTab )
{
  var elem, vis;
  elem = getElementLeft( whichTab );
  vis = elem.style;
  
  vis.backgroundPosition = '0 -68px'; // rest of the world

  var myStash=getElementLeft('stash');
  myStash.innerHTML = whichTab;

  var elembreadcrumbplaceholder, visbreadcrumbplaceholder;
  elembreadcrumbplaceholder = getElement('TabBreadcrumbPlaceholder');  
  visbreadcrumbplaceholder= elembreadcrumbplaceholder.style;
  
  visbreadcrumbplaceholder.display = 'block';
  elembreadcrumbplaceholder.innerHTML = elem.innerHTML;
}

//
// called to de-select a tab when navigating 
// also hides the breadcrumb tab placeholder
//
function deSelectTabLeft( whichTab )
{
  var elem, vis;
  elem = getElementLeft( whichTab );
  //elem.removeAttribute("style"); // everyone else in the world

  vis = elem.style; 
  vis.backgroundPosition = '0 0px'; 


  var elembreadcrumbplaceholder, visbreadcrumbplaceholder;
  elembreadcrumbplaceholder = getElement('TabBreadcrumbPlaceholder');  
  visbreadcrumbplaceholder= elembreadcrumbplaceholder.style;
  
  visbreadcrumbplaceholder.display = 'none';
}


function moveitrealgoodLeft(item, direction)
{
   var mystash = getElementLeft('stash');

   if (item.id != mystash.innerHTML)
   {

     if (direction == 'up')
    {    item.style.backgroundPosition = '0 -68px'; }
    else 
    {    item.style.backgroundPosition = '0 0px'; }

   }
}

function highlightMenuLeft(item, direction)
{
   var mystash = getElementLeft('lastnavselection');

   if (item.id != mystash.innerHTML)
   {

     if (direction == 'up')
     {    item.style.backgroundPosition = '0 -33px'; }
     else 
     {    item.style.backgroundPosition = '0 0px'; }

   }
}

function toggleMenuLeft( whichLayer )
{

  var mystash = getElementLeft('lastnavselection');
  
  var elem, vis;
  elem=getElementLeft(whichLayer);
  vis = elem.style;

  if (vis.display == 'none')
  {
      vis.display = 'block';
      elem.previousSibling.firstChild.style.backgroundPosition = '0 -66px';
      mystash.innerHTML = elem.previousSibling.firstChild.id;
  }
  else 
  {
      vis.display = 'none';
      elem.previousSibling.firstChild.removeAttribute("style");
  }
}*/

function toggleMenuLeft(item, whichLayer)
{
    var mystash = getElementLeft('lastnavselection');
  
    var elem, vis;
    elem=getElementLeft(whichLayer);
    vis = elem.style;

    if (vis.display == 'none')
    {
        vis.display = 'block';
        elem.previousSibling.firstChild.style.backgroundPosition = '0 -66px';
        mystash.innerHTML = elem.previousSibling.firstChild.id;
        //item.style.backgroundPosition = '0 -33px';
    }
    else 
    {
        vis.display = 'none';
        elem.previousSibling.firstChild.removeAttribute("style");
        elem.previousSibling.firstChild.style.backgroundPosition = '0 0px';
        //item.style.backgroundPosition = '0 0px';
    }
}


function highlightMenuLeft(item, direction, whichLayer)
{
   //var mystash; //= getElementLeft('lastnavselection');
   //mystash.innerHTML = -1;

   var elem, vis;
   elem=getElementLeft(whichLayer);
   vis = elem.style;

   if (item.id != -1)
   {

     if (direction == 'up')
     {    
       //if (vis.display == 'none')
       //{
         item.style.backgroundPosition = '0 -33px'; 
       //}
     }
     else 
     { 
       if (vis.display == 'block')
       {   
         item.style.backgroundPosition = '0 -66px';
       }
       if (vis.display == 'none')
       {
         item.style.backgroundPosition = '0 0px'; 
       }
     }
   }
   /*if (vis.display == 'none')
   {
       item.style.backgroundPosition = '0 -33px';
   }
   else
   {
       item.style.backgroundPosition = '0 0px';
   }*/
}
