var timer = ''; 
var count = '';
var delay = 10000;
var pos = '';

$(document).ready(function() {
	count = $('.banner_item').length;
	timer = setTimeout("change()", delay);
});

function change() {
	$(".banner_item").each(function() {
		if ($(this).css('z-index') == 10000 + parseInt(count)) {
			$(this).css('z-index', 10001);
		} else {
			$(this).css('z-index', parseInt($(this).css('z-index')) + 1)
		}
	});
	
	$(".banner_item:eq(0)").fadeOut(1500, function() {
		$(".banner_item:eq(0)").css('display', 'block');
		$("#banner").append($(".banner_item:eq(0)").clone());
		$(".banner_item:eq(0)").remove();
	});	
	
	timer = setTimeout("change()", delay);
}
