// The values of these globals must correspond to the ids of markup
// that exist on the page.

var gMainImageContainerID = "mainImageOutline";

// These globals will store references to the widgets that
// make up the gallery.

var gImageViewer = null;

// The InitializeGallery() function attaches the widget behaviors
// to the markup on the page. It should be called when all of the
// markup is ready, after the onload event for the page has fired.

function InitializeGallery(initImage)
{
	// Create the image viewer widget. This widget is responsible
	// for attaching the fade in/out and grow/shrink behavior you
	// see whenever the main image on the page changes.

	gImageViewer = new Spry.Widget.ImageViewer(gMainImageContainerID);
	gImageViewer.setImage(initImage);
}