var sequence = new Array();
var stopFlg = false;

function slideShow() {
    for (i = 0; i < sequence.length; i++) {
	var ptr = document.getElementById(sequence[i]);
	if (navigator.appName == 'Microsoft Internet Explorer') {
	    ptr.style.pixelLeft -= 1;
	    if (ptr.style.pixelLeft < -120) {
		ptr.style.pixelLeft += sequence.length * (120 + 5);
	    }
	} else {
	    ptr.style.left = parseInt(ptr.style.left) - 1 + "px";
	    if (parseInt(ptr.style.left) < -120) {
		ptr.style.left = parseInt(ptr.style.left) +
		    sequence.length * (120 + 5) + "px";
	    }
	}
    }
    if (stopFlg == false) {
	setTimeout("slideShow()", 20);
    }
}

function addSlide(id) {
    var ptr = document.getElementById(id);
    if (navigator.appName == 'Microsoft Internet Explorer') {
	ptr.style.pixelLeft = sequence.length * (120 + 5);
    } else {
	ptr.style.left = sequence.length * (120 + 5) + "px";
    }
    sequence[sequence.length] = id;
}

function stopShow() {
    stopFlg = true;
}

function startShow() {
    stopFlg = false;
    setTimeout("slideShow()", 20);
}

function fadeSlide(id) {
    var ptr = document.getElementById(id);
    if (navigator.appName == 'Microsoft Internet Explorer') {
	ptr.style.filter = 'alpha(opacity=50)';
    } else {
	ptr.style.MozOpacity = .5;
	ptr.style.opacity = .5;
    }
}

function restoreSlide(id) {
    var ptr = document.getElementById(id);
    if (navigator.appName == 'Microsoft Internet Explorer') {
	ptr.style.filter = 'alpha(opacity=100)';
    } else {
	ptr.style.MozOpacity = 1;
	ptr.style.opacity = 1;
    }
}

function moveLeft() {
    for (i = 0; i < sequence.length; i++) {
	var ptr = document.getElementById(sequence[i]);
	if (navigator.appName == 'Microsoft Internet Explorer') {
	    ptr.style.pixelLeft -= 850;
	    if (ptr.style.pixelLeft < -120) {
		ptr.style.pixelLeft += sequence.length * (120 + 5);
	    }
	} else {
	    ptr.style.left = parseInt(ptr.style.left) - 850 + "px";
	    if (parseInt(ptr.style.left) < -120) {
		ptr.style.left = parseInt(ptr.style.left) +
		    sequence.length * (120 + 5) + "px";
	    }
	}
    }
}

function moveRight() {
    for (i = 0; i < sequence.length; i++) {
	var ptr = document.getElementById(sequence[i]);
	if (navigator.appName == 'Microsoft Internet Explorer') {
	    ptr.style.pixelLeft += 850;
	    if (ptr.style.pixelLeft > (sequence.length - 1) * (120 + 5)) {
		ptr.style.pixelLeft -= sequence.length * (120 + 5);
	    }
	} else {
	    ptr.style.left = parseInt(ptr.style.left) + 850 + "px";
	    if (parseInt(ptr.style.left) > (sequence.length - 1) * (120 + 5)) {
		ptr.style.left = parseInt(ptr.style.left) -
		    sequence.length * (120 + 5) + "px";
	    }
	}
    }
}

