
var address, score;
your_answer = new Array("x","x","x","x","x","x","x","x","x","x","x","x","x","x","x","x")
correct = new Array("c","c","a","b","c","b","a","b","c","c","c","b","b","b","a","c")
score = 0

get_Args()

function get_Args() {
	var poz, args, i;
	address = window.location.href
	args=""

	poz = address.indexOf("?")
	if (poz != -1) {
		args = address.substr(poz+1, address.length)
		address = address.substr(0,poz);
	}
	
	for(i=0; i<args.length; i++) {
		your_answer[i] = args.substr(i,1)
		if (your_answer[i] == correct[i]) score++;
	}
	
	//  add the style for class .answer
	document.write("<style type='text/css'>")
	if (poz == -1) {
		// answer hidden
		document.write(".answer { display:none; }")
	} else {
		// answer visible 
		document.write(".answer { color:#000000; background-color:#ffffff;}")
		document.write(".answer_wrong { color: #962702;}")
	}
	document.write("</style>")
}

function onClick_OK(form){
	var i,j, elem, args;
	
	for (i=0; i<16; i++)
		your_answer[i]="x";

	for (i=0; i<16; i++) {
		elem = eval("document.form1.q"+(i+1))
		for (j=0; (j<3) && (elem[j] != undefined); j++) {
			if (elem[j].checked) {
				your_answer[i] = elem[j].value
			}
		}
	}

	args="?"
	for (i=0; i<16; i++)
		args = args + your_answer[i];

	window.location.href = address + args;

	return true;
}


function onReset_OK(form){
	var poz, args, i;
	address = window.location.href

	poz = address.indexOf("?")
	if (poz != -1) {
		address = address.substr(0,poz);
	}
	window.location.href = address;
	return true;
}