var arrayOfImages = ["BTT_Fase_1.jpg", "BTT_Fase_2.jpg"];
var image_duration = 1000;
var image_fade_duration = 2000;

function rotate(index)
{
	var w = document.getElementById("img_rotator").style.width;
	var h = document.getElementById("img_rotator").style.height;

	w = 860;
	h = 270;
    if(w < (document.body.offsetWidth - 262))
        w = (document.body.offsetWidth - 262);
	/*if (navigator.appName == "Microsoft Internet Explorer")
	{
		document.getElementById("img_rotator").style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=" + (image_fade_duration / 1000) + ",overlap=1.0)";
		document.getElementById("img_rotator").filters[0].Apply();
		document.getElementById("img_rotator").innerHTML = "<img id='slide_image' src='images/rotation/" + arrayOfImages[index] + "' width='" + w + "' height='" + h + "'>";
		document.getElementById("img_rotator").filters[0].Play();
	}
	else*/
	{
	    document.getElementById("img_rotator").innerHTML = "<img style='position: absolute' id='slide_image1' src='images/rotation/" + arrayOfImages[((index + 1) % arrayOfImages.length)] + "' width='" + w + "' height='" + h + "'><img style='position: absolute' id='slide_image' src='images/rotation/" + arrayOfImages[index] + "' width='" + w + "' height='" + h + "'>";
		setTimeout("fadeOut('slide_image', " + image_fade_duration + ")", image_duration);
	}
	
	setTimeout("rotate(" + ((index + 1) % arrayOfImages.length) + ")", image_duration + (2 * image_fade_duration));
}
