var newSelectionButton, usedSelectionButton;
var newSelectionBody, usedSelectionBody;

function init() {
	newSelectionButton = document.getElementById('new');
	newSelectionBody = document.getElementById('container-new');
	usedSelectionButton = document.getElementById('used');
	usedSelectionBody = document.getElementById('container-used');
	doUsed('show');
	doNew('hide');
}

function setSelected(parent) {
	if (parent == 'new') {
		doNew('show');
		doUsed('hide');
	} else if (parent == 'used') {
		doUsed('show');
		doNew('new');
	}
}

function doNew(what) {
	if (what == 'show') {
		newSelectionButton.className = 'selection-on';
		newSelectionBody.style.display = 'block';
	} else {
		newSelectionButton.className = 'selection-off';
		newSelectionBody.style.display = 'none';
	}
}

function doUsed(what) {
	if (what == 'show') {
		usedSelectionButton.className = 'selection-on';
		usedSelectionBody.style.display = 'block';
	} else {
		usedSelectionButton.className = 'selection-off';
		usedSelectionBody.style.display = 'none';
	}
}
