function openVariant(variantForm) {
	var selectElement = variantForm.elements['variants'];
	var variantKey = selectElement.options[selectElement.selectedIndex].value;
	window.location.href = '/view/product.do?id=' + variantKey;
}
function addVariantToBasket(variantForm, returnUri) {
	var selectElement = variantForm.elements['variants'];
	var variantKey = selectElement.options[selectElement.selectedIndex].value;
	var newUri = '/basket/addto.do?id=' + variantKey;
	if(returnUri != null) {
		newUri += '&returnUri=' + returnUri;
	}
	window.location.href = newUri;
}
function showAllVariants(variantForm) {
	var selectElement = variantForm.elements['variants'];
	var variantKey = selectElement.options[selectElement.selectedIndex].value;
	window.location.href = '/variants/showall.do?id=' + variantKey;
}
function hideHelp() {
	var popup = document.getElementById('popopVariantHelp');
	popup.style.visibility = 'hidden';
}
function showHelp() {
	if (document.all) {
		tempX = window.event.clientX + document.body.scrollLeft;
		tempY = window.event.clientY + document.body.scrollTop;
	} else {
		tempX = window.event.pageX
		tempY = window.event.pageY
	}  
	// Catch possible negative values in NS4
	if (tempX < 0) {
		tempX = 0;
	}
	if (tempY < 0) {
		tempY = 0;
	}
	
	var popup = document.getElementById('popopVariantHelp');
	popup.style.left = tempX - 340;
	popup.style.top = tempY - 265;
	popup.style.visibility = 'visible';
}
