// JavaScript Document
 $(document).ready(function(){ 
        $('#image_center').load(function () { 
			$(this).fadeIn(1000);
		
		}); 
		rotate();
    }); 
	
jQuery.fn.delay = function(time,func){
    return this.each(function(){
        setTimeout(func,time);
    });
};
function rotate(){
	
	setInterval('ruota()',4000);
	}
	function ruota() {
	
	foto = new Array(); foto [0]="1.jpg";foto [1]="2.jpg";foto [2]="3.jpg";foto [3]="4.jpg";foto [4]="5.jpg";
	i=parseInt(document['button'].getAttribute("rel"),5) + 1;
	
	i=i % 5;
	
		
	$('#image_center').fadeOut(1000);
	
	$('#image_center').delay(1000, function(){
		$('#image_center').load(function () { 
				 
				$(this).fadeIn(1000);
		
		});
		document['button'].src='images/index/' + foto[i];
	});	 
	
	document['button'].setAttribute('rel',i);
	}
	function movepic(img_name,img_src) {
	document[img_name].src=img_src;
}

