//thumbnail script
current_image=0
max=25
count=0

var delay = 3000;
var lock = false;
var run;

images= new Array()
images[0] =  "../images/gallery4/baskinginthesun.jpg"
images[1] =  "../images/gallery4/bathroomsink.jpg"
images[2] =  "../images/gallery4/bothsides.jpg"
images[3] =  "../images/gallery4/deltacemetery.jpg"
images[4] =  "../images/gallery4/floatingbubbles.jpg"
images[5] =  "../images/gallery4/foldingclothes2.jpg"
images[6] =  "../images/gallery4/fountainofyouth.jpg"
images[7] =  "../images/gallery4/gardenvarietycat.jpg"
images[8] =  "../images/gallery4/hibiscus.jpg"
images[9] =  "../images/gallery4/hospitalroom.jpg"
images[10] = "../images/gallery4/housewren.jpg"
images[11] = "../images/gallery4/loszapatos.jpg"
images[12] = "../images/gallery4/nearmoab.jpg"
images[13] = "../images/gallery4/niagrafalls.jpg"
images[14] = "../images/gallery4/orchidbuds.jpg"
images[15] = "../images/gallery4/painteddesert.jpg"
images[16] = "../images/gallery4/peace.jpg"
images[17] = "../images/gallery4/picketsandshadows.jpg"
images[18] = "../images/gallery4/poolparty.jpg"
images[19] = "../images/gallery4/rainbowtrout.jpg"
images[20] = "../images/gallery4/sketchofagirl.jpg"
images[21] = "../images/gallery4/squashblossom.jpg"
images[22] = "../images/gallery4/tears.jpg"
images[23] = "../images/gallery4/triggerfish.jpg"
images[24] = "../images/gallery4/walkon.jpg"
images[25] = "../images/gallery4/yourbetmoneytalks.jpg"

imageName = new Array()
imageName[0] = "Basking in the Sun"
imageName[1] = "Bathroom Sink"
imageName[2] = "Both Sides of the Street"
imageName[3] = "Delta Cemetery"
imageName[4] = "Floating Bubbles"
imageName[5] = "Folding Clothes"
imageName[6] = "Fountain of Youth"
imageName[7] = "Garden Variety Cat"
imageName[8] = "Hibiscus"
imageName[9] = "Hospital Room"
imageName[10] = "House Wren"
imageName[11] = "Los Zapatos"
imageName[12] = "Near Moab"
imageName[13] = "Niagara Falls"
imageName[14] = "Orchid Buds"
imageName[15] = "Painted Desert"
imageName[16] = "Peace"
imageName[17] = "Pickets and Shadows"
imageName[18] = "Pool Party"
imageName[19] = "Rainbow Trout"
imageName[20] = "Sketch of a Girl"
imageName[21] = "Squash Blossom"
imageName[22] = "Tears"
imageName[23] = "Triggerfish"
imageName[24] = "Walk On"
imageName[25] = "Your Bet Money Talks"

imageDescrip = new Array()
imageDescrip[0] = "the heat of the beach, while laying out is a delight"
imageDescrip[1] = "A Black and White Photo is the foundation for this colorful drawing"
imageDescrip[2] = "a double exposure in black and white taken from our corner"
imageDescrip[3] = "A rosy glow of the last lights of evening are the subject of this hand colored"
imageDescrip[4] = "Bubbles are fun"
imageDescrip[5] = "Magoo the cat helping with laundry"
imageDescrip[6] = "ST Augustine Florida where the Spaniard Ponce De Leon sought the fountain of perpetual youth and found mainland North America"
imageDescrip[7] = "Little Kittie hiding in the garden in this handcolored black and white"
imageDescrip[8] = "graphite drawing of the tropical flower, often seen in Hawaii and the Caribbean"
imageDescrip[9] = "an extended stay often sends one into a surreal experience not unlike being in a fish tank"
imageDescrip[10] = "from the top of trees a dusky flight"
imageDescrip[11] = "miscommunication abounds when aliens make appearances"
imageDescrip[12] = "close to Moab Utah are some curvaceous bluffs… here captured as a drawing in their sunset attire"
imageDescrip[13] = "a handcolored black and white photo displays the phenomenal power of the water that makes this famous landmark always memorable"
imageDescrip[14] = "elegant flowers shot in black and white film"
imageDescrip[15] = "Pen and ink highlights add to the colored pencil drawing of the northern Arizona Landscape"
imageDescrip[16] = "Child’s play blowing bubbles in peace"
imageDescrip[17] = "patterns of light and shadow enhance this handcolored black and white photo"
imageDescrip[18] = "the musicians I know set the place rockin’ as we gather for a late summer party by the pool"
imageDescrip[19] = "our friend Tom caught a gorgeous fish and I painted it from memory"
imageDescrip[20] = "animated image of a girl"
imageDescrip[21] = "Black and white photo of a flowering squash"
imageDescrip[22] = "frustration in childhood"
imageDescrip[23] = "I enjoyed both diving and having salt water aquariums as hobbies"
imageDescrip[24] = "The day we buried my Dad we saw a very thin coyote walk past his grave…"
imageDescrip[25] = "play the poker hand in the numerals of a dollar bill, best hand wins"


// not using this array or the mymenu function which is just a simple test
// intended for multiple gallery pulldown menu
menuitems = new Array()
menuitems[0] = "2006 pics"
menuitems[1] = "butterflys and mosquitos"
menuitems[2] = "2005 pics"
menuitems[3] = "turtles and frogs"

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 26");
    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 26");
    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) +")";
}