$(document).ready(function(){

	$("div.portfolio").mouseenter(function() {
		if(!jQuery(this).children().is(":animated") ) {	
		
		var pheight = jQuery(this).height();
		var cheight = jQuery(this).children().height();
		
		// find margin height by taking child height from parent height
		var mTop = pheight-cheight;
		
		jQuery(this).children().animate({
			marginTop: mTop
		}, pheight*2, function() {
			// Animation complete.	
		});
		
		}
	});
	
	$("div.portfolio").mouseleave(function() {
										   
		var pheight = jQuery(this).height();								   
										   
		jQuery(this).children().animate({
			marginTop: "130px"
		}, pheight, function() {
			// Animation complete.
		});
	});
	
});
