//thumbnail script
current_image=0;
max=18;
count=0;

var delay = 3000;
var lock = false;
var run;

images= new Array()
images[0] =  "../images/big/bigcloud.JPG"
images[1] =  "../images/big/bigsky.JPG"
images[2] =  "../images/big/citysummer.JPG"
images[3] =  "../images/big/fireflower.JPG"
images[4] =  "../images/big/fogmtn.JPG"
images[5] =  "../images/big/jillgrove.JPG"
images[6] =  "../images/big/justmore.JPG"
images[7] =  "../images/big/kachinadance.JPG"
images[8] =  "../images/big/kinred.JPG"
images[9] = "../images/big/mesasun.JPG"
images[10] = "../images/big/newmdawn.JPG"
images[11] = "../images/big/nightshift.JPG"
images[12] = "../images/big/teleline.JPG"
images[13] = "../images/big/pimento.JPG"
images[14] = "../images/big/raptors.JPG"
images[15] = "../images/big/gath_storm.JPG"
images[16] = "../images/big/somethingelse.JPG"
images[17] = "../images/big/circlelight.JPG"
images[18] = "../images/big/windows.JPG"

imageName = new Array()
imageName[0] = "Big Cloud or The Last Wave"
imageName[1] = "Big Sky"
imageName[2] = "City in the Summer"
imageName[3] = "Fireflower"
imageName[4] = "Fogmountain"
imageName[5] = "Jill's Grove"
imageName[6] = "Just Some More Mountains"
imageName[7] = "Kachinadance"
imageName[8] = "Kinksi's Teeth"
imageName[9] = "Mesa Sunset"
imageName[10] = "New Mexico Dawn"
imageName[11] = "Nightshift"
imageName[12] = "Party Line"
imageName[13] = "Pimento Ridge"
imageName[14] = "Raptors"
imageName[15] = "Return of Gathering Storm"
imageName[16] = "Something Else"
imageName[17] = "Suncircle"
imageName[18] = "Windows"

imageDescrip = new Array()
imageDescrip[0] = "yikes somebody stole my car"
imageDescrip[1] = "The Way Mountains Oughta Look"
imageDescrip[2] = "How the Big Apple Feels When It's Steamin"
imageDescrip[3] = "Dream-time"
imageDescrip[4] = "How It Feels"
imageDescrip[5] = "gots to name it something"
imageDescrip[6] = "easy for you to say"
imageDescrip[7] = "Indian Abstraction"
imageDescrip[8] = "opera in the amazon, why not"
imageDescrip[9] = "The way sunset nails you in the desert"
imageDescrip[10] = "Driving on I-40 at Dawn"
imageDescrip[11] = "Stars Light the Sky"
imageDescrip[12] = "hello who's that speaking please"
imageDescrip[13] = "as they used to say, pimento untuno shemento"
imageDescrip[14] = "Dinasaurs/Birds-Same Same"
imageDescrip[15] = "it's back johnny"
imageDescrip[16] = "Dream Picture"
imageDescrip[17] = "Laying Down, Looking Up"
imageDescrip[18] = "How it Looks Riding into New York City"


// 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 19");
    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 19");
    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 = "\<br \/>" + 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 = "\<br \/>" + 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 = "\<br \/>" + 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) +")";
}