adImages = new Array("images/pic1.jpg","images/pic2.jpg","images/pic3.jpg","images/pic4.jpg")
imgCt = adImages.length
firstTime = true

function rotate() {
	if (document.images) {
        if (firstTime) {
            thisAd = Math.floor((Math.random() * imgCt))
            firstTime = false
        }
        else {
            thisAd++
            if (thisAd == imgCt) {
                thisAd = 0
            }
        }
        document.myPicture.src=adImages[thisAd]
        setTimeout("rotate()", 3 * 1000)
	}
 }
