$(function () {
	$('.stack>img').toggle(
		function()
		{
			var $el=$(this);$el.next().removeClass('openStack').children('li').animate({top: base_stack+'px', left: '-10px'}, stackspeed);
			$el.next().find('li a>img').animate({height: (val_img+5)+'px', marginLeft: '0'}, stackspeed);$el.animate({paddingTop: '35px'});
		},
		function()
		{
			var vertical=0;var horizontal=1;var $el=$(this);
			$el.next().children().each(function(){
				$(this).animate({top: '-' + vertical + 'px', left: horizontal + 'px'}, stackspeed);
				vertical=vertical+val_stack;/*horizontal = (horizontal-.75)*1.75;;*/
			});
			$el.next().animate({top: '-35px', left: '10px'}, stackspeed).addClass('openStack').find('li a>img').animate({height: val_img+'px', marginLeft: '9px'}, stackspeed);
			$el.animate({paddingTop: '0'});
		}
	);
	
	$('.stack li a').hover(function(){$("img",this).animate({height: (val_img+6)+'px'}, 100);$("h2",this).animate({marginLeft: '30px'});$("h3",this).animate({marginLeft: '30px'});
	},function(){$("img",this).animate({height: val_img+'px'}, 100);$("h2",this).animate({marginLeft: '0'});$("h3",this).animate({marginLeft: '0'});});
});
