/* 
   slides menu
   copyright (c) 2002 by Mark Justice Hinton
   mark@mjhinton.com 
*/

function stopError( msg ) {

if ( location.protocol == "file:" ) status = msg; // only in IE
return true;

}

window.onerror = stopError; //no parentheses


if ( location.search ) {
parts = location.search.split(";");
parts[0] = parts[0].substring(1,parts[0].length);

for (x=0;x<parts.length;x++) {
eval(parts[x]);
}
}


if ( typeof(picture) == "undefined" ) picture = "bosque/bosque";

if ( typeof(start) == "undefined" ) start = 1;
if ( typeof(stop)  == "undefined" ) stop = 15;

slideSeq = start; // was 0;
timer = 0;

thumb = new Array(); // resize to 100x75 75x100
slide = new Array(); // resize to 533x400 300x400
caption = new Array();

for (n=1; n<=stop; n++) {
thumb[n] = new Image();
thumb[n].src = picture + "t (" + n + ").jpg";
slide[n] = new Image();
slide[n].src = picture + " (" + n + ").jpg";
caption[n] = picture + " (" + n + ").htm";
}

function changeSlide( x ) {
if ( slideSeq >= start ) slideSeq = slideSeq + x;
if ( slideSeq == slide.length || slideSeq == stop+1 ) slideSeq = start;
if ( slideSeq == start-1 ) slideSeq = slide.length - 1;

if ( slide[slideSeq].complete ) {
slideFrame.location = slide[slideSeq].src;
document.slideControls.displayMsg.value = + (slideSeq-start+1) + " of " + (stop-start+1) + " pictures";

textFrame.location = caption[slideSeq];
} else if ( thumb[slideSeq].complete ) {
slideFrame.location = thumb[slideSeq].src;
document.slideControls.displayMsg.value = "loading # " + slideSeq + "...";
} else {
slideFrame.location = "wait.htm";
document.slideControls.displayMsg.value = "loading # " + slideSeq + "...";
}
}

function autoPlay() {

duration = document.slideControls.seconds.value;
(duration > 0 && duration < 60) ? duration = duration * 1000 : duration = 15000;
changeSlide(1)
timer = window.setTimeout ( "autoPlay()", duration );
}

function stopPlay() {

window.clearTimeout ( timer );

}

function woops() {
	textFrame.location = "copyright.htm";
}