
var global_fadeout_elm;
var global_fadeout_count = 0;

function fadeout(elm){
	global_fadeout_elm = document.getElementById(elm);
	global_fadeout_elm.style.backgroundColor = '#ffff00';
	window.setTimeout('fadeout_do()', 500);
}

function fadeout_do(){
	global_fadeout_count++;

	var color;

	if (global_fadeout_count == 0){ color = '#ffff00'; }
	if (global_fadeout_count == 1){ color = '#ffff33'; }
	if (global_fadeout_count == 2){ color = '#ffff66'; }
	if (global_fadeout_count == 3){ color = '#ffff99'; }
	if (global_fadeout_count == 4){ color = '#ffffcc'; }
	if (global_fadeout_count == 5){ color = '#ffffff'; }

	global_fadeout_elm.style.backgroundColor = color;

	if (global_fadeout_count < 5){
		window.setTimeout('fadeout_do()', 300);
	}
}

function link_open(id){
	document.getElementById('link-'+id+'-open').style.display = 'none';
	document.getElementById('link-'+id+'-close').style.display = 'inline';
	document.getElementById('link-'+id+'-extra').style.display = 'block';
	return false;
}

function link_close(id){
	document.getElementById('link-'+id+'-open').style.display = 'inline';
	document.getElementById('link-'+id+'-close').style.display = 'none';
	document.getElementById('link-'+id+'-extra').style.display = 'none';
	return false;
}


function show_history_item(name){
	document.getElementById(name+'header').style.display = 'none';
	document.getElementById(name+'body').style.display = 'block';
}

function hide_history_item(name){
	document.getElementById(name+'header').style.display = 'block';
	document.getElementById(name+'body').style.display = 'none';
}

function somehtml(show){
	document.getElementById('somehtmlshow').style.display = show ? 'none' : 'block';
	document.getElementById('somehtmlhide').style.display = show ? 'block' : 'none';
	document.getElementById('somehtml').style.display = show ? 'block' : 'none';
	return true;
}

