//collapse expand boxes
          function doExpandCollapse(id,img){
          	var b = document.getElementById(id);
          	if (b.style.display=='none'){
          		b.style.display='';
          		document.images[img].src='/images/minus.png';
	  	}
          	else{
          		b.style.display='none';
          		document.images[img].src='/images/plus.png';
          	}
          	return false;
          }


//for show hide tabs on SteornLab pages
//DIVS WITH THE FIST THREE LETTERS BEING LAB WILL DISSAPEAR!
function fixLinks()
{
  if (!document.getElementsByTagName) return null;
  var server = document.location.hostname;
  var anchors = document.getElementsByTagName("a");
  for(var i=0; i < anchors.length; i++)
  {
    var a = anchors[i];
    var href = a.href;
    var id = a.id;
    var title = a.title;
    if ((href.indexOf("#") != -1) && (href.indexOf("header") == -1)) { // jump ref
      var index = href.indexOf("#") + 1;
      href = "javascript:show('" + href.substring(index) + "');";
      a.setAttribute("href",href);
    }
  }
}

function hideDivs(exempt)
{
  if (!document.getElementsByTagName) return null;
  if (!exempt) exempt = "";
  var divs = document.getElementsByTagName("div");
  for(var i=0; i < divs.length; i++)
  {
    var div = divs[i];
    var id = div.id;

      if ((id.substr(0,3) == "lab") && (id != exempt))
    {
      div.style.display = "none";
    }
  }
}

function show(what)
{
  if (!document.getElementById) return null;
  showWhat = document.getElementById(what);
  showWhat.style.display = "block";
  hideDivs(what);
}


function sendFocus(what)
{
  var obj = document.getElementById(what);
  obj.focus();
}

window.onload = function()
{
    if (document.getElementsByTagName('body')[0].id == "steornlab") {
       fixLinks();
       hideDivs("laboverview");
       sendFocus("navOverview"); //highlights the right tab but anchors the page wrong
       window.scrollTo(0,0); //fixes the incorrect anchoring 
	}
}