// 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(7)
  myImgA[0]= "MSCS_Dining_Room";
  myImgA[1]= "SVDP_Mural_photos_007-1";
  myImgA[2]= "Elelvator_Lobby";
  myImgA[3]= "Conferece_Rm";
  myImgA[4]= "Conference_Stg_Rm_b";
  myImgA[5]= "Lessys-office";  
  myImgA[6]= "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