var cf1;
var cf2;
var cf3;
var cf4;

var selectorGroup01 = new Array
(
	'image-01',
	'image-02',
	'image-03'
);

var selectorGroup02 = new Array
(
	'image-05',
	'image-06',
	'image-07'
);

var selectorGroup03 = new Array
(
	'image-09',
	'image-10',
	'image-11'
);

var selectorGroup04 = new Array
(
	'image-13',
	'image-14',
	'image-15'
);

startSlideshow1 = function()
{
	cf1 = new Crossfader
	(
		selectorGroup01,
		500,   // transition speed
		8000,  // pause
		true
	);
}

startSlideshow2 = function()
{
	cf2 = new Crossfader
	(
		selectorGroup02,
		500,   // transition speed
		8000,  // pause
		true
	);
}

startSlideshow3 = function()
{
	cf3 = new Crossfader
	(
		selectorGroup03,
		500,   // transition speed
		8000,  // pause
		true
	);
}

startSlideshow4 = function()
{
	cf4 = new Crossfader
	(
		selectorGroup04,
		500,   // transition speed
		8000,  // pause
		true
	);
}

initSlideshow = function()
{
	startSlideshow1();
	window.setTimeout("startSlideshow2()",1000);
	window.setTimeout("startSlideshow3()",2000);
	window.setTimeout("startSlideshow4()",3000);
		
	$("top-left").observe
	(
		"mouseover",function()
		{
			Stop(cf1);	
		}
	);
	
	$("top-left").observe
	(
		"mouseout",function()
		{
			Start(cf1);	
		}
	);
	
	$("top-right").observe
	(
		"mouseover",function()
		{
			Stop(cf2);	
		}
	);
	
	$("top-right").observe
	(
		"mouseout",function()
		{
			Start(cf2);	
		}
	);
	
	$("bottom-left").observe
	(
		"mouseover",function()
		{
			Stop(cf3);	
		}
	);
	
	$("bottom-left").observe
	(
		"mouseout",function()
		{
			Start(cf3);	
		}
	);
	
	$("bottom-right").observe
	(
		"mouseover",function()
		{
			Stop(cf4);	
		}
	);
	
	$("bottom-right").observe
	(
		"mouseout",function()
		{
			Start(cf4);	
		}
	);
}

Stop = function(selectorGroup)
{
	selectorGroup.StopFade();
}

Start = function(selectorGroup)
{
	selectorGroup.StartFade();
}

document.observe("dom:loaded",initSlideshow);
	
document.observe("dom:loaded",function()
{
	//preLoadImages();
	new Rollover('top-left',
	{
		suffixSeperator: '-',
		rolloverSuffix: 'hover',
		extension: '.gif'
	});
	new Rollover('top-right',
	{
		suffixSeperator: '-',
		rolloverSuffix: 'hover',
		extension: '.gif'
	});
	new Rollover('bottom-left',
	{
		suffixSeperator: '-',
		rolloverSuffix: 'hover',
		extension: '.gif'
	});
	new Rollover('bottom-right',
	{
		suffixSeperator: '-',
		rolloverSuffix: 'hover',
		extension: '.gif'
	});
});