flash_count = 0;
flash_limit = 2;
flash_timer = 400;

function flash_on() {
	document.getElementById('flash').className="flash_on";
	setTimeout("flash_off()", flash_timer)
}

function flash_off() {
	document.getElementById('flash').className="flash";
	if (flash_count < flash_limit) {
		flash_count++;
		setTimeout("flash_on()", flash_timer);
	}
}

function perform_flash() {
	if (flash_type != "error") { return; }
	flash_count = 0;
	if (!document.getElementById('flash')) { return; }
	setTimeout("flash_on()", flash_timer)
}

