function runPortal(){
    var portal = document.getElementById('image_rotator'); // represents the div that holds the images
	var thumbs = portal.getElementsByTagName('img'); // represents all the images within the div that will be rotated
    
    if (thumbs.length==1) {
		return;
	}
    
    // Hide everything
	for (var i=0;i<thumbs.length;i++) {
		if (i == (thumbs.length - 1)) {
			continue;
		}
		thumbs[i].style.display = 'none';
	}
       
	// Set up the image rotator
	var rotator = new PeriodicalExecuter(nextImage, 4);
	rotator.i = 0;
	rotator.last= (thumbs.length - 1);
	rotator.thumbs = thumbs;
}
 
function nextImage(){
    if (this.i == this.thumbs.length){
        this.i = 0;
    }
     	   	
    Effect.Fade(this.thumbs[this.last].id, { duration: 0.5, from: 1, to: 0 });
    Effect.Appear(this.thumbs[this.i].id, { duration: 0.5 });

    this.last = this.i;
    this.i++;
}

