
	function rightClick(){
		//alert("rightclick entered");
		var indexString = document.getElementById("ctl00_ContentPlaceHolder1_CurrInd").value;
		var lastIndexString = document.getElementById("ctl00_ContentPlaceHolder1_LastInd").value;
		if ((!isNaN(parseInt(indexString))) && (!isNaN(parseInt(indexString)))) {
			var ind = parseInt(indexString);
			var last = parseInt(lastIndexString);
			if((ind < 28) && (ind < last)){
				ind++;
				bindGallery(ind, ind, 0);
				document.getElementById("ctl00_ContentPlaceHolder1_CurrInd").value = ind;
			}
		}
	}
	
	function leftClick(){
		//alert("leftclick entered");
		var indexString = document.getElementById("ctl00_ContentPlaceHolder1_CurrInd").value;
		if(!isNaN(parseInt(indexString))){
			var ind = parseInt(indexString);
			if(ind > 1){
				if(ind > 28){ind = 28;}
				ind--;
				bindGallery(ind, ind, 0);
				document.getElementById("ctl00_ContentPlaceHolder1_CurrInd").value = ind;
				//alert(document.getElementById("ctl00_ContentPlaceHolder1_CurrInd").value);
			}
		}
	}
	
	function bindGallery(ind, lind, change){
		//alert(document.getElementById("ctl00_ContentPlaceHolder1_largeImage").src.slice(-18));
		//lind = lind - 1;
		//alert(document.getElementById("ctl00_ContentPlaceHolder1_AltText").value.split(";")[lind+1]);
		//alert(lind);
		if(document.getElementById("ctl00_ContentPlaceHolder1_largeImage").src.slice(-18) != "/images/pic-na.jpg"){
			var altTextString = document.getElementById("ctl00_ContentPlaceHolder1_AltText").value;
			var largeImgsString = document.getElementById("ctl00_ContentPlaceHolder1_LargeImg").value;
			var smallImgsString = document.getElementById("ctl00_ContentPlaceHolder1_SmallImg").value;  
			if(change == 1){
				if (altTextString.split(";")[lind - 1] != undefined){
					document.getElementById("ctl00_ContentPlaceHolder1_ImageText").innerHTML = altTextString.split(";")[lind - 1];
				}
				if (largeImgsString.split(";")[lind] != undefined){
					document.getElementById("ctl00_ContentPlaceHolder1_largeImage").src = largeImgsString.split(";")[lind];
				}
			}
			if (smallImgsString.split(";")[ind] != undefined){
				document.getElementById("ctl00_ContentPlaceHolder1_lImage").src = smallImgsString.split(";")[ind];
			}
			if (smallImgsString.split(";")[ind + 1] != undefined){
				document.getElementById("ctl00_ContentPlaceHolder1_mImage").src = smallImgsString.split(";")[ind + 1];
			}
			if (smallImgsString.split(";")[ind + 2] != undefined){
				document.getElementById("ctl00_ContentPlaceHolder1_rImage").src = smallImgsString.split(";")[ind + 2];
			}
		}
	}
	
	function viewImg(lind){
		//alert("viewimg entered");
		var indexString = document.getElementById("ctl00_ContentPlaceHolder1_CurrInd").value;
		//alert(indexString);
		if(!isNaN(parseInt(indexString))){
			var ind = parseInt(indexString);
			lind = lind + ind;     
			bindGallery(ind, lind, 1);
		}
	}

