function NumsCheck() {

	if((document.form.one.value/1 + document.form.two.value/1) == document.form.ans.value/1){
		document.form.greencheck.style.visibility="visible";
		document.form.redx.style.visibility="hidden";
		document.form.greencheck.style.width="20px";
	}else{
		document.form.greencheck.style.width="1px";
		document.form.greencheck.style.visibility="hidden";
		document.form.redx.style.visibility="visible";
	}
}

function NumsSubmit() {

	if((document.form.one.value/1 + document.form.two.value/1) == document.form.ans.value/1){
		if(document.form.agree.value == "1"){
			document.form.submit();
		}else{
			alert("Please agree to our terms and policies by checking the box.");
		}
	}else{
		alert("You did not enter the correct Anti-Spam number.");
	}
	
}

function Reset() {
document.form.clear();
}

function CheckBox() {

	if(document.form.agree.value == 0){
		document.form.agree.value = 1;
	}
	else if(document.form.agree.value == 1)
	{
		document.form.agree.value = 0;
	}
	
}

function NewNumbers() {

	var one = Math.random();
	one = one * 9;
	one = Math.ceil(one);
	document.form.one.value = one;

	var two = Math.random();
	two = two * 9;
	two = Math.ceil(two);
	document.form.two.value = two;
	
	NumsCheck();
}