
//thumbnail script

current_image=0
max=11
count=0

var delay = 3000;
var lock = false;
var run;

images= new Array()
images[0] =  "../images/gallery1/backdoorwindow.jpg"
images[1] =  "../images/gallery1/butterflyshell.jpg"
images[2] =  "../images/gallery1/extremopro.jpg"
images[3] =  "../images/gallery1/fishingbeaverpond.jpg"
images[4] =  "../images/gallery1/harracanethenstorm.jpg"
images[5] =  "../images/gallery1/hommageptermaxx.jpg"
images[6] =  "../images/gallery1/peony.jpg"
images[7] =  "../images/gallery1/poncesurf.jpg"
images[8] =  "../images/gallery1/pupinacup.jpg"
images[9] =  "../images/gallery1/quilter.jpg"
images[10] = "../images/gallery1/spitirhospitality.jpg"
images[11] = "../images/gallery1/squirrelchaser.jpg"

imageName = new Array()
imageName[0] = "Backdoor Window"
imageName[1] = "Butterfly Shell"
imageName[2] = "Extremo Pro"
imageName[3] = "Fishing the Beaver Pond"
imageName[4] = "Harracane and then the Flood"
imageName[5] = "Homage to Peter Maxx"
imageName[6] = "Peony"
imageName[7] = "Ponce Surf"
imageName[8] = "Pup in a Cup"
imageName[9] = "Quilter"
imageName[10] = "Spirits of Hospitality"
imageName[11] = "Squirrel Chaser"

imageDescrip = new Array()
imageDescrip[0] = "Watery glass viewing a soggy day"
imageDescrip[1] = "Shells adored from Florida's gulf coast"
imageDescrip[2] = "Attacking the slope"
imageDescrip[3] = "Enjoying the Colorado high country"
imageDescrip[4] = "Hurricane Katrina's affect on New Orleans and her people"
imageDescrip[5] = "Stream of mind landscape reminiscent of the 60\'s"
imageDescrip[6] = "Monstrous blossoms for Decoration Day"
imageDescrip[7] = "Waves along the beach of southern Puerto Rico"
imageDescrip[8] = "Childhood fascination with dogs tiny enough to fit in your pockets"
imageDescrip[9] = "Upstate New York's Fingerlakes dotted with vineyards and flying quilts on many porches"
imageDescrip[10] = "Our house and hopefully the feel of the place, welcoming"
imageDescrip[11] = "Inhabitants of the neighborhood delight in teasing Magoo the cat"

// 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 11");
    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 11");
    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) +")";
}
