function flipCard(side, id) {
	document.getElementById('cardfront-' + id).style.display = (side == 'back') ? 'none' : '';
	document.getElementById('cardback-' + id).style.display = (side == 'front') ? 'none' : '';
}

function swapCard(link) {
	var id, type, types, i, typesType;
	var id = link.parentNode.id.replace(/[^\d]+/, '');
	var type = link.innerHTML.replace(/ /, '').toLowerCase();
	var types = document.getElementById('cardbuttons-' + id).getElementsByTagName('a');
	for (i = 0; i < types.length; i++) {
		typesType = types[i].innerHTML.replace(/ /, '').toLowerCase();
		document.getElementById('card' + typesType + '-' + id).style.display = (typesType == type) ? '' : 'none';
		types[i].style.fontWeight = (typesType == type) ? 'bold' : 'normal';
	}
}
