function setProductMedLrgImg(li, medUrl, lrgUrl) {
	$('#medBox>img').attr('src', medUrl);
	$('#enlargedImage img').attr('src', lrgUrl);
	$('li', li.parentNode).each(function(i) {
		$(this).removeClass('sel');
	});
	$(li).addClass('sel');
}

function setMuralImg(li, medUrl, lrgUrl) {
	$('#topHeroImage>img').attr('src', medUrl);
}

function goMoveMedBox(e) {
	var zoom = document.getElementById('zoom');
	var box = document.getElementById('medBox');
	var enl = document.getElementById('enlargedImage');
	var out = document.getElementById('OuterBox');
				
	var x = (document.all) ? event.x : e.pageX
	var y = (document.all) ? event.y : e.pageY
				
	var boxL = (document.all) ? box.offsetLeft : out.offsetLeft + out.offsetParent.offsetLeft + box.offsetLeft
	var boxT = (document.all) ? box.offsetTop : box.parentNode.offsetTop + out.offsetParent.offsetTop
	
	var relX = x - boxL;
	var relY = y - boxT;
	
	var boxW = box.offsetWidth;
	var boxH = box.offsetHeight;
	
	var enlW = enl.offsetWidth;
	var enlH = enl.offsetHeight;
	
	var enlSW = enl.scrollWidth;
	var enlSH = enl.scrollHeight;
	zoom.style.width = '0px';
	zoom.style.height = '0px';
	if (enlSW > 0) {
	   zoom.style.width = Math.floor(enlW / enlSW * boxW) + 'px';
	}
	if (enlSH > 0) {
	   zoom.style.height = Math.floor(enlH / enlSH * boxH) + 'px';
	}
	var zH = zoom.offsetHeight;
	var zW = zoom.offsetWidth;
	
	var zt = relY - Math.floor(zH / 2);
	var zl = relX - Math.floor(zW / 2);
	
	if (zt < 0)
		zt = 0;
	else if (zt > boxH - zH)
		zt = boxH - zH;
		
	if (zl < 0)
		zl = 0;
	else if (zl > boxW - zW)
		zl = boxW - zW;
	
	zoom.style.top = (document.all) ? (boxT + zt) + 'px' : (zt) + 'px'
	zoom.style.left = (document.all) ? (boxL + zl) + 'px' : (zl) + 'px'
	zoom.style.visibility = 'visible';
	
	enl.style.visibility = 'visible';
	enl.scrollLeft = Math.floor(relX / boxW * enlSW - enlW / 2);
	enl.scrollTop = Math.floor(relY / boxH * enlSH - enlH / 2);
	enl.style.top = (document.all) ? (boxT) + 'px' : (boxT - boxT) + 'px'
	enl.style.left = (document.all) ? (boxL + boxW + 9)  + 'px' : (boxL + boxW + 9 - boxL)  + 'px'
}
			
function hideZoom() {
	var zoom = document.getElementById('zoom');
	var enl = document.getElementById('enlargedImage');
	zoom.style.visibility = 'hidden';
	zoom.style.top = '-500px';
	zoom.style.left = '-500px';
	enl.style.visibility = 'hidden';
}
