/*
This code is based on a code example from the article "Javascript navigation - cleaner, not meaner" by Christian Heilmann
URL: http://www.evolt.org/article/Javascript_navigation_cleaner_not_meaner/17/60273/index.html
*/
function initShowHide() {
	hide();
	var colourpreview = [ "view", "colours" ];
	for (var mydiv in colourpreview) {
		var as = document.getElementById(colourpreview[mydiv]).getElementsByTagName('a')
		for (var i = 0; i < as.length; i++) {
			as[i].onmouseover = function() {
				show(this);
				
				}
			}
		}
	as = null;
}

function show(s) {
	hide();
	var id = s.href.match(/#(\w.+)/)[1];
	document.getElementById(id).style.display = 'block';
}

function hide() {
	var toggleable = document.getElementById('product').getElementsByTagName('img');
	for (var i = 0; i < toggleable.length; i++) {
		toggleable[i].style.display = 'none';
	}
}
