// JavaScript Document


/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Solomon, the Sleuth :: http://www.freewebs.com/thesleuth/scripts/ */

// List image names without extension
var myImg= new Array(9)	
  myImg[0]= "white_portrait_IMG_2282";
  myImg[1]= "holly_3168";
  myImg[2]= "_MG_8746";	
  myImg[3]= "001579-satoru";
  myImg[4]= "007765-hazel";
  myImg[5]= "pair-holmeskids";
  myImg[6]= "pair-kids";
  myImg[7]= "_MG_0657";
  myImg[8]= "_MG_0253_tomoko_minori";



// Tell browser where to find the image
myImgSrc = "photos-900x600/portraits/";

// Tell browser the type of file
myImgEnd = ".jpg"

var i = 0;

// Create function to load image
function loadImg(){
  document.imgSrc.src = myImgSrc + myImg[i] + myImgEnd;
}

// Create link function to switch image backward
function prev(){
  if(i<1){
    var l = i=+7
  } else {
    var l = i-=1;
  }
  document.imgSrc.src = myImgSrc + myImg[l] + myImgEnd;
}

// Create link function to switch image forward
function next(){
  if(i>6){
    var l = i-=7
  } else {
    var l = i+=1;
  }
  document.imgSrc.src = myImgSrc + myImg[l] + myImgEnd;
}

// Load function after page loads
window.onload=loadImg;

