var retimr="false"; 
var ldr="false";
var sson="false"; 
var fpix=0;
var fpixold=0;
var preldr="0"; 
var secs=0;
var pixstart=0;
var pausln=5;                             //number of seconds that program pauses on photo after loading

function dater(i) {
for (j=1;j<pixspots.length;j++) {if (i>pixspots[j-1]-1&&i<pixspots[j]) {return entries[j-1]}};
if(i<pixspots[1]) {return entries[0]};
if(i>pixspots[pixspots.length-1]-1) {return entries[pixspots.length-1]};
}

function setrsec(form) {var formindex=form.rsec1.selectedIndex;
var e=form.rsec1.options [formindex].value;
pausln=e}

function timr() {secs++;retimr=setTimeout("timr()",1000);}
timr();

function ssrp(){document.ssbut.ssface.value="Starting...";sson="true";
document.stopt.stopface.value="Stop";preld();}

function preld() {secs=0;
if(rndmpix=="yes") {fpixold=fpix;fpix=Math.round(0.499999+nslide*Math.random())} else {fpix=fpix+1};
if(fpix>nslide) {fpix=pixstart};
preldr=foldr+"/"+fpix+".jpg";
document.ssbut.ssface.value="Loading "+fpix+".jpg";
imagez = new Image();imagez.src = preldr;
imagez.onLoad=ldchk();}

function ldchk() {
 if(sson=="false") {stopd(); return true;}
  else {if (!imagez.complete) {ldr=setTimeout("ldchk()",100);} else {pauzr();} }  }

function pauzr() {
 if(sson=="false") {stopd(); return true;}
  else {if(secs<pausln) {document.ssbut.ssface.value="Pausing "+secs+" sec."; repzr=setTimeout("pauzr()",100);} 
         else {document.photox.src=preldr; document.namd.namex.value="File = "+preldr; document.datr.datx.value="From "+dater(fpix); preld();}  }  }

function stopd() {clearTimeout("ldr"); clearTimeout("repzr");
document.ssbut.ssface.value="Start Slide Show";document.stopt.stopface.value="Off";sson="false";return true;}

function seq() {if(rndmpix=="yes") {stopd();document.rander.randa.value="Change Mode (Sequential)";rndmpix="no";fpix=fpixold;ssrp();
} else {stopd();document.rander.randa.value="Change Mode (Random)";rndmpix="yes";ssrp();}
}

function mover() {if(rndmpix=="yes") {seq()};
stopd();
for (var j=0; j<pixspots.length; j++) 
{if(document.myd.snPageName.options[document.myd.snPageName.selectedIndex].value==j)fpix=pixspots[j]-1};
ssrp();
}


function wrtr() {

document.write('<table padding=0 margin=0 border=0 bgcolor="#000000"><tr><td valign=top>');
document.write('<table width=165 height=135 padding=0 margin=0 border=0 BorderColor="#000000" bgcolor="#000000">');
document.write('<tr height=25><td valign=top>');

document.write('<center><table width=160 padding=0 margin=0 border=0 bgcolor="#000000"><tr><td>');
document.write('<form name="ssbut" style="margin-left:0px; margin-right:0px; padding:0px; border:0px; margin:0px; display:inline">');
document.write('<INPUT name="ssface" type="button" value="Start Slide Show" ');
document.write('STYLE="FONT-SIZE: 12px; WIDTH: 120; background-color: rgb(255,255,0); cursor:hand" OnClick="ssrp()" ');
document.write('onMouseOver="this.style.backgroundColor=\'#FF00FF\';');
document.write('window.status=\'Click to start show; button will provide info during show\';return true" ');
document.write('onMouseOut="this.style.backgroundColor=\'rgb(255,255,0)\';window.status=\'\';return true"></form></td>');

document.write('<td valign=top><form name="stopt" style="margin-bottom:0px; padding: 0px; border:0px; margin:0px; display:inline">');
document.write('<INPUT name="stopface" type="button" value="Off" ');
document.write('STYLE="FONT-SIZE: 12px; WIDTH: 31; background-color: rgb(255,255,0); cursor:hand" OnClick="stopd()" ');
document.write('onMouseOver="this.style.backgroundColor=\'#FF00FF\';window.status=\'When running, stops the show\';return true" ');
document.write('onMouseOut="this.style.backgroundColor=\'rgb(255,255,0)\';window.status=\'\';return true">');
document.write('</form></td></tr></table></center></td></tr>');

document.write('<tr height=25><td valign=top><center>');
document.write('<form name="rander" style="margin-left:0px; margin-right:0px; padding:0px; border:0px; margin:0px; display:inline">');
document.write('<INPUT name="randa" type="button" value="Change Mode (Random)" ');
document.write('STYLE="FONT-SIZE: 12px; WIDTH: 155; background-color: rgb(255,255,0); cursor:hand" OnClick="seq()" ');
document.write('onMouseOver="this.style.backgroundColor=\'#FF00FF\';');
document.write('window.status=\'Click to make the pictures be chosen either randomly or sequentially\';return true" ');
document.write('onMouseOut="this.style.backgroundColor=\'rgb(255,255,0)\';window.status=\'\';return true"></form>');
document.write('</td></tr>');

document.write('<tr height=25><td valign=top><center>');
document.write('<FORM NAME="myd" style="display: inline">');
document.write('<SELECT NAME="snPageName" size=1 ');
document.write('STYLE="FONT-SIZE: 12px; WIDTH: 155; background-color: rgb(255,255,0); cursor:hand" ');
document.write('OnChange="mover(myd)" ');
document.write('onMouseOver="this.style.backgroundColor=\'#FF00FF\';');
document.write('window.status=\'Click to start at another point\';return true" ');
document.write('onMouseOut="this.style.backgroundColor=\'rgb(255,255,0)\';window.status=\'\';return true">');
// document.write('<OPTION SELECTED VALUE=0>'+entries[0]+'</option>');
for (var i=0; i<pixspots.length; i++) 
{document.write('<OPTION VALUE='+i+'>'+entries[i]+'</option>')};
document.write('</SELECT></td></tr></FORM>');

document.write('<tr height=25><td valign=top><center>');
document.write('<FORM NAME="rsec" style="display: inline">');
document.write('<SELECT NAME="rsec1" SIZE=1 ');
document.write('STYLE="FONT-SIZE: 12px; WIDTH: 155; background-color: rgb(255,255,0); cursor:hand" ');
document.write('OnChange="setrsec(rsec)" ');
document.write('onMouseOver="this.style.backgroundColor=\'#FF00FF\';');
document.write('window.status=\'Change the time pictures display\';return true" ');
document.write('onMouseOut="this.style.backgroundColor=\'rgb(255,255,0)\';window.status=\'\';return true">');
document.write('<OPTION VALUE=1>1 Second Pause</option>');
document.write('<OPTION VALUE=2>2 Second Pause</option>');
document.write('<OPTION VALUE=3>3 Second Pause</option>');
document.write('<OPTION VALUE=4>4 Second Pause</option>');
document.write('<OPTION SELECTED VALUE=5>5 Second Pause</option>');
document.write('<OPTION VALUE=6>6 Second Pause</option>');
document.write('<OPTION VALUE=7>7 Second Pause</option>');
document.write('<OPTION VALUE=8>8 Second Pause</option>');
document.write('<OPTION VALUE=9>9 Second Pause</option>');
document.write('<OPTION VALUE=10>10 Second Pause</option>');
document.write('<OPTION VALUE=15>15 Second Pause</option>');
document.write('<OPTION VALUE=20>20 Second Pause</option>');
document.write('<OPTION VALUE=30>30 Second Pause</option>');
document.write('</SELECT>');
document.write('</td></tr></form>');

document.write('<tr  height=25><td valign=top><center>');
document.write('<form name="namd" style="margin-bottom:0px; padding: 0px; border:0px; margin:0px; display: inline">');
document.write('<INPUT name="namex" type="button" value="File = 0.jpg"');
document.write('STYLE="FONT-SIZE: 12px; WIDTH: 155; color: rgb(255,255,0); text-align:center; background-color: rgb(0,0,0); ');
document.write('border-color: 000000; border-style: inset; border-width: 0px; cursor:crosshair" ');
document.write('onMouseOver="window.status=\'This spot gives the picture location.\';return true"'); 
document.write('onMouseOut="window.status=\'\';return true"></form></center></td></tr>');

document.write('<tr  height=25><td valign=top><center>');
document.write('<form name="datr" style="margin-bottom:0px; padding: 0px; border:0px; margin:0px; display: inline">');
document.write('<INPUT name="datx" type="button" value="From ',dater(0),'"');
document.write('STYLE="FONT-SIZE: 12px; WIDTH: 155; color: rgb(255,255,0); text-align:center; background-color: rgb(0,0,0); ');
document.write('border-color: 000000; border-style: inset; border-width: 0px; cursor:crosshair" ');
document.write('onMouseOver="window.status=\'This spot gives the picture date.\';return true"'); 
document.write('onMouseOut="window.status=\'\';return true"></form></center></td></tr>');

if(hmpg!=""){
document.write('<tr height=25><td valign=top><center><form name="mcafee" style="margin-bottom:0px; padding: 0px; border:0px; margin:0px; display: inline">');
document.write('<INPUT name="mcafex" type="button" value="');
document.write(hmtxt+'" STYLE="FONT-SIZE: 12px; WIDTH: 155; background-color: rgb(255,255,0); cursor:hand" OnClick="top.location=\'');
document.write(hmpg+'\'" onMouseOver="this.style.backgroundColor=\'#FF00FF\';window.status=\'Visit the Homepage\';return true" ');
document.write('onMouseOut="this.style.backgroundColor=\'rgb(255,255,0)\';window.status=\'\';return true"></form></center></td></tr>')};

document.write('<tr height=25><td valign=middle><font STYLE="font-family: Arial, times new roman; font-weight:normal; color:#FFFF00; font-size: 12px"><center>There are ',nslide,' pictures.</center></td></tr>');
document.write('<tr height=25><td valign=bottom><font STYLE="font-family: Georgia, times new roman; font-weight:normal; color:#000000; font-size: 10px"><center>Copyright R. P. McAfee 2002</center></td></tr>');
document.write('</table></td><td><img src="'+foldr+'/0.jpg" name="photox" border=0></td></tr></table>');

if(autoz=="yes") {ssrp();}

}



