function runSlideShow_1()
{
	backid = "PictureBack_1";
	imageid = "PictureBox_1";
	nextPic = d_1 + 1; if (nextPic > PictureCount_1) nextPic = 1;
	image = Picture_1[nextPic];

	fadelength = 2000;
	steps = 100;

	// Set Background Image To Match Foreground
	document.getElementById(backid).style.background = "url('"+document.getElementById(imageid).src+"')";
	
	// Set Foreground Opacity to Transparent
	setTimeout('setOpacity("'+imageid+'",0)',50);
	
	// Set Foreground to the next Picture
	setTimeout('document.getElementById(imageid).src = image',100);

	// Loop through changing the Opacity
	for(i = 0; i <= steps; i++)
	{
		opacity = i/steps * 100;
        setTimeout('setOpacity("'+imageid+'",'+opacity+')',((i*(fadelength/steps))+150));
    } 

	d_1++;
	if (d_1 > PictureCount_1) d_1=1;
	setTimeout('runSlideShow_2()', 5000);	
}


function runSlideShow_2()
{
	backid = "PictureBack_2";
	imageid = "PictureBox_2";
	nextPic = d_2 + 1; if (nextPic > PictureCount_2) nextPic = 1;
	image = Picture_2[nextPic];


	fadelength = 2000;
	steps = 100;

	// Set Background Image To Match Foreground
	document.getElementById(backid).style.background = "url('"+document.getElementById(imageid).src+"')";
	
	// Set Foreground Opacity to Transparent
	setTimeout('setOpacity("'+imageid+'",0)',50);
	
	// Set Foreground to the next Picture
	setTimeout('document.getElementById(imageid).src = image',100);

	// Loop through changing the Opacity
	for(i = 0; i <= steps; i++)
	{
		opacity = i/steps * 100;
        setTimeout('setOpacity("'+imageid+'",'+opacity+')',((i*(fadelength/steps))+150));
    } 

	d_2++;
	if (d_2 > PictureCount_2) d_2=1;
	setTimeout('runSlideShow_3()', 5000);	
}


function runSlideShow_3()
{
	backid = "PictureBack_3";
	imageid = "PictureBox_3";
	nextPic = d_3 + 1; if (nextPic > PictureCount_3) nextPic = 1;
	image = Picture_3[nextPic];

	fadelength = 2000;
	steps = 100;

	// Set Background Image To Match Foreground
	document.getElementById(backid).style.background = "url('"+document.getElementById(imageid).src+"')";
	
	// Set Foreground Opacity to Transparent
	setTimeout('setOpacity("'+imageid+'",0)',50);
	
	// Set Foreground to the next Picture
	setTimeout('document.getElementById(imageid).src = image',100);

	// Loop through changing the Opacity
	for(i = 0; i <= steps; i++)
	{
		opacity = i/steps * 100;
        setTimeout('setOpacity("'+imageid+'",'+opacity+')',((i*(fadelength/steps))+150));
    } 

	d_3++;
	if (d_3 > PictureCount_3) d_3=1;
	setTimeout('runSlideShow_1()', 5000);	
}

function setOpacity(id,value)
{
    document.getElementById(id).style.opacity = (value / 100);
    document.getElementById(id).style.MozOpacity = (value / 100);
    document.getElementById(id).style.KhtmlOpacity = (value / 100);
    document.getElementById(id).style.filter = "alpha(opacity=" + value + ")";
}


