$(document).ready(function(){
	rolly('.current');
	rolly('.past');
	screenshotPreview();
}); //close doc ready

rolly = function(e){				   
	$(e + ' li').click(function(){
    	window.location=$(this).find('a').attr('href');return false;
	});


	$(e + ' li').hover(
	function(){
		if($(this).children('.thmb').css('display')!='inline'){
			$(this).children('.thmb').css('z-index', '5');
			$(e +' li .thmb').fadeOut(1000);$(this).children('span').fadeIn(500);
		}else{
		$(e + ' li .thmb').fadeOut(1000);
		}
		window.status=$(this).find("a").attr("href");return false;
	},
	function () {
        $(e + ' li .thmb').fadeOut(1000);
    });
};

this.screenshotPreview = function(){	

	$("a.screenshot").parent().hover(function(e){
		//add fade in
		$("body").append("<p id='screenshot'><img src='"+ $(this).children('a').attr("rel") +"' alt='url preview' /></p>");								 
		$("#screenshot")
			.css("top","0px")
			.css("right","0px")
			.fadeIn(500);						
    },
    
	function(){	
		$("#screenshot").remove();
    });				
};
