var hideId;
function toggleGallery(elemId)
{
	var showme = document.getElementById(elemId);
	if ( hideId!=undefined )
		{var hideme = document.getElementById(hideId);}
	if ( showme.style.display != "block" )
		{
		if (hideId!=undefined)
			{hideme.style.display = 'none';}
		showme.style.display = 'block';
		hideId = elemId;
		}
	else if (showme.style.display != "none")
		showme.style.display = 'none';
}





var theId = 'one';
var hideIt;
var showIt;
var theDelay = 3500;


var opacityMax = 100;
var opacityMin = 0;
var steps = 48;
var theI = 1;

function slideShow()
	{
switch (theId)
{
	case 'one':		{hideIt = document.getElementById('slideone'); showIt = document.getElementById('slidetwo'); theId = 'two';}
		break;
	case 'two':		{hideIt = document.getElementById('slidetwo'); showIt = document.getElementById('slidethree'); theId = 'three';}
		break;
	case 'three':	{hideIt = document.getElementById('slidethree'); showIt = document.getElementById('slidefour'); theId = 'four';}
		break;
	case 'four':	{hideIt = document.getElementById('slidefour'); showIt = document.getElementById('slideone'); theId = 'one';}
		break;
	}
setTimeout('fadeOut();', theDelay);
}	

function fadeOut()
{
if (theI<steps)
	{hideIt.style.opacity = (opacityMax-(100/steps)*theI)/100;
	hideIt.style.filter = "alpha(opacity=" + (opacityMax-(100/steps)*theI) + ")";
	showIt.style.opacity = (opacityMin + (100/steps)*theI)/100;
	showIt.style.filter = "alpha(opacity=" + (opacityMin+(100/steps)*theI) + ")";
	theI++;
	setTimeout('fadeOut()', 50);
	}
else
	{hideIt.style.opacity = 0;
	hideIt.style.filter = "alpha(opacity=0)";
	showIt.style.opacity = 1;
	showIt.style.filter = "alpha(opacity=100)";
	theI = 1;
	slideShow();
	}
}
