	window.onload = init;
	document.getElementById('btnclr1').onclick = newBoard;
	document.getElementById('btn1').onclick = result;
	document.getElementById('btn2').onclick = check; //Valider

	var btnClr = document.getElementById('btnclr1');
	var btnReponses = document.getElementById('btn1');
	var btnValider = document.getElementById('btn2');

var counter=1;
function init() {
	document.getElementById("screen1").style.display = 'block';
	btnReponses.disabled=true;
	btnReponses.setAttribute('style', "color:#D4D0C8");
	btnValider.disabled=true;
	btnValider.setAttribute('style', "color:#D4D0C8");
	btnClr.disabled=true;
	btnClr.setAttribute('style', "color:#D4D0C8");

}

var right = 0;
var wrong = 0;
var checkCount = 0;

var sc = 1;
function result() {
	var CheckBoxPara = document.getElementById('CheckBoxPara')
	var ansCheckPara = document.getElementById('CheckPara'+counter)
	if (sc == 1) {
		CheckBoxPara.setAttribute('hidden','hidden')
		ansCheckPara.removeAttribute('hidden')
		btnClr.disabled=true;
		btnClr.setAttribute('style', "color:#D4D0C8");
		btnValider.disabled=true;
		btnValider.setAttribute('style', "color:#D4D0C8");
	sc += 1
	} else {
		ansCheckPara.setAttribute('hidden','hidden')
		CheckBoxPara.removeAttribute('hidden')
		btnClr.disabled=false;
		btnClr.setAttribute('style', "color:#000000");
		btnValider.disabled=false;
		btnValider.setAttribute('style', "color:#000000");
	sc -= 1
	}


}



function check() {
	var correctAns = document.getElementById("ans"+counter).innerHTML;
	var getAnswer = document.getElementById("checkbox_ans").innerHTML;
	if (getAnswer=="") {
		var clearAns1 = document.getElementById('Faux');
		clearAns1.setAttribute('style', 'color:red;border:3px solid red; padding: .5em;border-radius: 10px;');
		var clearAns2 = document.getElementById('Vrai');
		clearAns2.setAttribute('style', 'color:red;border:3px solid red; padding: .5em;border-radius: 10px;');
	} else {
		if (getAnswer == correctAns) {
			var aa = document.getElementById(getAnswer);
			aa.setAttribute('style', 'color:green;border:3px solid green; padding: .5em;border-radius: 10px;');
		} else {
			var aa = document.getElementById(getAnswer);
			aa.setAttribute('style', 'color:red;border:3px solid red; padding: .5em;border-radius: 10px;');
		}
	}

	btnClr.disabled=false;
	btnClr.setAttribute('style', "color:#000000");
	btnReponses.disabled=false;
	btnReponses.setAttribute('style', "color:#000000");
}





function newBoard() {
if (counter < 5) {
		counter+=1;
	} else {
		counter = 1;
	}
	var screenElement = document.getElementsByClassName('screen');
	for(var i=1; i < screenElement.length+1; i++) {
		var screenElement1 = document.getElementById('screen'+i).style.display ='none';
		var clearAns1 = document.getElementById('Faux');
		clearAns1.setAttribute('style', 'color:#000000;border:3px solid #FAF7EA; padding: .5em;border-radius: 10px;');
		var clearAns2 = document.getElementById('Vrai');
		clearAns2.setAttribute('style', 'color:#000000;border:3px solid #FAF7EA; padding: .5em;border-radius: 10px;');
		var clearAns3 = document.getElementById('checkbox_ans');
		clearAns3.innerHTML='';
		var cb1 = document.getElementById("cb1");
		cb1.checked=false
		var cb2 = document.getElementById("cb2");
		cb2.checked=false
	}

	var screenElement2 = document.getElementById('screen'+counter).style.display = 'block';

	var screenElement6 = document.getElementById('btnclr1');
	screenElement6.setAttribute('value', 'Suivant');
	screenElement6.setAttribute('style', 'background-image:url("images/rarrow.png");background-repeat: no-repeat;background-position: left;');


	var bt1 = document.getElementById('btn1');
	bt1.disabled=true;
	bt1.setAttribute('style', "color:#D4D0C8");
	var bt2 = document.getElementById('btn2');
	bt2.disabled=true;
	bt2.setAttribute('style', "color:#D4D0C8");
	var bt3 = document.getElementById('btnclr1');
	bt3.disabled=true;
	bt3.setAttribute('style', "color:#D4D0C8");
}








function checkbox1() {
	var cb1 = document.getElementById("cb1");
	cb1.setAttribute('checked', true);
	var set_ans=document.getElementById("checkbox_ans");
	set_ans.innerText='Faux';
	var cb2 = document.getElementById("cb2");
	cb2.removeAttribute('checked');
	cb2.checked=false
	var clearAns1 = document.getElementById('Faux');
	clearAns1.setAttribute('style', 'color:#000000;border:3px solid #FAF7EA; padding: .5em;border-radius: 10px;');
	var clearAns2 = document.getElementById('Vrai');
	clearAns2.setAttribute('style', 'color:#000000;border:3px solid #FAF7EA; padding: .5em;border-radius: 10px;');

	btnReponses.disabled=true;
	btnReponses.setAttribute('style', "color:#D4D0C8");
	btnClr.disabled=true;
	btnClr.setAttribute('style', "color:#D4D0C8");


	btnValider.disabled=false;
	btnValider.setAttribute('style', "color:#000000");
}
function checkbox2() {
	var cb1 = document.getElementById("cb2");
	cb1.setAttribute('checked', true);
	var set_ans=document.getElementById("checkbox_ans");
	set_ans.innerText='Vrai';
	var cb2 = document.getElementById("cb1");
	cb2.removeAttribute('checked');
	cb2.checked=false
	var clearAns1 = document.getElementById('Faux');
	clearAns1.setAttribute('style', 'color:#000000;border:3px solid #FAF7EA; padding: .5em;border-radius: 10px;');
	var clearAns2 = document.getElementById('Vrai');
	clearAns2.setAttribute('style', 'color:#000000;border:3px solid #FAF7EA; padding: .5em;border-radius: 10px;');
	btnReponses.disabled=true;
	btnReponses.setAttribute('style', "color:#D4D0C8");
	btnClr.disabled=true;
	btnClr.setAttribute('style', "color:#D4D0C8");
	btnValider.disabled=false;
	btnValider.setAttribute('style', "color:#000000");
}
