// 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(11)
  myImg[0]= "_MG_9530";
  myImg[1]= "pair-moss";
  myImg[2]= "_MG_9949";	
  myImg[3]= "_MG_9440b";
  myImg[4]= "pair-cloth";
  myImg[5]= "_MG_8979";
  myImg[6]= "pair-fabrics";
  myImg[7]= "CRW_4513-hems";
  myImg[8]= "_MG_3301";
  myImg[9]= "_MG_1218";
    myImg[10]= "001936-wireframe";
	    myImg[11]= "_MG_3261";


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

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

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

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

