window.onload = init;
	var btnClr = document.getElementById('btnclr1');
	var btnValider = document.getElementById('btn1');
	var btnReponses = document.getElementById('btn2');
	var sc = 1;

function init() {
	document.getElementById('btnclr1').onclick = clear1;
	document.getElementById('btn1').onclick = Check;
	document.getElementById('btn2').onclick = answer;
	btnReponses.disabled=true;
	btnReponses.setAttribute('style', "color:#D4D0C8");
	btnValider.disabled=true;
	btnValider.setAttribute('style', "color:#D4D0C8");
}

function clear1() { 
	location.reload();
}
function answer() {
	if (sc == '1') {
		for(var i=1 ; i <= 5 ; i++ ) {
			var q = document.getElementById("fill1_"+i);
			var a = document.getElementById("fill1_"+i+'a');
					q.setAttribute('hidden','hidden')
					a.removeAttribute('hidden')
		}
		btnValider.disabled=true;
		btnValider.setAttribute('style', "color:#D4D0C8;");
		sc += 1
	} else {
		for(var i=1 ; i <= 5 ; i++ ) {
			var q = document.getElementById("fill1_"+i);
			var a = document.getElementById("fill1_"+i+'a');
					a.setAttribute('hidden','hidden')
					q.removeAttribute('hidden')
		}
		btnValider.disabled=false;
		btnValider.setAttribute('style', "color:#000000;");
		sc -= 1
	}
}

function Check() {
	sc = 1;
	var fillSelect = document.getElementById("crossword").getElementsByClassName("no");
	sc = 1;
	for(var i=1; i<=fillSelect.length; i++) {
		var correctVal = document.getElementById("fill1_"+i);
		var matchVal = document.getElementById("fill_ans1_"+i);
		if (correctVal.value.toUpperCase()==matchVal.innerHTML) {
			correctVal.style.backgroundColor = "#008000";
			correctVal.style.color = "#fff";
			correctVal.style.fontWeight = "bold";
		} else {
			correctVal.style.backgroundColor = "red";
			correctVal.style.color = "#fff";
			correctVal.style.fontWeight = "bold";
		}
	}
	btnReponses.disabled=false;
	btnReponses.setAttribute('style', "color:#000000");
}

function showValider() {
	sc = 1;
	btnValider.disabled=false;
	btnValider.setAttribute('style', "color:#000000");
}


