//Rotate home page callouts variables
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;

//Rotate home page callouts
function headline_rotate() {
  current_headline = (old_headline + 1) % headline_count;
  jQuery("div.rotating-story:eq(" + old_headline + ")")
    .animate({top: -150},"slow", function() {
      jQuery(this).css('top', '95px');
    });
  jQuery("div.rotating-story:eq(" + current_headline + ")")
    .animate({top: 0},"slow");
  old_headline = current_headline;
  //clear the timer and reset it to rotate every 5 seconds
  clearInterval(headline_interval);
  headline_interval = setInterval(headline_rotate,5000);
}

jQuery(function() {
    //Rotate home page callouts
    /*headline_count = jQuery("div.rotating-story").size();
    jQuery("div.rotating-story:eq("+current_headline+")").css('top', '0px');
    var i = 0;
    jQuery("div.rotating-story").each(function() {
        if (i > 0) {
            jQuery(this).css('top', (95*i) + 'px');
        }
        i++;
    });
    //initially set the timer to wait until the Flash animation finishes
    headline_interval = setInterval(headline_rotate, 3000);
    jQuery('#box-left-top').hover(function() {
        clearInterval(headline_interval);
    }, function() {
        headline_interval = setInterval(headline_rotate, 3000);
    });*/

});