function slideSwitch() {
	
	var active = $('.mainpage_animation_images .active');
	if ( active.length == 0 ) active = $('.mainpage_animation_images IMG:last');
	
	// use this to pull the images in the order they appear in the markup
	var next =  active.next().length ? active.next() : $('.mainpage_animation_images IMG:first');

	active.addClass('last-active');
	
	next.css({opacity: 0.0})
		.addClass('active')
		.delay(slideDelay+200)
		.animate({opacity: 1.0}, animTime,
		function() {
			//alert('jebu	');
			//alert("slideDelay "+slideDelay);
			slideDelay = 1000;
			active.removeClass('active last-active');
			$(".mainpage_animation_images").append(active);
			slideSwitch();
		}
	);
	
	
}

var slideDelay = 1500;
var animTime = 2000;



//$(document).ready(function(){
/*$(function() {
	
	slideSwitch();
		
});*/
