function initiate_animation () {
  countChildElements('sidebar', 'li');
}

function countChildElements(parent, child){
  var parent = document.getElementById(parent);
  var childCount = parent.getElementsByTagName(child).length;

  animate_navigation(1, childCount);
}

function animate_navigation (p, childCount) {

  if(p < 12 ){
    var t1 = new Tween(document.getElementById('list_item_'+ p).style,'marginTop',Tween.elasticEaseOut,-35,0,1,'px');
    t1.start();
  }
  if(p < (childCount-0)){
    p++;
    setTimeout("animate_navigation("+p+", "+childCount+")" , 200);
  }
}

function hover_effect (event, obj) {
  
  var t1 = new Tween(obj.style,'marginTop',Tween.EaseOut,0,-5,0.2,'px');
  t1.start();
}

function no_hover_effect (event, obj) {
  
  var t1 = new Tween(obj.style,'marginTop',Tween.EaseOut,-5,0,0.2,'px');
  t1.start();
}
