function button_click(colr) {
	hide('buttons');
	g_n++;
	if (g_cards[1]==g_cards[4]) {
		if (colr=='green') g_score++;
	} else {
		if (colr=='red') g_score++;
	}
	var image=document.getElementById(1);
	image.src='cards/'+g_cards[1]+'.png';
	var image=document.getElementById(4);
	image.src='cards/'+g_cards[4]+'.png';
	if (g_n==10) {
		finale();
	} else {
		// wait two seconds
		setTimeout(button_click2,2000);
	}
}
function button_click2() {
	for (var i=0;i<5;i++) {
		var image=document.getElementById(i);
		image.src='cards/back.png';
	}
	pick0();
	var image=document.getElementById(0);
	image.src='cards/'+g_cards[0]+'.png';
	// wait three seconds
	setTimeout(button_click3,3000);
}
function button_click3() {
	var image=document.getElementById(0);
	image.src='cards/back.png';
	move();
	for (var j=4; j>0; j--) g_cards[j]=g_cards[j-1];
	// when move finished
	//show('buttons');
}
