var scroll_state = 0;
var scroll_item_count = 2;
var move_pxs = 170;


function showNextNews( max )
{
  if( scroll_state < ( max - scroll_item_count ) )
  {
    $('#newsscrolldiv').animate({top: '-=170'}, 290);
    scroll_state = scroll_state+1;
  }
  else
  {
    var t = max - scroll_item_count;
    $('#newsscrolldiv').animate({top: '+='+(t*170)}, 700);
    scroll_state = 0;
  }
}

function showPreviousNews( max )
{
  if( scroll_state > 0 )
  {
    $('#newsscrolldiv').animate({top: '+=170'}, 290);
    scroll_state = scroll_state-1;
  }
  else
  {
    var t = max - scroll_item_count;
    $('#newsscrolldiv').animate({top: '-='+(t*170)}, 700);
    scroll_state = ( max - scroll_item_count );
  }
}

