// JavaScript Document


		       
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-->
MIN_PICTERS=1 
count=1	
function gallery_load(){
	
	var lis = document.getElementById("gal_pages").getElementsByTagName("A");
		lis[0].className += " gal_nav_on";
		
	if (MAX_IMG_VIEW>MAX_PICTERS){MAX_IMG_VIEW=MAX_PICTERS}		
	for (i=1;i<=MAX_IMG_VIEW;i++){
		document.getElementById('gallery').innerHTML+='<div class="bg_1" ><img src="images/img_gallery_'+i+'.jpg"  alt=""  border="0px" id="main_pic'+i+'" style="cursor:pointer;" align="left" width="770" height="340"/></div>';						
	}
}								
function gallery(){	
	if (MAX_IMG_VIEW>MAX_PICTERS){MAX_IMG_VIEW=MAX_PICTERS}	
	document.getElementById('gallery').innerHTML='';
	for (i=count;i<(count+MAX_IMG_VIEW);i++){
		number_of_img=i;
		if (number_of_img>MAX_PICTERS){number_of_img=(i-MAX_PICTERS)}	
		document.getElementById('gallery').innerHTML+='<div class="bg_1" ><img src="images/img_gallery_'+number_of_img+'.jpg"  alt=""  border="0px" id="main_pic'+number_of_img+'"  style="cursor:pointer;" align="left" width="770" height="340"/></div>';						
	}
	
	var lis = document.getElementById("gal_pages").getElementsByTagName("A");
		for (var j=0;j<lis.length;j++)
		 	{lis[j].className = "gal_page";  }

		if (count<=1){lis[0].className += " gal_nav_on";}
		else { if ((count>1)&&(count<=2)){lis[1].className += " gal_nav_on";}
				else { if (count<=5){lis[count-1].className += " gal_nav_on";}
				}
		}
	
}

function left(){						
	count--;
	if (count<(MIN_PICTERS)){count=MAX_PICTERS}					
	gallery();												
}
function right(){	
	count++;
	if (count>MAX_PICTERS){count=MIN_PICTERS}	
	gallery();	
}	


















