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 = 100;
var theI = 1;

function slideShow()
	{
switch (theId)
{
	case 'one':		{hideIt = document.getElementById('one'); showIt = document.getElementById('two'); theId = 'two';}
		break;
	case 'two':		{hideIt = document.getElementById('two'); showIt = document.getElementById('three'); theId = 'three';}
		break;
	case 'three':	{hideIt = document.getElementById('three'); showIt = document.getElementById('four'); theId = 'four';}
		break;
	case 'four':	{hideIt = document.getElementById('four'); showIt = document.getElementById('one'); 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();
	}
}
/*
var theId = 'one';
var hideIt = null;
var theDelay = 6000;


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

function slideShow()
	{
	changeSlide();
	}
	
function changeSlide()
	{
switch (theId)
{
	case 'one':		hideIt = 'one'; showIt = 'two'; theId = 'two';
		break;
	case 'two':		hideIt = 'two'; showIt = 'three'; theId = 'three';
		break;
	case 'three':	hideIt = 'three'; showIt = 'four'; theId = 'four';
		break;
	case 'four':	hideIt = 'four'; showIt = 'one'; theId = 'one';
		break;
	}
}	

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