$(document).ready(function(){
	$("#submit").click(function(){
		$('#error').empty();
		var errorCheckVar = 0;
		var errorCheckStr = "";
		var doErrorVar = 0;

		if ($('#fivek:checked').val() ) {
			errorCheckVar = 1;
		}
		if ($('#tenk:checked').val() ) {
			errorCheckVar = 1;
		}

		if(errorCheckVar == 0) {
			doErrorVar = doErrorVar + 1;
		}
		if(parseInt($('#select-tickets').val()) == 0) {
			doErrorVar = doErrorVar + 2;
		}

		if(doErrorVar == 3) {
			errorCheckStr = errorCheckStr + "Problem! You must select a race and choose amount of tickets!";
		}
		else if(doErrorVar == 1) {
			errorCheckStr = errorCheckStr + "Problem! You must select a race!";
		}
		else if(doErrorVar == 2) {
			errorCheckStr = errorCheckStr + "Problem! You must choose amount of tickets!";
		}
		else {
			errorCheckStr = "";
			doErrorVar = 0;
		}

		if(doErrorVar != 0) {
			$('#error').append(errorCheckStr);
			$('#error').fadeIn('slow', function() {
				//Animation Complete
 	    	});
 	    	return false;
 	    }
	});
});