function fixLinks()
{
  if (!document.getElementsByTagName) return null;
  var server = document.location.hostname;
  var whatanchors = document.getElementById("left_menu"); /*Limits the fixLinks function to only the menu links */
  var anchors = whatanchors.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);
	a.onclick = function () {var hide_default = document.getElementById ("default");
					hide_default.style.display = "none";}
    }
	/*Exempt the default link from hiding itself */
		if ((href.indexOf("#") != -1) && (href.indexOf("default") == 1)) {
			var index1 = href.indexOf("#") + 1;
			href2 = "javascript:show('" + href.substring(index1) + "');";
			a.setAttribute ("href", href);
			a.onclick = function () {var show_default = document.getElementById ("default");
					show_default.style.display = "block";}
	
		}	
	/* ======================*/


  }
}


/*-----------------------------------------------------------------*/
function fixLinks2()
{
  if (!document.getElementsByTagName) return null;
  var server = document.location.hostname;
  var whatanchors = document.getElementById("right_content"); /*Limits the fixLinks function to only the menu links */
  var anchors = whatanchors.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);
	a.onclick = function () {var hide_default = document.getElementById ("default");
					hide_default.style.display = "none";}
    }
	/*Exempt the default link from hiding itself */
		if ((href.indexOf("#") != -1) && (href.indexOf("default") == 1)) {
			var index1 = href.indexOf("#") + 1;
			href2 = "javascript:show('" + href.substring(index1) + "');";
			a.setAttribute ("href", href);
			a.onclick = function () {var show_default = document.getElementById ("default");
					show_default.style.display = "block";}
	
		}	
	/* ======================*/


  }
}
/*-------------------------------------------------------------------------*/


function hideDivs(exempt)
{
  if (!document.getElementsByTagName) return null;
  if (!exempt) exempt = "";
	var whatsubset = document.getElementById ("right_content"); /*Only hides the Divs needed, ie those contained in the right_content secion */
  var divs = whatsubset.getElementsByTagName("div");
  for(var i=0; i < divs.length; i++)
  {
    var div = divs[i];
    var id = div.id;
    if ((id != "default") && (id != "footer") && (id != exempt))
    {
      div.style.display = "none";
    }
  }
}

function show(what)
{
  if (!document.getElementById) return null;
  showWhat = document.getElementById(what);
  showWhat.style.display = "block";
  hideDivs(what);
}

window.onload = function()
{
  fixLinks();
  fixLinks2();
  hideDivs("intro");
}