var footerpos = 0;
var footerHeight = 0;
 
function initSliders(section) {
	// Memory
	footerTop = $("div#footer").offset().top;
	footerHeight = $("div#footer").outerHeight()+20;
	
	// Slide down
	$("a.readmore.item").click(function(event) {
		event.preventDefault();
		div=$(this).parents("div.short");
		div.slideUp("fast", function(event) {
			div.prev("div.long").slideDown("fast", function(event) { 
				if(($("div#"+section).height() + $("div#"+section).offset().top) >= ($("div#footer").offset().top - 20)) {
					$("div#footer").animate({top: '+=' + (20 + ($("div#"+section).height() + $("div#"+section).offset().top) - $("div#footer").offset().top), height: footerHeight},'fast');
					
				}
			});
		});
	});
	
	// Slide up
	$("a.close.item").click(function(event) {
		event.preventDefault();
		div=$(this).parents("div.long");
		div.slideUp("fast", function(event) {
			div.next("div.short").slideDown("fast", function(event) {
				if(($("div#footer").offset().top) >= ($("div#"+section).height() + $("div#"+section).offset().top + 20)) {
					$("div#footer").animate({top: '-=' + ($("div#footer").offset().top - Math.max(($("div#"+section).height() + $("div#"+section).offset().top), footerTop) - 20)}, 'fast') ;
				}
			});
		});
	});
}


