// JavaScript Document
function init(){
	var collapsibles = document.getElementsByClassName("collapsible");
	var collapseButtons = document.getElementsByTagName("h3");
	for(var i = 0; i < collapsibles.length; i++){
		collapsibles[i].style.height = "0px";
	}
};



function toggleChild(element){
	Element.cleanWhitespace(element.parentNode.parentNode);
	var heading = element.parentNode
	var iContainer = heading.nextSibling;
	var containerHeight = Element.getHeight(iContainer);
	Element.cleanWhitespace(iContainer);
	var childP = iContainer.firstChild;
	var pHeight = Element.getHeight(childP);
	var myEffect = new fx.Height(iContainer , {duration: 250, opacity: true, onComplete: function(){
		expanding = false;
		}
	});
	if(containerHeight <= 0){
		myEffect.custom(0, pHeight);
	}else{
		myEffect.custom(pHeight, 0);
	}
}

window.onload = function(){
	init();
}