var headline_count;
var headline_interval;
var current_headline = 0;
var old_headline = 0;

$(document).ready(function() {

    $('div.scrollBottom ul li').click(function() {
    $(this).children('p.scrollHide').toggle();
    });

    $('#ctl00_textbox_search').focus(function() {    
        $(this).attr('value','')
    });   
    
    $('div.innerSide ul li:last-child').css('border-bottom','0');
    
    
        //index scrolling news - NEW
      headline_count = $("div.newsArticle").size();
      $("div.newsArticle:eq("+current_headline+")").css('top', '2px');
     
      headline_interval = setInterval(headline_rotate,5500);
      $('div.newsInner').hover(function() {
        clearInterval(headline_interval);
      }, function() {
        headline_interval = setInterval(headline_rotate,5500);
        headline_rotate();
      });
    function headline_rotate() {
      current_headline = (old_headline + 1) % headline_count;
      $("div.newsArticle:eq(" + old_headline + ")")
        .animate({top: -150},"slow", function() {
          $(this).css('top', '100px');
        });
      $("div.newsArticle:eq(" + current_headline + ")")
        .animate({top: 2},"slow");  
      old_headline = current_headline;
    }    
    
});
