function set_thumbs()
{
	// Get all of the "blocks" on the left hand side
	var blocks = document.getElementById("portfolio-images").getElementsByTagName("div");
	// Create an array to hold the html anchors for the images
	var a = new Array();

	// Loop through the blocks and get only the anchors used for the gallery ("thumbs")
	for(var i=0; i<blocks.length; i++)
	{
		if(blocks[i].className.indexOf("thumb") > -1)
		{
			if(blocks[i].getElementsByTagName("img").length>0) // Only get the blocks where an image is present (thumbnail image)
			{
				a[a.length] = blocks[i].firstChild;
			}
		}
	}

	// Create a new array for the larger images so they can pre-load
	var image_large = new Array();

	for(var i=0; i<a.length; i++)
	{
		image_large[i] = new Image();
		image_large[i].src = a[i].firstChild.getAttribute("big_image");
	}

	// Page objects (passed in through function)
	var h1 = document.getElementById("text-heading");
	var image_placeholder = document.getElementById("content-right").getElementsByTagName("img")[0];
	var image_placeholder_caption  = document.getElementById("right-caption");

	// The initial setup
	// - Get the first thumbnail and set it's opacity to simulate a mouseover event (selected)
	var first_thumb = a[0].firstChild;
	first_thumb.style.opacity = .25;
	first_thumb.style.MozOpacity = .25; 
	first_thumb.style.KhtmlOpacity = .25;
	first_thumb.style.filter = "alpha(opacity=25)";
	image_placeholder_caption.innerHTML = first_thumb.getAttribute("alt");

	// The onmouseover event
	for(var i=0; i<a.length; i++)
	{
		a[i].onmouseover = function()
		{
			// Clear out all the opacity onmouseover events
			for(var j=0; j<a.length; j++)
			{
				var clear_img = a[j].firstChild;
				clear_img.style.opacity = 1;
				clear_img.style.MozOpacity = 1; 
				clear_img.style.KhtmlOpacity = 1;
				clear_img.style.filter = "alpha(opacity=100)";
			}
	
			var img = this.firstChild;
			img.style.opacity = .25;
			img.style.MozOpacity = .25; 
			img.style.KhtmlOpacity = .25;
			img.style.filter = "alpha(opacity=25)";
	
			image_placeholder_path = img.getAttribute("big_image");
			image_placeholder.src = image_placeholder_path;
			image_placeholder.setAttribute("alt",img.getAttribute("alt"));

			if(h1)
			{
				h1.innerHTML = img.getAttribute("alt");
			}

			image_placeholder_caption.innerHTML = img.getAttribute("alt");
		}
/*
		a[i].onclick = function()
		{
			var img = this.firstChild;
			window.open(img.getAttribute("big_image"));
		}
*/
	}
}

set_onload("set_thumbs");
