// onClick example 3
function validate()
{
	input_box=confirm('Are you sure your name is ' + document.getElementById('yourname').value);
	if (input_box==true)
	{
		// Output when OK is clicked
		alert ('Your name is ' + document.getElementById('yourname').value);
	}
	else
	{
		// Output when Cancel is clicked
		alert ('Enter your name correctly');
		document.getElementById('yourname').value='';
		document.getElementById('yourname').focus();
	}
}

// onClick example 4
function checkAnswer2() {
	// Check for an operational DOM
	if(document.getElementById) {
		// Make the right/wrong answer messages invisible by setting their
		// class names to "invis" - see style definitions below
		document.getElementById('answercorrect').className = "invis";
		document.getElementById('answerwrong').className   = "invis";

		// Get answer from form using DOM and check it
		if(document.getElementById('answerbox').value == 12) {
			// If correct, change classname of correct answer to make it visible
			document.getElementById('answercorrect').className = "correct";
		}
		else {
		// If incorrect, change classname of wrong answer mesg to make it visible
		document.getElementById('answerwrong').className = "incorrect";
		}
	}
}

