				var $list_gm 		= $('#rp_list ul');
				var elems_cnt 		= $list_gm.children().length;

function init_gm()
{

				/**
				* show the first set of posts.
				* 200 is the initial left margin for the list elements
				*/
				$list_gm 		= $('#rp_list ul');
				elems_cnt 		= $list_gm.children().length;
				load_gm(260);
}


				
				
				function load_gm(initial){
//					$list_gm.find('li').hide().andSelf().find('div').css('margin-left',-initial+'px');

					var loaded	= 0;
					//show max 5 random posts from all the ones in the list. 
					//Make sure not to repeat
					while(loaded < 5 && loaded < elems_cnt){
						var r 		= Math.floor(Math.random()*elems_cnt);
						var $elem	= $list_gm.find('li:nth-child('+ (r+1) +')');
						if($elem.is(':visible'))
							continue;
						else
							$elem.show();
						++loaded;
					}
					//animate them
					var d = 400;
					$list_gm.find('li:visible div').each(function(){
						$(this).stop().animate({
							marginLeft :"-85px"
						},d);
					});


				}
					
				/**
				* hovering over the list elements makes them slide out
				*/	
				$list_gm.find('li:visible').live('mouseenter',function () {
					$(this).find('div').stop().animate({
						marginLeft : "-250px"
					},200);
				}).live('mouseleave',function () {
					$(this).find('div').stop().animate({
						marginLeft : "-85px"
					},200);
				});
				
				/**
				* when clicking the shuffle button,
				* show 5 random posts
				*/
				$('#rp_shuffle').unbind('click')
								.bind('click',shuffle)
								.stop()
								.animate({ marginLeft :"-18px"},700);
								
				function shuffle(){
					$list_gm.find('li:visible div').stop().animate({
						 marginLeft : "85px"
					},200,function(){
						load_gm(-60);
					});
				}

