var last_link = null;

function show_image ( link, text ) {
	var div = document.getElementById("image"), key, e;
	
	key = link.href.replace(/.*#/, "");
	
	div.innerHTML = "";
	
	e = document.createElement("IMG");
	e.src = "images/huts_and_groomers/" + key + ".jpg";
	e.alt = "";
	div.appendChild(e);
	
	e = document.createElement("P");
	e.appendChild(document.createTextNode(text));
	div.appendChild(e);
	
	// Make the thumb appear selected.
	if ( last_link ) {
		// IE 6 doesn't like setting the className of an A element.
		last_link.firstChild.className = "";
	}
	
	link.firstChild.className = "selected";
	last_link = link;
}

function show_first_image () {
	var node = document.getElementById("thumbs").firstChild;
	
	// Find first image.
	while ( node.nodeName != "A" ) {
		node = node.nextSibling;
	}
	
	node.onclick();
}
