
//thumbnail script

current_image=0
max=34
count=0

var delay = 3000;
var lock = false;
var run;

images= new Array()
images[0] = "../images/gallery2/1.jpg"
images[1] = "../images/gallery2/2.jpg"
images[2] = "../images/gallery2/3.jpg"
images[3] = "../images/gallery2/4.jpg"
images[4] = "../images/gallery2/5.jpg"
images[5] = "../images/gallery2/6.jpg"
images[6] = "../images/gallery2/7.jpg"
images[7] = "../images/gallery2/8.jpg "
images[8] = "../images/gallery2/9.jpg"
images[9] = "../images/gallery2/10.jpg "
images[10] = "../images/gallery2/11.jpg"
images[11] = "../images/gallery2/12.jpg "
images[12] = "../images/gallery2/13.jpg "
images[13] = "../images/gallery2/14.jpg "
images[14] = "../images/gallery2/15.jpg "
images[15] = "../images/gallery2/16.jpg"
images[16] = "../images/gallery2/17.jpg"
images[17] = "../images/gallery2/18.jpg"
images[18] = "../images/gallery2/19.jpg"
images[19] = "../images/gallery2/20.jpg"
images[20] = "../images/gallery2/21.jpg"
images[21] = "../images/gallery2/22.jpg"
images[22] = "../images/gallery2/23.jpg"
images[23] = "../images/gallery2/24.jpg"
images[24] = "../images/gallery2/25.jpg"
images[25] = "../images/gallery2/26.jpg"
images[26] = "../images/gallery2/27.jpg"
images[27] = "../images/gallery2/28.jpg"
images[28] = "../images/gallery2/29.jpg"
images[29] = "../images/gallery2/30.jpg"
images[30] = "../images/gallery2/31.jpg"
images[31] = "../images/gallery2/32.jpg"
images[32] = "../images/gallery2/33.jpg"
images[33] = "../images/gallery2/34.jpg"
images[34] = "../images/gallery2/35.jpg"

imageDescrip = new Array()
imageDescrip[0] = "magical transformation of a springtime drive"
imageDescrip[1] = "the backdrop of our natural ampitheater"
imageDescrip[2] = "indelible imprint of the kiss goodbye"
imageDescrip[3] = "My folks against the backdrop of our backyard"
imageDescrip[4] = "Ice Queen meets landscape"
imageDescrip[5] = "what lies in wait"
imageDescrip[6] = "Prepairing for the 25 anniversary Show at Red Rocks"
imageDescrip[7] = "favorite sunning site in Key West"
imageDescrip[8] = "Key West"
imageDescrip[9] = "imagined peoplescape"
imageDescrip[10] = "CSpan coverage of the Convention at Madison Square"
imageDescrip[11] = "our spot in Del Mar"
imageDescrip[12] = "A remarkable little horse"
imageDescrip[13] = "vista overlooking Boulder from the south"
imageDescrip[14] = "what appears within a dream"
imageDescrip[15] = "Aparitions"
imageDescrip[16] = "what do you believe in"
imageDescrip[17] = "overhead map of the Front Range"
imageDescrip[18] = "a flexible perspective of the planet"
imageDescrip[19] = "Principals of Magic"
imageDescrip[20] = "flowing motion"
imageDescrip[21] = "riding in the car heading home again"
imageDescrip[22] = "a wonderful low-key beach"
imageDescrip[23] = "transition into autumn"
imageDescrip[24] = "rural color"
imageDescrip[25] = "agitated palette"
imageDescrip[26] = "amid the lodgepole pines"
imageDescrip[27] = "calypso colored corn"
imageDescrip[28] = "Annual rites of summer at the Eldorado"
imageDescrip[29] = "Memory of youth and family"
imageDescrip[30] = "the magnifiscent"
imageDescrip[31] = "a look within the water"
imageDescrip[32] = "colors dance at the beach"
imageDescrip[33] = "birds are always a part of the water"
imageDescrip[34] = "stormy waves under a bright sky"

imageName = new Array()
imageName[0] = "Leprechaur or Hooligan Cadillac"
imageName[1] = "Red Rocks"
imageName[2] = "Last Smooch"
imageName[3] = "Mom and Dad with Flatirons"
imageName[4] = "Neoclassic Nude"
imageName[5] = "Awakening"
imageName[6] = "Folktales"
imageName[7] = "Adirondack Chair"
imageName[8] = "Robert's Table"
imageName[9] = "Green Window"
imageName[10] = "Demonstration NYC"
imageName[11] = "Whittingham Room"
imageName[12] = "Smarty Jones"
imageName[13] = "Green Truck"
imageName[14] = "Dreamscape"
imageName[15] = "From Beyond the Big Zipper"
imageName[16] = "Cosmology"
imageName[17] = "Sunset Goose"
imageName[18] = "Embryonic Earth"
imageName[19] = "Mother Earth Father Sky"
imageName[20] = "Dancin'"
imageName[21] = "Heading up the Keys"
imageName[22] = "Cape San Blas Florida"
imageName[23] = "Fallen Leaf"
imageName[24] = "Autumn Pasture"
imageName[25] = "Vibrant Hillside"
imageName[26] = "Breckenridge Condo"
imageName[27] = "Corn Ear"
imageName[28] = "Swimmin' Hole"
imageName[29] = "Modes of Transport"
imageName[30] = "Magoo"
imageName[31] = "Turtle Boat and Fish"
imageName[32] = "Sunset at Beach"
imageName[33] = "Sandpiper"
imageName[34] = "Frigate Bird with Waves Isla Mujer Mexico"

function mymenu() {
  alert("ToDo you selected " + menuitems[document.mytoolbar.picgroups.selectedIndex]);
}

function auto() {
  if (lock == true) {
    lock = false;
    clearInterval(run);
    document.mytoolbar.automatic.value="Auto";
  }
  else if (lock == false) {
    lock = true;
    run = setInterval("nextimage()", delay);
    document.mytoolbar.automatic.value="Stop";
  }
}

function select_image(picnum)
{
  if (!document.mytoolbar.picnum.value.match(/^\d+$/)) {
    document.mytoolbar.picnum.value="";
    alert("invalid value - enter an number from 1 to 35");
    return; 
  }
  if ((document.mytoolbar.picnum.value<1) || (document.mytoolbar.picnum.value>(max+1))){
    document.mytoolbar.picnum.value="";
    alert("invalid value - enter an number from 1 to 35");
    return;
  }
  current_image=parseFloat(picnum.value)-1;
  selected_image= current_image + 1;
  document.images['large'].src=images[current_image];
  document.getElementById('bozo').innerHTML = imageName[current_image];
  document.getElementById('bozo2').innerHTML = (selected_image) + " of " + (max + 1);
  document.getElementById('descrip').innerHTML = imageDescrip[current_image];
  document.mytoolbar.picnum.value="";
}

function nextimage()
{
if (current_image<max) {
  current_image=current_image+1
} 
else {
  current_image=0
}
document.images['large'].src=images[current_image];
document.getElementById('bozo').innerHTML = imageName[current_image];
document.getElementById('bozo2').innerHTML = (current_image+1) + " of " + (max + 1);
document.getElementById('descrip').innerHTML = imageDescrip[current_image];
}

function previousimage()
{
if (current_image>0) {
  current_image=current_image-1
} 
else {
  current_image=max
}
document.images['large'].src=images[current_image];
document.getElementById('bozo').innerHTML = imageName[current_image];
document.getElementById('bozo2').innerHTML = (current_image+1) + " of " + (max + 1);
document.getElementById('descrip').innerHTML = imageDescrip[current_image];
}

// This is intended for a page with thumbnails - not using in slideshow so may be busted - remove parens
// This defines what to do when an image is clicked on 
function image_click(clicks)
{
current_image=clicks
document.images['large'].src=images[clicks];
document.getElementById('bozo').innerHTML = imageName[clicks] + " (" + (clicks +1) + " of " + (max + 1) +")";
}
