
//thumbnail script

current_image=0
max=22
count=0

var delay = 3000;
var lock = false;
var run;

images= new Array()
images[0] =  "../images/gallery4/100yearball.jpg"
images[1] =  "../images/gallery4/angelofdesertstorm.jpg"
images[2] =  "../images/gallery4/angelofmthope.jpg"
images[3] =  "../images/gallery4/askal.jpg"
images[4] =  "../images/gallery4/brycecanyonnp.jpg"
images[5] =  "../images/gallery4/cupotea.jpg"
images[6] =  "../images/gallery4/distanthorizon_pcb.jpg"
images[7] =  "../images/gallery4/flamesofinspiration.jpg"
images[8] =  "../images/gallery4/girlinrubydress.jpg"
images[9] =  "../images/gallery4/gladiola.jpg"
images[10] = "../images/gallery4/inthefrontroom.jpg"
images[11] = "../images/gallery4/mexicanlawnstatue.jpg"
images[12] = "../images/gallery4/pancakes.jpg"
images[13] = "../images/gallery4/patterofrain.jpg"
images[14] = "../images/gallery4/peedee.jpg"
images[15] = "../images/gallery4/pricklypearcactus.jpg"
images[16] = "../images/gallery4/rhythmgypsies.jpg"
images[17] = "../images/gallery4/ridingthewavesonpearl.jpg"
images[18] = "../images/gallery4/rockinchristmas.jpg"
images[19] = "../images/gallery4/swimminupstream.jpg"
images[20] = "../images/gallery4/thelluride.jpg"
images[21] = "../images/gallery4/turtlesonalog.jpg"
images[22] = "../images/gallery4/wintersgarden.jpg"

imageName = new Array()
imageName[0] = "100 Year Ball"
imageName[1] = "Angel of Desert Storm"
imageName[2] = "Angel of Mount Hope Cemetery"
imageName[3] = "Ask Al"
imageName[4] = "Bryce Canyon NP"
imageName[5] = "Cup o Tea"
imageName[6] = "Distant Horizons, Panama City Beach"
imageName[7] = "Flames of Inspiration"
imageName[8] = "Girl in a Ruby Dress"
imageName[9] = "Gladiola"
imageName[10] = "In the Front Room"
imageName[11] = "Mexican Lawn Statue"
imageName[12] = "Pancakes"
imageName[13] = "Patter of Rain"
imageName[14] = "Pee Dee"
imageName[15] = "Prickly Pear Cactus"
imageName[16] = "Rhythm Gypsies"
imageName[17] = "Riding the Waves on Pearl Street"
imageName[18] = "Rocking Christmas"
imageName[19] = "Swimming Upstream"
imageName[20] = "T\’helluride"
imageName[21] = "Turtles on a Log"
imageName[22] = "Winters Garden"

imageDescrip = new Array()
imageDescrip[0] = "a holiday party celebrating Halloween and some important Birthdays"
imageDescrip[1] = "the first angel in western culture is depicted on the ziggurat at UR."
imageDescrip[2] = "as a child my husband played in a huge cemetery near his father’s office. In Rochester NY"
imageDescrip[3] = "this summer we had some pretty big gully-washers and after we had enormous mushrooms spring up… A cat named Zoe, who was also part of this time in our yard."
imageDescrip[4] = "Utah’s colorfully layered rocks are amazing!"
imageDescrip[5] = "a warm mug is always a good friend in the cold weather"
imageDescrip[6] = "the Beach is always a treat ever changing view"
imageDescrip[7] = "as a match strikes so comes the inspiration at times"
imageDescrip[8] = "and earlier sketch book drawing of my sister"
imageDescrip[9] = "the pristine white flower stalks that often tower above other types"
imageDescrip[10] = "Ray Davies inspired from early rock’s home front"
imageDescrip[11] = "Lafayette has always been a community with proud immigrants"
imageDescrip[12] = "sourdough pancakes have been a staple since a visit to San Francisco at age 12"
imageDescrip[13] = "The rain makes interesting patterns on the sliding glass as seen from the dry interior… in Rochester N.Y."
imageDescrip[14] = "South Carolina abounds with untamed natural spaces…"
imageDescrip[15] = "handcolored black and white photo of a cactus pad"
imageDescrip[16] = "our friends band the name alone inspired this image and their music carries it well"
imageDescrip[17] = "a dream had deep water and wave runners navigating the Water Street…"
imageDescrip[18] = "kitty rocking by the Christmas tree"
imageDescrip[19] = "the tedium of waiting for Dad’s surgery to be completed"
imageDescrip[20] = "Telluride Colorado played host to Grateful Dead and the many concertgoers some years back and this was my image to commemorate the visit"
imageDescrip[21] = "in the Low country of South Carolina there are a lot of turtles… I have always loved turtles"
imageDescrip[22] = "children’s tools for summer play adorned a midwinter garden"

// 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 23");
    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 23");
    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) +")";
}
