// SlideHTML.js (Functions and variables for SlideShow)

var n = -1; // initial picture (-1). 
var timedelay = 5000;  // # millisecs between pics
    timedelay = 0;     // 2001-05-30, change default to Next
var whiteDelay = 200; //time to delay between white jpg to picture
var windowprops = "top=250,left=15,width=400,height=350"; 
// customize the popup window here

function loadPicInWindow() 
{
  var p = imgs[i];
  window.open(p,"",windowprops);
}

function rotate() 
{
  if (timedelay > -1000) (n == (lastN)) ? n = 0 : n++;
  else                   (n == 0) ? n = (lastN) : n--; 
  // alert("TimeDelay="+timedelay);
  i = n * 4; 
  window.status = imgs[i+3];
  setPicture(whiteslide,imgs[i+1]*percent/100,imgs[i+2]*percent/100,imgs[i+3]);
  window.setTimeout('setPicture(imgs[i],imgs[i+1]*percent/100,imgs[i+2]*percent/100, imgs[i+3])',whiteDelay);
  if (timedelay > 0) window.setTimeout("rotate()", timedelay);
}
function setPicture(jpg,width,height,alt)
{
  document.picform.slideshow.src = jpg;
  document.picform.slideshow.width = width;
  document.picform.slideshow.height = height;
  document.picform.slideshow.alt = alt;
  document.picform.picAlt.value  = alt;
}

function chgDelay(newValue)
{
  if (timedelay > 0)
    timedelay = newValue * 1000;
  else
  {
    timedelay = newValue * 1000;
    rotate();
  }
}

function chgPercent(newPercent)
{
  percent = newPercent;
}

function doSlidePage()
{
document.write('<FORM STYLE="margin-top:0" NAME="picform"><FONT SIZE="-1">');
document.write('<B>Use Back/Next</B> or: ');
document.write('Select desired Time Delay (seconds): ');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(1)">   1');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(3)">   3');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(5)">   5');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(10)"> 10');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(15)"> 15');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(30)"> 30 ');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(45)"> 45 ');
document.write('<INPUT NAME="delay" TYPE="Radio" onClick="chgDelay(60)"> 60.'); 
document.write('<BR>');
document.write('Adjust size of picture: ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(30)"> 30% ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(40)"> 40% ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(50)"> 50% ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(75)"> 75% ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(90)"> 90% ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(100)" CHECKED> 100% ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(110)"> 110% ');
document.write('<INPUT NAME="picSize" TYPE="Radio" onClick="chgPercent(125)"> 125% ');
document.write('</FONT><BR> ');
document.write('<INPUT NAME="picAlt" TYPE="Text" SIZE=60 VALUE="" DISABLED TITLE="Description of Picture"');
document.write('       STYLE="background-color:#FFCC66" ');
document.write('       STYLE="font-weight:bold"');
document.write('       STYLE="font-size:100%"');
document.write('       STYLE="text-align:center">');
document.write('<INPUT NAME="Back" TYPE="Button" onClick="chgDelay(-1)" VALUE="Back">');
document.write('<INPUT NAME="Next" TYPE="Button" onClick="chgDelay(0)" VALUE="Next"><BR>');
document.write('<A HREF="javascript:loadPicInWindow();"><IMG NAME="slideshow" SRC="whiteslide.jpg"');
document.write('  WIDTH=600 HEIGHT=480 ');
document.write('  ALT="Click here to open image in separate window!"></A>');
document.write('  <!--note HEIGHT & WIDTH omitted due to different size pictures-->');
document.write('</FORM>');
document.write('<FONT SIZE="+1"><BR>');
document.write(document.title);
document.write('</FONT><BR>');
document.write('<FONT SIZE="-1">Click on Image to load into separate window! &nbsp; ');
document.write('</FONT>');
}

