Window.onDomReady(init);

function init() {
	//bigpic is full image element
	//imgs is an array of thumbnails with a class of rollover in the sidebar
	var bigpic = $('bigpic');
	var imgs = $ES('img.rollover', $('sidebar'));

	//thumbSrc will store thumbnail src
	//fullSrc will store full image src
	//fullImgs will be used to preload full images on enabled browsers
	var thumbSrc = [];
	var fullSrc = [];
	var fullImgs = [];

	imgs.action({
		initialize: function() {
			var src = this.getProperty('src');
			thumbSrc.extend([src]);	
			regex = /-t/;
			src = src.replace(regex, '');
			fullSrc.extend([src]);

			if (document.images)
			{
				var tmpImg = new Image(50,65);
				tmpImg.src = src;
				fullImgs.extend([tmpImg]);
			}

		},

		onmouseover: function() {
			bigpic.setProperty('src', fullSrc[this.getProperty('src')]);
		}
	});

	fullSrc = fullSrc.associate(thumbSrc);

	if (document.images)
		fullImgs = fullImgs.associate(thumbSrc);
}
