function clearSearchBox (obj)
{
	if (obj.value == "Search the site") {
		obj.value = "";
	}
}

/* Product catalogue image stuff */
var newImage = new Image();

function switchImage (thumb)
{
	// don't do the image switch if this one is already selected
	if (thumb.parentNode.className == "selected") {
		return;
	}
		
	// clear any selected thumb..
	var parent = thumb.parentNode.parentNode;
	
	for (i = 0; i != parent.childNodes.length; i++)
	{
		if (parent.childNodes[i].className == "selected") {
			parent.childNodes[i].className = "";
		}
	}
	
	var bigimage = document.getElementById("large-image");
	
	if (bigimage) {
		bigimage.src = virtRoot + "images/loading.gif";
		newImage.onload = schedLargeImageSwitch;
		newImage.src = thumb.src.replace("_tn", "");
		thumb.parentNode.className = "selected";
	}
}

// Called via the onload event of the new image...
function schedLargeImageSwitch ()
{
	// now the image has loaded .. wait 500ms and show it
	window.setTimeout(doSwitchLargeImage, 250);
}

function doSwitchLargeImage ()
{
	var bigimage = document.getElementById("large-image");
	
	if (bigimage) {
		bigimage.src = newImage.src;
	}
}