Code:
bmap screen_fade = <black_total.pcx>;	
panel fade_pan
{
	bmap = screen_fade;
	pos_x = 0;
	pos_y = 0;
	layer = 10;
	flags = refresh,d3d;
}

function fade_in()
{
	bmap_for_screen(screen_fade,1,0);
	fade_pan.bmap = screen_fade;
	//Now show the screenshot:
	fade_pan.alpha = 100;
	fade_pan.visible = on;
	wait(5);
	//Now fade the screenshot out:
	fade_pan.transparent = on;

	while(fade_pan.alpha > 0)
	{
		fade_pan.alpha -= 10*time_step;
		wait(1);
	}
	fade_pan.visible = off;
} 


Place this function before the panel you wish to fade into.