/* hide the Go button for browsers that support JavaScript */
function hideGoButton() {
	document.getElementById("goButton").style.display = "none";
}

// Gecko selects the wrong option if no category is defined (?)
function selectCategory(categoryID) {
	var element = document.getElementById("quickNav").elements[0];
	for(var i = 0; i < element.options.length; i++) {
		// alert("Hi!");
		if(element.options[i].value == categoryID) element.selectedIndex = i;
		break;
	}
}

// centers product images within their containing elements
function centerProductImages() {
	imgs = document.getElementsByTagName("img");
	// loop through img tags
	for(i = 0; i < imgs.length; i++) {
		if(imgs[i].className == "productImage") {
			// positioning must be set here or it will not work (?)
			imgs[i].style.position = "relative";
			// units *must* be specified for this to work under Gecko
			imgs[i].style.left = String(Math.floor((imgs[i].parentNode.offsetWidth - imgs[i].offsetWidth) / 2)) + "px";
			imgs[i].style.top = String(Math.floor((imgs[i].parentNode.offsetHeight - imgs[i].offsetHeight) / 2)) + "px";
		}
	}
}

// centerProductImages();
