function slideshowSetup(parentId,speed)
{
	var parent=document.getElementById(parentId);

	if(!parent)
	{
		return;
	}

	parent.private_ActiveChild=parent.firstChild;
	while(parent.private_ActiveChild.nodeName[0]=='#')
	{
		parent.private_ActiveChild=parent.private_ActiveChild.nextSibling;
	}
	parent.private_ActiveChild.private_Direction=1;
	parent.private_FadeSpeed=speed;
	

	for(var i=parent.firstChild; i; i=i.nextSibling)
	{

		if(i.nodeName[0]=='#')continue;
		i.style.opacity=0;
		i.style.filter="alpha(opacity=0)";
	}
	parent.private_ActiveChild.style.opacity=1;
	parent.private_ActiveChild.style.filter="alpha(opacity=0)";

	return setInterval('slideshowFader("' + parentId + '")',25);
}
function slideshowFader(parentId)
{
	var parent = document.getElementById(parentId);

	var activechild = parent.private_ActiveChild;
	var speed = parseFloat(parent.private_FadeSpeed);
	if(activechild.private_Direction > 0)
	{
		var fading=parseFloat(activechild.style.opacity);
		fading+=speed;
		if(fading>=1)
		{
			fading=1;
			activechild.private_Direction=0;
			activechild.private_Timeout=10;
		}
		activechild.style.opacity=fading;
		activechild.style.filter="alpha(opacity="+fading*100+")";
	}
	else
	if(activechild.private_Direction == 0)
	{
		activechild.private_Timeout-=speed;
		if(activechild.private_Timeout <= 0)
		{
			activechild.private_Direction=-1;
		}
	}
	else
	if(activechild.private_Direction == -1)
	{
		var fading=parseFloat(activechild.style.opacity);
		fading-=speed;

		activechild.style.opacity=fading;
		activechild.style.filter="alpha(opacity="+fading*100+")";


		if(fading<=0)
		{
			fading=0;

			do
			{
				activechild=activechild.nextSibling;

				if(!activechild)
				{
					activechild=parent.firstChild;
				}
			} while (activechild.nodeName[0]=='#');
			activechild.private_Direction=1;

		}
	}
	parent.private_ActiveChild=activechild;
}


