//scriptaculous image switch

//find image block
var image = document.getElementById('rotateImage');
//alert(image);
var i = 2;

function switchImage() {

    if (i > 4) {
        i = 1;
    }

    //if image 1 then fade the image out
    Effect.Fade('rotateImage');

    //change the src to next image
    a = i + 1;
    setTimeout("image.src = 'images/rotate" + i + ".jpg'",1000);

    //fade new image back in
    setTimeout("Effect.Appear('rotateImage')",2000);

    i = i + 1;

    //repeat continuously
    setTimeout("switchImage()",8000);
}

