var nCurrentIndex = 100000 ;
var bFirstClick = true;

var arImages = new Array();
var sPath = "files/Pictures/Small/";
var sPopupPath = "files/Pictures/Big/";
/////////////////////////////////////////////////////////////////////
function OnArrowClick(nIndex, nDirection){		
	if(arImages.length < 2) return;
	var oLeftArrow = Find('galleryLeftArrow');
	var oRgithArrow = Find('galleryRgithArrow');	
	
	var oIndex0 = Find('h_index_0');
	var oIndex1 = Find('h_index_1');
	var oIndex2 = Find('h_index_2');
	
	var oGalleryImage0 = Find('img_Gallery_0');
	var oGalleryImage1 = Find('img_Gallery_1');
	var oGalleryImage2 = Find('img_Gallery_2');	
		
	if(bFirstClick){
		oGalleryImage0.src = sPath + arImages[0];
		oIndex0.value = 0;
		oGalleryImage1.src = sPath + arImages[1];
		oIndex1.value = 1;
		oGalleryImage2.src = sPath + arImages[2];
		oIndex2.value = 2;				
		bFirstClick = false;		
	}else{
		if(nDirection == 2){
			nCurrentIndex++;
		}	else{			
			nCurrentIndex--;
		}			
		
		for(i = 0; i < 3; i++){	
			var nArrayIndex = (nCurrentIndex + i) % arImages.length;						
			eval("oGalleryImage" + i + ".src = '" + sPath + arImages[nArrayIndex] + "';");				
			eval("oIndex" + i + ".value = " + (nArrayIndex) + ";");	
		}		
	}	
}		