$(function () { 
	// Stack initialize
	var openspeed = 300;
	$('.stack>img').toggle(function(){
		var vertical = 200;
		var horizontal = 0;
		var $el=$(this);
		$el.next().children().each(function(){
			$(this).animate({top: 0 + '-' + 'px', left: vertical + 'px'}, openspeed);
			vertical = vertical + 100;
			horizontal = (horizontal+.100)*0;
		});
		$el.next().animate({top: '-80px', left: '-180px'}, openspeed).addClass('openStack')
		   .find('li a>img').animate({width: '80px', margin: '0px', padding: '0px'}, openspeed);
		$el.animate({paddingTop: '0'});
	
	
		
	});
	
	// Stacks additional animation
	$('.stack li a').hover(function(){
		$("img",this).animate({width: '100px'}, 100);
		$("span",this).animate({margin: '20px 0px 0px 0px'});
	},function(){
		$("img",this).animate({width: '80px'}, 50);
		$("span",this).animate({margin: '20px 0px 0px 0px'});
	});
	
	
});
