var myImg= new Array(), limit = 31; //one more than highest value of myCaption[X]
var count;
for (var mi=0; mi<limit; mi++)
  {
  count = mi + 1;
  if (count < 10)
    {
    count = '00' + count;
    }
  else if (count < 100)
    {
    count = '0' + count;
    }
  myImg[mi] = 'pix' + count; 
  }


 // List captions
var myCaption= new Array(31) //one more than highest value of myCaption[X]

  myCaption[0]= "Official Skybark mascot, 'Baxter'. Skybark event, Los Angeles. Oct. 2007";
  myCaption[1]= "Griffith Park and Observatory; a great place to take your dog!";
  myCaption[2]= "More dog walkers at Griffith Park Observatory, Los Angeles.";
  myCaption[3]= "The 'woof top' party is on at Skybark. Sept. 2007";
  myCaption[4]= "Another 'willing' participant at the Bow Wow Ween event. Oct. 2006";
  myCaption[5]= "Nutts for Mutts, New Leash on Life and K9's Only founder Bobby Dorafshar saves another dog from Ca. wildfires. Oct. 2007 photo credit: NewLeash on Life ";
  myCaption[6]= "Los Angeles ABC News personality Garth Kemp protects his copy of Dog Days in LA at retail store 'Bark N Bitches' one year anniversary party and benefit. April 2007 ";
  myCaption[7]= "Yeah, a pug named 'Otter'. Got a problem with that? Walk for the Underdog. Oct. 2006";
  myCaption[8]= "You must be a great trainer to keep all these Australian Shepherds still. Bow Wow Meow event. Sept. 2007";
  myCaption[9]= "Benefit for Much Love Rescue at Hollywood's Vanguard Theater. June 2007";
  myCaption[10]= "MTV's Rob (standing) and Big (seated left) from the hit TV show, Rob and Big demonstrate their loyalty to Dog Days at Big's dog Meaty's birthday party. Skybark event Oct. 2007";
  myCaption[11]= "The opposite of a 'hot dog'? Skybark event. Sept. 2007";
  myCaption[12]= "This boxer has a good gig! Bow Wow Ween event, Barrington Dog Park, Oct. 2006";
  myCaption[13]= "Bow Wow Ween Oct. 2006";
  myCaption[14]= "A couple of Misfits at (Walk for the Underdog) rescue event. Oct. 2006";
  myCaption[15]= "Pet Artists reception at Topanga Gallery. July 2007";
  myCaption[16]= "Our favorite Dachshund, 'Baby Luv' off to another win. Huntington Beach Wiener Dog Races.";
  myCaption[17]= "This dog has taken the meaning of mobile home to a new level. Bow Wow Ween event, Oct. 2006";
  myCaption[18]= "A standard Schnauzer checks out the art at Bow Wow Meow. Sept. 2007";
  myCaption[19]= "Gotta love the contrast between this Great Dane and the Chihuahua behind him! Bow Wow Ween event Oct. 2006";
  myCaption[20]= "Ok, I've had enough of this stupid tiger costume. I want to be a dog again! Bow Wow Ween event. Oct. 2006";
  myCaption[21]= "The Barbie Twins at Bow Wow Ween event. Barrington Dog Park, Los Angeles Oct. 2006";
  myCaption[22]= "Pet Artists reception at Topanga Gallery. July 2007";
  myCaption[23]= "Actress (and former wife of musician Prince), Mayte Garcia hangs out with Mimi Germain, celebrity dog trainer (while drummer Tommy Lee looks on in background) at 'Dogs Allowed' at Hollywood's Vanguard dog event 2007 - credit: Hesley & Hall Associates ";
  myCaption[24]= "Actors Dick Van Patten and son James plug Dog Days. Skybark event. Oct. 2007";
  myCaption[25]= "This pug turned into a Halloween bunny at Bow Wow Ween. Barrington Dog Park, Oct. 2006";
  myCaption[26]= "Launch Party Tails";
  myCaption[27]= "How could anyone deny this cute boxer mix up for adoption?! Rescue a dog or cat today! Walk for the Underdog event, La Brea Tar Pits Oct. 2006";
  myCaption[28]= "Walk for the Underdog rescue event, La Brea Tar Pits Park Sept. 2006 ";
  myCaption[29]= "Two well-trained dogs at a Skybark event, downtown LA";
  myCaption[30]= "Another beautiful day in LA at Bow Wow Meow. September 2007";
 
  
myImgSrc = "/dogdaysinla/gallery/";
myImgEnd = ".jpg"
var i = 0;
function loadImg(){
  document.imgSrc.src = myImgSrc + myImg[i] + myImgEnd;
  document.getElementById("caption").innerHTML = myCaption[i];
}
function prev(){
  if(i<1){
    var l = i+=30  //same number as highest value of mycaption[x]
  } else {
    var l = i-=1;
	 }
  document.imgSrc.src = myImgSrc + myImg[l] + myImgEnd;
  document.getElementById("caption").innerHTML = myCaption[l];
}
function next(){
  if(i>29){  //one less than the highest value of mycaption[x]
    var l = i-=30 //same number as highest value of mycaption[x]
  } else {
    var l = i+=1;
  }
  document.imgSrc.src = myImgSrc + myImg[l] + myImgEnd;
  document.getElementById("caption").innerHTML = myCaption[l];
}
window.onload=loadImg;
