window.onload = function() {
	var aThumbnailLinks = document.getElementById('thumbnails').getElementsByTagName('a');
	for (var a = 0; a < aThumbnailLinks.length; a++) {
		aThumbnailLinks[a].onclick = function() {
			var imgObject = this.getElementsByTagName('img')[0];
			/*	------------------------------------------------------------
			We are going to determine the size of the pop-up window based on
			this size of the thumbnail.  We know all of the thumbnails are 88
			pixels tall and all of the full-size images are 640 wide. So we
			do some math.
			------------------------------------------------------------	*/
			var popUpWidth = 640;
			var popUpHeight = (popUpWidth * 88) / imgObject.width;
			
			/*	Now, add some extra space for the pop-up.	*/
			popUpWidth += 20;
			popUpHeight += 50;
			
			
			popUp(this, popUpWidth, popUpHeight);
			return false;
		}
	}
}
