var pics = new Array(
'/Im/dinamic/1.jpg',
'/Im/dinamic/2.jpg',
'/Im/dinamic/3.jpg',
'/Im/dinamic/4.jpg',
'/Im/dinamic/5.jpg',
'/Im/dinamic/6.jpg'
);

function rotate() 
{
	rotatepics('im1',0,0);
	window.setTimeout("rotatepics('im2',2,0)",2000);
	window.setTimeout("rotatepics('im3',4,0)",4000);
	preloadimgs();
}

function rotatepics(obj, i, doSw) 
{
	
	var new_i = i % 2 ? i-1 : i+1;

	window.setTimeout("rotatepics('"+obj+"', "+new_i+",0)", 6000);


	getElem(obj).src=pics[i];
}



function getElem(id) 
{
	if (document.getElementById)
		return document.getElementById(id);
	else
		return document.all(id);
}



function preloadimgs() 
{

		var arr=pics;
		for (j=0; j<arr.length; j++) 
			{
			im = new Image();
			im.src = arr[j];
			}
		
}

