// 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(18)
  myImg[0]= "_MG_7051-composite";
  myImg[1]= "_MG_9928";
  myImg[2]= "sharp-pair";
  myImg[3]= "_MG_0266-dpp";
  myImg[4]= "_MG_0238-oct2009";
  myImg[5]= "_MG_6809-composite-redo";
  myImg[6]= "CRW_6046-composite-srgb";
  myImg[7]= "_MG_0115";
  myImg[8]= "_MG_2054";
  myImg[9]= "_MG_1974";
  myImg[10]= "_MG_6629";
  myImg[11]= "pair-clinton";
  myImg[12]= "pair-bathrooms-windsor";
  myImg[13]= "_MG_0058";
  myImg[14]= "_MG_6881-composite";
  myImg[15]= "_MG_9412";
  myImg[16]= "_MG_9812_comp";
  myImg[17]= "_MG_9793";
  myImg[18]= "_MG_6759-nocabinet";



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

// 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=+18
  } else {
    var l = i-=1;
  }
  document.imgSrc.src = myImgSrc + myImg[l] + myImgEnd;
}

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

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

