

function clearT() {
	if (t) {
		clearTimeout(t)
	}
}

function go_lights() {
	//blink_speed = 200
	clearTimeout(t)
	blink_off();
	blink_on();
	t=setTimeout("go_lights()",blink_speed);
}

function swapImage(img_no) {
	var highlight = high_imag;
	for (i=0;i<game_buttons.length;i++) {
		if (img_no.substring(5,img_no.length) == game_buttons[i]) {
		highlight = game_imag;
		break;
		}
	}

	swap_image = eval("document." + img_no);
	swap_image.src = highlight.src
}

function blink_off() {
	if (image_counter != 1) {
		pre_image_counter = (image_counter - 1)
	} else {
		pre_image_counter = total_buttons
	}
	
	reset_image = eval( "document.image" + pre_image_counter);
	reset_image.src = reg_imag.src
}

function blink_on() {
	if (image_counter > total_buttons) {
		image_counter=1;
	}
	
	
	if (image_counter == 6 || image_counter == 7 || image_counter == 8) {
		highlight_image = game_imag;
		blink_speed = 200;
	} else {
		highlight_image = high_imag;
	}
	change_image = eval( "document.image" + image_counter);
	change_image.src = highlight_image.src
	image_counter ++ ;
}

