/**
 * @author Richard Danek
 */
var imgcount = 0;


function run()
{
	switch_img();
}

$(document).ready(function(){
	imgcount = $("div.image_cycle img").size();
	if (imgcount > 1)
		run_timer();
});



function switch_img()
{	
	next = $("div.image_cycle img.show").next("img");
	if (next.get(0) == undefined) {
		next = $("div.image_cycle img:first");
	}
	$("div.image_cycle img.show").fadeOut(1000, function(){ 
		$(this).removeClass('show');					
	});
	next.fadeIn(2000, function(){ 
		$(this).addClass('show');
	});
}

function run_timer()
{
	timer = setInterval('run()', 4000);
}


