/* cycle images */

// set image id
var count = 0;
// loop transition
var element_id = 'rotatingTop';

function imagecycle(element_id)
{

		transition(element_id);

}

// call image load and fade
function transition(element_id)
{
	loadimage(element_id);
	setTimeout("Effect.Fade('"+element_id+"')",3000);
	setTimeout("imagecycle('"+element_id+"')",5000);
}



// swap images based on count
function loadimage(element_id)
{
	
	// get images from specified element id
	var images = document.getElementById(element_id).getElementsByTagName('img');

	for (var i=0;i<images.length;i++)
	{
		// set display if image is equal to id
		if(count == i)
		{
			images[i].style.display = 'block';
			Effect.Appear(""+element_id+"", { duration: 2.0 } );
		}
		else
		{
			images[i].style.display = 'none';
		}

	}
	// increment id
	count++;
	
	// if count increments higher than the ammount of images, reset to 0
	if(count == images.length) { count = 0; }
}

