﻿// JScript File


$(document).ready(function(){
    $("ul#vocabulary_list > li:first").css('top', '0');
     setTimeout("headline_rotate('vocabulary_list', 30, 0)",2000);
    $("ul#declension_list > li:first").css('top', '0');
     setTimeout("headline_rotate('declension_list', 30, 0)",2000);
    //headline_interval_2 = setInterval(headline_rotate("vocabulary_list", 0),7000);
});
 
function headline_rotate(ul_id, content_height, old_headline) {
  var headline_count = $("ul#" + ul_id + " > li").size();
  var current_headline = (old_headline + 1) % headline_count;
    $("ul#" + ul_id + " > li:eq(" + old_headline + ")")
    .animate({top: -content_height},"slow", function() {
      $(this).css('top', content_height+'px');
    })
    //.fadeOut('slow');
  $("ul#" + ul_id + " > li:eq(" + current_headline + ")")
    .animate({top: 0},"slow"); 
    setTimeout("headline_rotate('" + ul_id + "', " + content_height + ", " + current_headline + ")",2000);
}
