qa = new Array();
qa[0] = ["ここはどこでしょう？","日和山公園","光ケ丘公園","飯森山公園",2];
 
q_sel = 3; 
 
setReady();
 
 
function setReady() {
	count = 0; 
	ansers = new Array(); 
	
	
	quiz();
}
 
 
function quiz() {
	var s, n;
	
	document.getElementById("text_q").innerHTML = (count + 1) + "問目：" + qa[count][0];
	
	s = "";
	for (n=1;n<=q_sel;n++) {
		if (qa[count][n] != "") {
			s += "【<a href='javascript:anser(" + n + ")'>" + n + "：" + qa[count][n] + "</a>】";
		}
	}
	document.getElementById("text_s").innerHTML = s;
}
 
//答え
function anser(num) {
	var s;
	s = (count + 1) + "問目：";
	
	if (num == qa[count][q_sel + 1]) {
		
		ansers[count] = "○";
	} else {
		ansers[count] = "×";
	}
	s += ansers[count] + qa[count][num];
	document.getElementById("text_a").innerHTML = s;
	
		
	count++;
	if (count < qa.length) {
		quiz();
	} else {
	
		document.getElementById("text_q").innerHTML = s;
		
	
		s = "【<a href='javascript:history.back()'>geoguessrに戻る</a>】";
		s += "【<a href=''>RESET</a>】";
		document.getElementById("text_s").innerHTML = s;
	
	
	}
}
