// JavaScript Document

//This preloads all the images specified.
//Put the most commonly used images first in the imgArray.

function preload() {
	imgArray = new Array(
	'images/sample1Big.jpg',
	'images/sample2Big.jpg',
	'images/sample3Big.jpg',
	'images/sample4Big.jpg'
	);
	
	imagesCache = new Array ();

	for (i=0; i<imgArray.length; i++) 
	{
		imagesCache[i] = new Image;
		imagesCache[i].src = imgArray[i];
	}
}

function swapFeatureImg(src) {
	document.getElementById('featuredPhoto').innerHTML = "<img src='images/" + src +".jpg' width=370 height=404/>";
}






// canManipulateImages - check if the browser we're using can do
// clever stuff with document images.

function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}

// loadPosterImage

function loadPosterImage(imageURL) {
	if (gImageCapableBrowser) {
		document.imagePoster.src = imageURL;
		return false;
	}
	else {
		return true;
	}
}

// gImageCapableBrowser - is this browser hip to images? Set up
// a global variable so that we don't have to keep calling a function
// (useful if the function becomes costly to compute).

gImageCapableBrowser = canManipulateImages();

