// 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(13)
  myImg[0]= "pair-spaceship";
  myImg[1]= "pair-institutions";
  myImg[2]= "_MG_7773";
  myImg[3]= "_MG_2361";
  myImg[4]= "_MG_9092";
  myImg[5]= "_MG_9101";
  myImg[6]= "_MG_9159";
  myImg[7]= "_MG_2426";
  myImg[8]= "_MG_1081";
  myImg[9]= "_MG_0795";
  myImg[10]= "_MG_0865";
  myImg[11]= "_MG_9195";
  myImg[12]= "_MG_2275_retouched";
    myImg[13]= "_MG_2416";



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

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

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

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

