// Когда страница полностью загружена
$(document).ready(function(){
	    //$("#accordion > div > h5:first").addClass("active");
	    //$("#accordion > div > div:not(:first)").hide();
	 
	    $("#accordion > div > h5").click(function(){
	 
	        $(this).next("div").slideToggle("slow")
	        .siblings("div:visible").slideUp("slow");
	        $(this).toggleClass("active");
	        $(this).siblings("h5").removeClass("active");
	     });
	  
	 });

function photorefresh(id)
	{
	for (i=1;i<showfirst;i++)
		{
		document.getElementById("photo_"+i).style.display="none";
		}
	for (i=0;i<showphotos;i++)
		{
			var z=i+showfirst;
			if (z<=allphotos) 
			{
				document.getElementById("photo_"+z).style.display='';
			}
		}
	var z = showphotos + showfirst;
	for (i=z;i<=allphotos;i++)
		{
			document.getElementById("photo_"+i).style.display='none';
		}
	if (showfirst==1)
	    {
	    	document.getElementById("scroll_left").style.display='none';
	    } else {
	    	document.getElementById("scroll_left").style.display='';
	    }
	if (allphotos<z)
	    {
	    	document.getElementById("scroll_right").style.display='none';
	    } else {
	    	document.getElementById("scroll_right").style.display='';
	    }
	if (id==0)
	{
	for(i=1;i<=allphotos;i++)
	    {
	    //document.getElementById("maintext_"+i).style.display='none';
	    }
	}
	void(1);
	}

function turnleft()
	{
	if (showfirst > 1)
		{
		showfirst = showfirst - 1;
		photorefresh(1);
		}
	}

function turnright()
	{
	var z = showphotos + showfirst;
	if (z <= allphotos)
		{
		showfirst = showfirst + 1;
		photorefresh(1);
		}
	}

