/*
	movecollapse.js
	Functions to collapse and expand the sections
	Jared Buttefield
*/

function showLink(aTag){
	fxl = new Tween(aTag.style, "height", Tween.regularEaseOut, 0, aTag.scrollHeight, 1, "px");
	fxl.start();
}

function hideLink(aTag){
	fxl = new Tween(aTag.style, "height", Tween.regularEaseOut, aTag.scrollHeight, 0, 1, "px");
	fxl.start();
}

function revealSection(sectionid){
	var section = document.getElementById("section" + sectionid);
	section.style.height = 0 + "px";
	section.style.display = "block";
	fx = new Tween(section.style, "height", Tween.regularEaseOut, 0, section.scrollHeight+10, 1.5, "px");
	fx.start();
	hideLink(document.getElementById('showLink' + sectionid));
}

function hideSection(sectionid){
	var section = document.getElementById("section" + sectionid);
	fx = new Tween(section.style, "height", Tween.regularEaseOut, section.scrollHeight+10, 0, 1, "px");
	fx.onMotionFinished = function(){
		section.style.display = "none";
	};
	fx.start();
	showLink(document.getElementById('showLink' + sectionid));
}