selectDiv = "main-table";

// thanks to agavegroup.com for this function to make nextSibling firefox compliant
function getNextSibling(startBrother){
  endBrother=startBrother.nextSibling;
  while(endBrother.nodeType!=1){
    endBrother = endBrother.nextSibling;
  }
  return endBrother;
}

function getChild(parental, offset)
{

}


function getChild(parental, offset)
{
  hit = 0;
  i=0;
  while (hit<=offset && parental.childNodes[i])
  {
   if(parental.childNodes[i].nodeType==1)
    {
	theNode = parental.childNodes[i];
        hit++;
    }
   i++;
  }

  if(hit!=offset+1)
 	return false;
  else
	return theNode;
}



function hideMenuElements()
{
  for(var i=0; document.getElementById('side_menu').childNodes[i]; i++) 
   { 
     chi = getChild(document.getElementById('side_menu'), i);
     if(chi)
     chi = getChild(chi,1);
      
     if(chi)
     	 chi.style.display='none';
  }
}



function toggle(elemId)
{

hideMenuElements();

 if (getNextSibling(document.getElementById(elemId)))
 {
 el = getNextSibling(document.getElementById(elemId));
el.style.display = 'block';
   }

}



// LOAD XML DATA

function loadXML(url,tager)
{


 if(window.XMLHttpRequest)
   {
	req = new XMLHttpRequest();
        
   }


  else if(window.ActiveXObject)
	{
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

  if (req)
  {
    req.onreadystatechange = function () {checkReady(url, tager);};
    req.open("GET", url, true);
    req.send(null);
  }
  else
  alert("error loading data");
  
}

function checkReady(url, tager)
{ 
  if(req.readyState == 4 && req.status == 200)
      {	 
        
   	document.getElementById(tager).innerHTML = req.responseText;
      }

}


function loadBackground()
{
  document.getElementById('body').style.background = "url('background.jpg') no-repeat";
}


function makeTextLarger(selectDiv)
{
  if(!document.getElementById(selectDiv).style.fontSize)
  {
   document.getElementById(selectDiv).style.fontSize = "100%";
   document.getElementById("main-table").style.fontSize = "100%";
    }
  fs = document.getElementById(selectDiv).style.fontSize;
  fs = Number(parseInt(fs, 10));

  if(fs<150)
    {
      fs += 5;
      fs = String(fs);
      fs = fs.concat("%");

      document.getElementById(selectDiv).style.fontSize = fs;
    }
}


function makeTextSmaller(selectDiv)
{
  if(!document.getElementById(selectDiv).style.fontSize)
  {
       document.getElementById(selectDiv).style.fontSize = "100%";
     document.getElementById("main-table").style.fontSize = "100%";
  }
  fs = document.getElementById(selectDiv).style.fontSize;
  fs = Number(parseInt(fs, 10));

  if(fs>50)
    {
      fs -= 5;
      fs = String(fs);
      fs = fs.concat("%");
      document.getElementById(selectDiv).style.fontSize = fs;
    }
}



