/* This script will generate a random header image. */

function doRandomImage() {

/* The following line chooses a randum number between 1 and 14. This represents the number of 
   possible header images. */

var x = Math.round(Math.random() * 13) + 1;

/* The following line initializes the image variable, which will contain the HTML code that
   displays the image. */

var image;

/* The following if/then block tests the value of x and sets the value of the image variable
   accordingly. One if/then block per possible image. */
   
if (x ==1) {
	image = "<img src=\"/images/header1.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Sunset image\">";
}

if (x ==2) {
	image = "<img src=\"/images/header2.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Honolulu sunrise image\">";
}

if (x ==3) {
	image = "<img src=\"/images/header3.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Surfer in the sunset image\">";
}

if (x ==4) {
	image = "<img src=\"/images/header4.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Wave on the rocks image\">";
}

if (x ==5) {
	image = "<img src=\"/images/header5.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Wave image\">";
}

if (x ==6) {
	image = "<img src=\"/images/header6.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Haleakala image\">";
}

if (x ==7) {
	image = "<img src=\"/images/header7.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Rainbow image\">";
}

if (x ==8) {
	image = "<img src=\"/images/header8.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Lifeguard stand image\">";
}

if (x ==9) {
	image = "<img src=\"/images/header9.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Rabbit island image\">";
}

if (x ==10) {
	image = "<img src=\"/images/header10.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Alamoana beach sunrise image\">";
}

if (x ==11) {
	image = "<img src=\"/images/header11.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Honolulu image\">";
}

if (x ==12) {
	image = "<img src=\"/images/header12.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Honolulu image\">";
}

if (x ==13) {
	image = "<img src=\"/images/header13.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Diamond Head image\">";
}

if (x ==14) {
	image = "<img src=\"/images/header14.jpg\" width=\"760\" height=\"100\" align=\"absmiddle\" alt=\"Rocks on beach image\">";
}

/* The following line writes the HTML code in the image variable to the Web page. */

document.write(image);

}

doRandomImage();
