// JavaScript Document
$(function() {
				var $liste 		= $('#rp_list ul');
				var ele_cnt 		= $liste.children().length;
				/*
				* show the first set of posts.
				* 200 is the initial left margin for the list elements
				*/
				load(160);
				
				function load(initial){
					$liste.find('li').hide().andSelf().find('div').css('margin-left',-initial+'px');
					var geladen	= 0;
					//show 5 random posts from all the ones in the list. 
					//Make sure not to repeat
					while(geladen < 3){
						var q 		= Math.floor(Math.random()*ele_cnt);
						var $ele	= $liste.find('li:nth-child('+ (q+1) +')');
						if($ele.is(':visible'))
							continue;
						else
							$ele.show();
						++geladen;
					}
					//animate them
					var g = 200;
					$liste.find('li:visible div').each(function(){
						$(this).stop().animate({
							'marginLeft':'-12px'
						},g += 100);
					});
				}
					
				/**
				* hovering over the list elements makes them slide out
				*/	
				$liste.find('li:visible').live('mouseenter',function () {
					$(this).find('div').stop().animate({
						'marginLeft':'-160px'
					},200);
				}).live('mouseleave',function () {
					$(this).find('div').stop().animate({
						'marginLeft':'-12px'
					},200);
				});
					
				
            });
