// ProductDetails.js
	var productShots = new Array();
	var img ;
	var timer;
	var imgIndex = 0; 
	
	function goPrevImg() {
		if (imgIndex > 0 ) {
			imgIndex--;
		} else imgIndex = productShots.length - 1;
		element.src =  productShots[imgIndex].src;
		refreshIndigator();
	}

	function goNextImg() {
		if (imgIndex < productShots.length - 1 ){
			imgIndex++;
		} else {
			imgIndex = 0;
		}
		
		element.src = productShots[imgIndex].src;
		refreshIndigator();
	}
	
	function refreshIndigator() {
		if (!curIndexElement)curIndexElement = document.getElementById('currentIndex');
		curIndexElement.value =  (imgIndex + 1) + '/' + productShots.length;
	}
	
	function play() {
		clearInterval(timer);
		timer = window.setInterval("goNextImg()", 2000);
	}
	
	function stop() {
		clearInterval(timer);
	}
 
 	function zoomImg(){
		element.src = productShots[imgIndex].src;
		imgOpen(element.src,''); 		
	}
