MAX_PICTERS=5  <!--max picters to show  in gallery -->
MAX_IMG_VIEW=1 <!--max picters to show in one row-->
<!--don't  touch the code bellow to correct work of the gallery-->
var arr=new Array(
	'<img src="images/img.jpg" alt="" title="">', 
	'<img src="images/img.jpg" alt="" title="">',
	'<img src="images/img.jpg" alt="" title="">',
	'<img src="images/img.jpg" alt="" title="">',
	'<img src="images/img.jpg" alt="" title="">'
	);
MIN_PICTERS=1 
count=1	
page_count=5
function gallery_load(){
	if (MAX_IMG_VIEW>MAX_PICTERS){MAX_IMG_VIEW=MAX_PICTERS}
	document.getElementById('gallery').style.background='url("images/img_gallery_'+count+'.jpg") no-repeat 6px 6px';
	document.getElementById('g_link').innerHTML=arr[count-1];
	pages(count);
}								
function gallery(){	
	if (MAX_IMG_VIEW>MAX_PICTERS){MAX_IMG_VIEW=MAX_PICTERS}
	document.getElementById('gallery').style.background='url("images/img_gallery_'+count+'.jpg") no-repeat 6px 6px';
	document.getElementById('g_link').innerHTML=arr[count-1];
	pages(count);
}
function pages(numb){
	var p=numb;
	for(var i=1;i<=page_count;i++){
		if(i==p){
			document.getElementById('p'+i).className="active";
		}
		else{
			document.getElementById('p'+i).className="page";
		}
	}
}
function left(){						
	count--;
	if (count<(MIN_PICTERS)){count=MAX_PICTERS}					
	gallery();												
}
function right(){	
	count++;
	if (count>MAX_PICTERS){count=MIN_PICTERS}	
	gallery();	
}	
