function swapTabs(newTabId) {
	var oldTabId = document.getElementById('curTab').value;
	var oldTab = document.getElementById(oldTabId).style;
	var newTab = document.getElementById(newTabId).style;

	oldTab.display	= 'none';
	newTab.display	= '';

	document.getElementById('curTab').value = newTabId;
}

function showDiv(divId) {
	var newDiv = document.getElementById(divId).style;
	var oldDivId = document.getElementById('curDiv').value;
	if(oldDivId){
		var oldDiv = document.getElementById(oldDivId).style;
		oldDiv.display = 'none';
	}
	
	newDiv.display = '';
	
	document.getElementById('curDiv').value = divId;
}

function inputValidation() {
	var validName = 0;
	var validComments = 0;
	if(document.getElementById('name').value != '') {
		validName = 1;
	}

	if(document.getElementById('comment').value != '') {
		validComments = 1;
	}

	if(validName == 1 && validComments == 1) {
		return true;
	} else {
		var errorMessage = "Errors: ";
		if(validName == 0) { errorMessage += "You must provide a name! "; }
		if(validComments == 0) { errorMessage += "You must enter a comment! "; }
		document.getElementById('formErrors').innerHTML = errorMessage;
		return false;
	}
}
