function stretchy(jQuerySelector) {
 var stretchMe = $(jQuerySelector);
 var offset = $(window).height() - $("#header").height() - $("#main").height();
 if (offset > 0) stretchMe.css("min-height", offset);
}

function showOneSection(id) {
	$("#list-of-shorts").hide();
	$(id).fadeIn('fast');
}

function showAllSections(id) {
	$(id).hide();
	$("#list-of-shorts").fadeIn('fast');
}

$(function() { 
	stretchy("#bottom");
	//window.onresize = stretchy;
	$(".catalogue-text").hide();
	$(".catalogue-title").click(function() {
		$(this).next().toggle("fast");
	});
	$(".catalogue-text").click(function() {
		$(this).toggle("fast");
	});
	
	//HOME
	$("#short-inno a").click(function() {
		showOneSection("#long-inno");
	});
	
	$("#short-trans a").click(function() {
		showOneSection("#long-trans");
	});
	
	$("#short-glob a").click(function() {
		showOneSection("#long-glob");
	});
	
	$("#long-inno a").click(function() {
		showAllSections("#long-inno");
	});
	
	$("#long-trans a").click(function() {
		showAllSections("#long-trans");
	});
	
	$("#long-glob a").click(function() {
		showAllSections("#long-glob");
	});
});
