function setup_rotate() {
	var rotator = document.getElementById('image_rotator');
	var images = 0;

	for (var i=0;i < rotator.childNodes.length; i++) {
//		if (rotator.childNodes[i].tagName == 'DIV') {
		if (rotator.childNodes[i].tagName == 'IMG') {
			document.getElementById(rotator.childNodes[i].id).style.display = 'none';
			// in case non img tags are in it for some reason
			images++;
		}
	}
//	rotate(rotator.childNodes.length, rotator.childNodes.length);
	// less one to cope with starting at 0
	images--;
	rotate(images, images);
}

function rotate(current, total) {
	if (current == total) {
		var next = 0;
	} else {
		var next = current + 1;
	}
//alert(current + ' ' + next + ' ' + total);

	//fade current show next
	var rotator = document.getElementById('image_rotator');
	var images = 0;
	for (var i=0;i < rotator.childNodes.length; i++) {
		if (rotator.childNodes[i].tagName == 'IMG') {
			if (images == current) {
				Effect.Fade(rotator.childNodes[i].id);
			}
			if (images == next) {
				Effect.Appear(rotator.childNodes[i].id);
			}
			images++;
		}
	}

	setTimeout("rotate(" + next + ", " + total + ")", 5000);
}

