$(document).ready(function(){	
/*   
	$('.preview > span').hide();
	$('.preview > a').click(function(){
		$('.preview > span').hide();
		$('.preview > a > img').fadeIn('slow');
		$(this).parent('.preview').find('img').fadeOut('slow',function(){
 			$(this).parent('a').parent('.preview').children('span').fadeIn('slow');
 		});
		return false;
	});
*/

	function over(obj,last){
		
		var $rewind = last?'-88px':'-3px';
		
		obj.css({'z-index' : 15,'opacity': 1});
		
		if(obj.find('.over').length == 0){
			obj.find('a').prepend('<div class="over">&nbsp;</div>');
		}
		
		obj.find(".over").hide().css({'opacity':0,'background' : '#fff url('+obj.attr('ff-src')+') top left no-repeat'}).show().animate({'width': '1000px', 'opacity': 1}, 300);
	}

	function out(obj){
		obj.css({'z-index' : 10});
		obj.animate({'opacity':'0.6'});
		obj.find('.over').fadeOut('slow', function(){
			$(this).css({'width' : '175px','z-index' : 10});
			$(this).parents('.preview').css({ 'opacity': '0.6'})
		});
	}

	/*$('.over').live('click',function(e){
		// $('.content').fadeIn('fast');
		// $(this).animate({'background' : 'none'},300);
	// });*/

	$('.preview').each(function(){
		$(this).attr('ff-src', $(this).find('img').attr('src'));
		$(this).find('img').hide();
		$(this).css({'background' : 'url('+$(this).attr('ff-src')+') top left no-repeat', 'opacity' : 0.6})
	})

	$('.preview:not(:last)').hover(
		function(){
			over($(this),0);
		},
		function(){
			out($(this));
		}
	);

	$('.preview:last').hover(
		function(){
			over($(this),1);
		},
		function(){
			out($(this));
		}
	);


});
