//This JS file defines the front, rotating images for Alaska.
//It uses the Math.random object to rotate through a randomly
//defined set of images located in /images/

//global variable to pass in the path to these rotating images
var imageroot='/customization/aarenterprise/site/images/';
//First series of front images defined in the var frontImages
var frontImages = new Array()

  frontImages[0] = imageroot+'/buyer.gif'
  frontImages[1] = imageroot+'/seller.gif'
  frontImages[2] = imageroot+'/realtor.gif'
  
  var frontImages1 = new Array()
  
    frontImages1[0] = imageroot+'/buyer1.gif'
    frontImages1[1] = imageroot+'/seller1.gif'
  frontImages1[2] = imageroot+'/realtor1.gif'
 
var j = 0
var p = frontImages.length;
var preBuffer = new Array()
  for (i = 0; i < p; i++){
    preBuffer[i] = new Image()
    preBuffer[i].src = frontImages[i]

  }

var whichImage = Math.round(Math.random()*(p-1));
  
  //the 1st function that calls the random, rotating generator
  function rotateImage() {
    document.write('<img src="'+frontImages[whichImage]+'">');

  }
 //the 1st function that calls the random, rotating generator
  function rotateImage1() {
    document.write('<img  src="'+frontImages1[whichImage]+'">');

}
