//http://www.switchonthecode.com/tutorials/javascript-and-css-tutorial-accordion-menus

function change(index) {

	var nID = "Accordion" + index + "Content";
	
	var obj = document.getElementById(nID);
	
	if ( obj.style.display != 'block' ) {
		obj.style.display = 'block';
	} else {
		obj.style.display = 'none';
	}

}

/*var ContentHeight = 130;
var TimeToSlide = 200.0;

var openAccordion = '';

function runAccordion(index)
{
  var nID = "Accordion" + index + "Content";
  var nTID = "Accordion" + index + "Title";
  var nCID = "Accordion" + index + "Container";
  var oTID = openAccordion.replace("Content","Title");
  var oCID = openAccordion.replace("Content","Container");
if(openAccordion == nID) {
    nID = '';
	document.getElementById(nTID).className = document.getElementById(nTID).className.replace(' active','');
	document.getElementById(nCID).className = document.getElementById(nCID).className.replace(' active','');	
  } else {
	document.getElementById(nTID).className += ' active';  
	document.getElementById(nCID).className += ' active';  	
	if (openAccordion != '') {
		document.getElementById(oTID).className = document.getElementById(oTID).className.replace(' active','');
		document.getElementById(oCID).className = document.getElementById(oCID).className.replace(' active','');
}
  }
   
  setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'"
      + openAccordion + "','" + nID + "')", 33);
 
  openAccordion = nID;
}

function animate(lastTick, timeLeft, closingId, openingId)
{  
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
 
  var opening = (openingId == '') ? null : document.getElementById(openingId);
  var closing = (closingId == '') ? null : document.getElementById(closingId);
 
  if(timeLeft <= elapsedTicks)
  {
    if(opening != null)
      opening.style.height = ContentHeight + 'px';
   
    if(closing != null)
    {
      closing.style.display = 'none';
      closing.style.height = '0px';
    }
    return;
  }
 
  timeLeft -= elapsedTicks;
  var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight);

  if(opening != null)
  {
    if(opening.style.display != 'block')
      opening.style.display = 'block';
    opening.style.height = (ContentHeight - newClosedHeight) + 'px';
  }
 
  if(closing != null)
    closing.style.height = newClosedHeight + 'px';

  setTimeout("animate(" + curTick + "," + timeLeft + ",'"
      + closingId + "','" + openingId + "')", 33);
}*/
