var BGSTART = 01;
var BGEND   = 04;

var bg = BGSTART + Math.floor(Math.random() * (BGEND - BGSTART));
var numprepend;

if (bg < 04)
{
	if (bg < 10)
	{
		if (bg < 04) numprepend = "0";
		else numprepend=""; 
	}
	else numprepend="";
} 

var msg1 = '<img src="images/' + numprepend + bg + '.jpg" width="800" height="542" border="0" alt=""><br>';
document.writeln(msg1);

