var current_pos=0;
var timeout=10000;
var img_path='bannery/';
var banners=[];

function setNewBanner()
{
	var next_pos=current_pos+1;
	if(typeof banners[next_pos]=='undefined')
	next_pos=0;
	
	$('#'+banners[current_pos]).fadeOut('slow');
	$('#'+banners[next_pos]).fadeIn('slow');
	current_pos=next_pos;
}

$(document).ready(function()
{
	var i=0;
	$('img.banner').each(function()
	{
		banners[i]=$(this).attr('id');
		i++;
	});
	
	if(i>1) setInterval("setNewBanner()",timeout);
});
