window.addEvent('domready',function() {
	/* settings */
	var showDuration = 4000;
	var container = $('slideshow-container1');
	if(container)
	{
		var images = container.getElements('img');
		var currentIndex = 0;
		var interval;
		images.each(function(img,i){ 
			if(i > 0)
			{
				img.set('opacity',0);
			}
		});
		var show = function() {
			if(images[currentIndex])
			{
				images[currentIndex].fade('out');
				images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].fade('in');
				temp = images[currentIndex].title.split("##");
				$('slideshow_link_1').href= temp[1];
			}
		};
		/* start once the page is finished loading */
		window.addEvent('load',function(){
			interval = show.periodical(showDuration);
		});
	}
});

window.addEvent('domready',function() {
	/* settings */
	var showDuration = 4000;
	var container = $('slideshow-container2');
	if(container)
	{
		var images = container.getElements('img');
		var currentIndex = 0;
		var interval;
		images.each(function(img,i){ 
			if(i > 0)
			{
				img.set('opacity',0);
			}
		});
		var show = function() {
			if(images[currentIndex])
			{
				images[currentIndex].fade('out');
				images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].fade('in');
				temp = images[currentIndex].title.split("##");
				$('slideshow_link_2').href= temp[1];
			}
		};
		/* start once the page is finished loading */
		window.addEvent('load',function(){
			interval = show.periodical(showDuration);
		});
	}
});

window.addEvent('domready',function() {
	/* settings */
	var showDuration = 4000;
	var container = $('slideshow-container3');
	if(container)
	{
		var images = container.getElements('img');
		var currentIndex = 0;
		var interval;
		images.each(function(img,i){ 
			if(i > 0)
			{
				img.set('opacity',0);
			}
		});
		var show = function() {
			if(images[currentIndex])
			{
				images[currentIndex].fade('out');
				images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].fade('in');
				temp = images[currentIndex].title.split("##");
				$('slideshow_link_3').href= temp[1];
			}
		};
		/* start once the page is finished loading */
		window.addEvent('load',function(){
			interval = show.periodical(showDuration);
		});
	}
});

window.addEvent('domready',function() {
	/* settings */
	var showDuration = 4000;
	var container = $('slideshow-container4');
	if(container)
	{
		var images = container.getElements('img');
		var currentIndex = 0;
		var interval;
		images.each(function(img,i){ 
			if(i > 0)
			{
				img.set('opacity',0);
			}
		});
		var show = function() {
			if(images[currentIndex])
			{
				images[currentIndex].fade('out');
				images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].fade('in');
				temp = images[currentIndex].title.split("##");
				$('slideshow_link_4').href= temp[1];
			}
		};
		/* start once the page is finished loading */
		window.addEvent('load',function(){
			interval = show.periodical(showDuration);
		});
	}
});

window.addEvent('domready',function() {
	/* settings */
	var showDuration = 4000;
	var container = $('slideshow-container5');
	if(container)
	{
		var images = container.getElements('img');
		var currentIndex = 0;
		var interval;
		images.each(function(img,i){ 
			if(i > 0)
			{
				img.set('opacity',0);
			}
		});
		var show = function() {
			if(images[currentIndex])
			{
				images[currentIndex].fade('out');
				images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].fade('in');
				temp = images[currentIndex].title.split("##");
				$('slideshow_link_5').href= temp[1];
			}
		};
		/* start once the page is finished loading */
		window.addEvent('load',function(){
			interval = show.periodical(showDuration);
		});
	}
});

