 
 
var ContentHeight = 150;
var TimeToSlide = 450.0;
 
var openAccordion1 = '';
var openAccordion2 = '';
var openAccordion3 = '';
var openAccordion4 = '';
var openAccordion5 = '';
var openAccordion6 = '';
var openAccordion7 = '';
var openAccordion8 = '';
var openAccordion9 = '';


function runAccordion(index1,index2)
{
  var nID = "Accordion" + index1 + "Content" + index2;
  if (index1 == 1) {
   if(openAccordion1 == nID) {
     openAccordion1 = '';
   } 
   setTimeout("animate1(" 
       + new Date().getTime() + "," + TimeToSlide + ",'" 
       + openAccordion1 + "','" + nID + "')", 33);
  }
  if (index1 == 2) {
   if(openAccordion2 == nID) {
     openAccordion2 = '';
   }
   setTimeout("animate2("
       + new Date().getTime() + "," + TimeToSlide + ",'"
       + openAccordion2 + "','" + nID + "')", 33);
  }
  if (index1 == 3) {
   if(openAccordion3 == nID) {
     openAccordion3 = '';
   }
   setTimeout("animate3("
       + new Date().getTime() + "," + TimeToSlide + ",'"
       + openAccordion3 + "','" + nID + "')", 33);
  }
  if (index1 == 4) {
   if(openAccordion4 == nID) {
     openAccordion4 = '';
   }
   setTimeout("animate4("
       + new Date().getTime() + "," + TimeToSlide + ",'"
       + openAccordion4 + "','" + nID + "')", 33);
  }
  if (index1 == 5) {
   if(openAccordion5 == nID) {
     openAccordion5 = '';
   }
   setTimeout("animate5("
       + new Date().getTime() + "," + TimeToSlide + ",'"
       + openAccordion5 + "','" + nID + "')", 33);
  }
}
 
 
 
function animate1(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);
 
  //alert('opening:'+opening+openingId+'  closing:'+closing+':'+closingId+'   index1:');
  if (closing != null && opening == null) {
     return;
  } else {   
     openAccordion1 = openingId;
  }
  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("animate1(" + curTick + "," + timeLeft + ",'" 
      + closingId + "','" + openingId + "')", 33);
}
 
function animate2(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);
     
  //alert('opening:'+opening+openingId+'  closing:'+closing+':'+closingId+'   index2:');
  if (closing != null && opening == null) {
     return;
  } else {  
     openAccordion2 = openingId;
  }
  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("animate2(" + curTick + "," + timeLeft + ",'"
      + closingId + "','" + openingId + "')", 33);
}
 
function animate3(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);
     
  //alert('opening:'+opening+openingId+'  closing:'+closing+':'+closingId+'   index3:');
  if (closing != null && opening == null) {
     return;
  } else {  
     openAccordion3 = openingId;
  }
  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("animate3(" + curTick + "," + timeLeft + ",'"
      + closingId + "','" + openingId + "')", 33);
}
 
function animate4(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);
     
  //alert('opening:'+opening+openingId+'  closing:'+closing+':'+closingId+'   index4:');
  if (closing != null && opening == null) {
     return;
  } else {  
     openAccordion4 = openingId;
  }
  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("animate4(" + curTick + "," + timeLeft + ",'"
      + closingId + "','" + openingId + "')", 33);
}
 
function animate5(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);
     
  //alert('opening:'+opening+openingId+'  closing:'+closing+':'+closingId+'   index5:');
  if (closing != null && opening == null) {
     return;
  } else {  
     openAccordion5 = openingId;
  }
  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("animate5(" + curTick + "," + timeLeft + ",'"
      + closingId + "','" + openingId + "')", 33);
}
 

 

