// Troca de Conteudo da pagina empresas
function changeContent(elementShow) {
	$$(".services").each(function(element) {
		if (element.className.include(elementShow)) element.show();
		else element.hide();
	});
}

function getVisibleBox() {
	var visible = $$('.answer_box').findAll(function(s) {
		return s.style.display != 'none';
	});
	return visible.sortBy(function(s) { return s.style.top; });
}

function reorder(elements) {
	elements.each(function(obj, i) { 
		obj.morph('top:' + (i * (obj.getHeight() + 10)) + 'px', { duration: 0.4 });
	});
}


function showQuestion(el) {
	elements = getVisibleBox().without($(el));
	reorder([$(el)].concat(elements), 'front');
	$(el).appear();
}

function hideQuestion(el) {
	$(el).fade();
	elements = getVisibleBox().without($(el));
	reorder(elements);
}
