function showRemote(url) {
	self.name = "Parent_Window"; 

	var newWindow = "scrollbars,resizable,width=300,height=400,left=50,top=25";
	var openWindow = window.open(url, "remote", newWindow);
	openWindow.value = 1;
	openWindow.focus();
	return false;
}

var timeElapse;
var saveElapse;

function showMenu(previous, index, next) {
	var url = self.location.pathname;
	timeElapse = self.location.search.substring(7,self.location.search.length);
	saveElapse = self.location.search.substring(1,self.location.search.length);
	var defaultElapse = 4;
	if (timeElapse > 0) {
		document.write('<span id="second_read_text">back</span>');
		document.write('<span id="second_read_text"> | index</span>');
		document.write('<span id="second_read_text"> | next</span>');
		document.write(' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;');
		var slowElapse = new Number(timeElapse) + 1;
		var fastElapse = new Number(timeElapse) - 1;
		document.write('<a href="' + url + '?pause=' + slowElapse + '">slower</a> | ');		
		document.write('<a href="' + url + '?' + timeElapse + '">stop</a> | ');		
		if (fastElapse > 0) {
			document.write('<a href="' + url + '?pause=' + fastElapse + '">faster</a>');
		} else {
			document.write('<span id="second_read_text">faster</span>');
		}		
	} else {
		document.write('<a href="' + previous + '">back</a>');
		document.write(' | <a href="' + index + '">index</a>');
		document.write(' | <a href="' + next + '">next</a>');
		document.write(' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;');
		if (saveElapse > 0) {
			document.write('<a href="' + url + '?pause=' + saveElapse + '">restart slide show</a>');
		} else {
			document.write('<a href="' + url + '?pause=' + defaultElapse + '">start slide show</a>');	
		}
	}
}

function setTimer(next) {
	if (timeElapse > 0) {
		if (document.image.complete) {
			setTimeout("nextSlide('" + next + "')", timeElapse * 1000 - 990);
		}
	}
}

function nextSlide(next) {
	document.location = next + "?pause=" + timeElapse;
}
