// JavaScript Document

<!--

<!-- This is the standard Dreamweaver preloading script -->
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function randomimage()
{
	<!-- This is the array that holds the image names for all images that will be on the inside pages -->
	var insidearray = [
		"beached-kayaks.jpg",
		"coast1.jpg",
		"eagle.jpg",
		"fog.jpg",
		"kayaker1.jpg",
		"kayaker2.jpg",
		"orca.jpg",
		"pose.jpg",
		"seal.jpg",
		"seals.jpg",
		"sunset.jpg",
		"waves1.jpg",
		"waves2.jpg"
		];

		<!-- This is the array that holds the image names for all images that will be on the index page -->
	var indexarray = [
		"beached-kayaks-mts.jpg",
		"beached-kayaks-std.jpg",
		"coast1-mts.jpg",
		"coast1-std.jpg",
		"eagle-mts.jpg",
		"eagle-std.jpg",
		"fog-mts.jpg",
		"fog-std.jpg",
		"kayaker1-mts.jpg",
		"kayaker1-std.jpg",
		"kayaker2-mts.jpg",
		"kayaker2-std.jpg",
		"orca-mts.jpg",
		"orca-std.jpg",
		"pose-mts.jpg",
		"pose-std.jpg",
		"seal-mts.jpg",
		"seal-std.jpg",
		"seals-mts.jpg",
		"seals-std.jpg",
		"sunset-mts.jpg",
		"sunset-std.jpg",
		"waves-mts.jpg",
		"waves-std.jpg",
		"waves2-mts.jpg",
		"waves2-std.jpg"
		];
		
	<!-- This if statement determines if the page should display the random image for the index page or if it is displaying for an inside pag -->	
	if (setindex==1)
	{
		<!-- This will choose a random number between 0 and how many items there are in the array.  It uses 0 instead of 1 as the first item in an array is in position 0 -->
		var randomnumber = Math.floor(Math.random() * indexarray.length);
		
		<!-- This will preload the image that is choosen to be displayed -->
		MM_preloadImages("'http://www.batstar.com/images/headers/" + indexarray[randomnumber] + "'");
		
		<!-- This points to the images and tells the page which image to display on the index pages -->
		document.randompicture.src = eval("'http://www.batstar.com/images/headers/" + indexarray[randomnumber] + "'");
	}
		
	else
	{
		<!-- This will choose a random number between 0 and how many items there are in the array.  It uses 0 instead of 1 as the first item in an array is in position 0 -->
		var randomnumber = Math.floor(Math.random() * insidearray.length);
		
		<!-- This will preload the image that is choosen to be displayed -->
		MM_preloadImages("'http://www.batstar.com/images/slim-headers/" + insidearray[randomnumber] + "'");
	
		<!-- This points to the images and tells the page which image to display on the inside pages -->
		document.randompicture.src = eval("'http://www.batstar.com/images/slim-headers/" + insidearray[randomnumber] + "'");
	}
} <!-- Random Image function ends here -->

//-->
