// JavaScript Document
pos_num = 5;
set_num = 3;
img_id  = "slide";
img_prefix = "images/balloon_";
img_suffix = ".png";
function slide_run()
{
	var pos_random = rand(pos_num - 1)+1; // 1->pos_num
	var set_random = rand(set_num - 1)+1; // 1->set_num

	newpict_src = img_prefix+pos_random+set_random+img_suffix;

	if (document.all)
	{
		var transVal = "blendTrans(Duration=1)";
		var transStr = "blendTrans";
		eval("document.images." + img_id + pos_random + ".style.filter='" + transVal + "';");
		eval("document.images." + img_id + pos_random + ".filters." + transStr + ".Apply();");
	}
	eval("document.images." + img_id + pos_random + ".src='" + newpict_src + "';");
	//if (document.all) eval("document.images." + img_id + pos_random + ".filters." + transStr + ".Play();");
	
	setTimeout("slide_run()", 2500);
}


function preload_slides()
{
	for (i = 1; i <= pos_num; i++)
	{
		for (j = 1; j <= set_num; j++)
		{
			MM_preloadImages(img_prefix + i + j + img_suffix);
		}
	}
}


function rand(num)
{
	return Math.round(Math.random() * num);
}

function initslides()
{
	preload_slides();
	setTimeout("slide_run()", 2500);
}
