// List image names without extension

//before images - no before images yet!
var myImg= new Array(3)
  myImg[0]= "DSC04098";
  myImg[1]= "DSC04154";
  myImg[2]= "DSC04155";

  
//after images  
var myImgA= new Array(13)
  myImgA[0]= "St-Vincent-De-Paul2";
  myImgA[1]= "St-Vincent-De-Paul3";
  myImgA[2]= "St-Vincent-De-Paul5";
  myImgA[3]= "St-Vincent-De-Paul7";
  myImgA[4]= "St-Vincent-De-Paul6";
  myImgA[5]= "St-Vincent-De-Paul4";
  myImgA[6]= "MSCS_Dining_Room";
  myImgA[7]= "SVDP_Mural_photos_007-1";
  myImgA[8]= "Elelvator_Lobby";
  myImgA[9]= "Conferece_Rm";
  myImgA[10]= "Conference_Stg_Rm_b";
  myImgA[11]= "Lessys-office";  
  myImgA[12]= "Office_105_b";
  
// Tell browser where to find the image
myImgSrc = "images/mscs/";

// 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;
  document.imgSrcA.src = myImgSrc + myImgA[0] + myImgEnd;
}

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

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

//function that swtiches after images to the one clicked.
function after(selPic){
	document.imgSrc3.src = myImgSrc + myImgA[selPic] + myImgEnd;
}

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