// JavaScript Document

// PAIRED RANDOM IMAGES IN HEADER

// make two arrays
var img_one = new Array();
var img_two = new Array();

// populate the two arrays so that the contents sync up.
img_one[0] = 'block1-random1.jpg';
img_two[0] = 'block2-random1.jpg';
img_one[1] = 'block1-random2.jpg';
img_two[1] = 'block2-random2.jpg';
img_one[2] = 'block1-random3.jpg';
img_two[2] = 'block2-random3.jpg';
img_one[3] = 'block1-random4.jpg';
img_two[3] = 'block2-random4.jpg';
img_one[4] = 'block1-random5.jpg';
img_two[4] = 'block2-random5.jpg';
img_one[5] = 'block1-random6.jpg';
img_two[5] = 'block2-random6.jpg';

// Specify the first and last part of the image tags.

FirstPart1 = '<img src="/site-tools/img/header-changeouts/block1/';
LastPart1 = '" height="91" width="127" alt="" id="changedout-image">';

FirstPart2 = '<img src="/site-tools/img/header-changeouts/block2/';
LastPart2 = '" height="66" width="104" alt="">';

// generate a random number limited by the number of options available.
var n=Math.floor(Math.random() * img_one.length);

// write out the first image.

function randomImageBlock1() {
document.write(FirstPart1 + img_one[n] + LastPart1);
}

// write out the second image.

function randomImageBlock2() {
document.write(FirstPart2 + img_two[n] + LastPart2);
}



// LARGE IMAGE IN LEFT-HAND COLUMN (HOMEPAGE)
// Type the number of images you are rotating.

NumberOfImagesToRotate3 = 6;

// Specify the first and last part of the image tag.

FirstPart3 = '<img src="/site-tools/img/homepage-images/homepage-image';
LastPart3 = '.jpg" height="266" width="234" alt="">';

function randomImage3() {
var r3 = Math.ceil(Math.random() * NumberOfImagesToRotate3);
document.write(FirstPart3 + r3 + LastPart3);
}

