/************************************************************************************/
var timeout;
var current_div;
function flash( message )
{
	window.clearTimeout(timeout);
	current_div = get("div_flash");
	current_div.innerHTML = message;
	current_div.className = "on";
	timeout = window.setTimeout("hide_flash()",4000);
}
function hide_flash()
{
	//fade the message out:
	window.setTimeout("fade_out(10)", 10);
}
function fade_out(opacity)
{
	if ( opacity > 0 )
	{
		opacity = (opacity - .5);
		current_div.style.opacity = opacity/10;
		current_div.style.filter = 'alpha(opacity=' + opacity*10 + ')';
		window.setTimeout("fade_out(" + opacity + ");",50);
	}
	else
	{
		current_div.style.opacity = 1;
		current_div.style.filter = 'alpha(opacity=100)';
		current_div.className = "off";
	}
}
