(function($)
{
	$(function(){		
			$('.content_item').each(function(index){
					var $this = $(this);
					var imageWrap = $this.parent().find('.image_wrap');
					var width = imageWrap.width();
					var height = $this.parent().height() - imageWrap.height();
					var $thisHeight = $this.height();
					$this.css({
							'position' : 'relative'
						});
					$this.hover(function()
						{	
							$this.find('li:not(.visible)').css({
												'display' : 'block',
												'visibility' : 'hidden',
												'opacity' : 1
											});
													
							if($thisHeight > height && $this.css('top') != (height - $thisHeight).toString() + 'px')
							{
								$this.stop().animate({
										'top' : height - $thisHeight
									}, 300, function(){
											$this.find('li:not(.visible)').css({
													'visibility' : 'visible',
													'display' : 'none'
												}).show();
										});
								$this.parent().find('img').eq(1).stop().animate({
										'top' : height - $thisHeight
									}, 300);
									
								
							}
						},
						function()
						{
							if($thisHeight > height && $this.css('top') != '0px')
							{
								$this.find('li:not(.visible)').hide();
								$this.find('li:not(.visible)').css({
											'display' : 'block',
											'visibility' : 'hidden',
											'opacity' : 1
										});
								$this.stop().animate({
												'top' : 0
											 }, 300);
								$this.parent().find('img').eq(1).stop().animate({
									'top' : 0
								}, 300);
							}
						});
				});
		});
})(jQuery);
