var RentAdvert_count;

var RentAdvert_interval;

var old_RentAdvert = 0;

var current_RentAdvert = 0;
 
$(document).ready(function()
													 
{
	
  RentAdvert_count = $("a.RentAdvert").size();
	
  $("a.RentAdvert:eq("+current_RentAdvert+")").css('top', '0px');
	
  RentAdvert_interval = setInterval(RentAdvert_rotate,8000);
	
  $('#RentAdvertBar').hover(function() 
																
  {
		
    clearInterval(RentAdvert_interval);
		
  }
	
  , function() 
	
  {
		
    RentAdvert_interval = setInterval(RentAdvert_rotate,8000);
		
    RentAdvert_rotate();
		
  });
	
});

function RentAdvert_rotate() 

{
	
  current_RentAdvert = (old_RentAdvert + 1) % RentAdvert_count;
	
  $("a.RentAdvert:eq(" + old_RentAdvert + ")")
	
  .animate({top: 160},"slow", function() 
																				
  {
		
    $(this).css('top', '165px');
		
  });
	
  $("a.RentAdvert:eq(" + current_RentAdvert + ")")
	
  .animate({top: 0},"slow");  
	
  old_RentAdvert = current_RentAdvert;
	
}
