

function changePic(){
	var branch=new Array('trek','fish','snow','sea');
		
	if (tourStore && turnStore){
		tour=tourStore;
		turn=turnStore;
		tourStore=null;
		turnStore=null;
	}
	if (tour==0) counter++;
		if (counter==10 || counter==0) {
			counter=0;
			var menuItem=document.getElementById('button'+tour);
			menuItem.style.background="url('http://www.kamsun/images/menu/menu_"+branch[tour]+"_"+(1+turn)+".jpg')";
			tour+=1;
			if (tour==4) {tour=0;  turn++;} 
			if (turn==4) {turn=0;}
		}
}


function toggle(href, more){
	for (var j=0; j<href.length; j++){
	(function(){
		var s=j;
		var hrefText=href[0].innerHTML; 
		addEvent ( href[s], "click", function() {
			var op = attr(more[s], "open");
				if (op=="yes"){
					slideUp(more[s]);
					attr (more[s], "open", "");
					href[s].innerHTML=hrefText;
					href[s].className="more";
					}
				if(op==""){
					slideDown(more[s]);
					attr (more[s], "open", "yes");
					href[s].className="more_back";
					if (language=="russian") href[s].innerHTML="свернуть";
					else href[s].innerHTML="minimize";
						}
					
				return (false);
		});
	})();
	}
}



var tour=0, turn=0, counter=0;
var tourStore, turnStore;

function start(){
		
	var href = hasClass("details");
	var more=hasClass("hide");
	toggle(href, more);
	
	//var stopp=document.getElementById("stop");
	//var start=document.getElementById("start");
	//var control=document.getElementById("slideshow_control");
	//control.style.display="block";
	//addEvent ( stopp, "click", function() {stopp.src="images/icons/stop_on.gif";start.src="images/icons/start.gif";tourStore=tour; turnStore=turn; clearInterval(timer); });
	//addEvent ( start, "click", function() {start.src="images/icons/start_on.gif";stopp.src="images/icons/stop.gif";timer=setInterval (changePic, 150);});
	//timer=setInterval (changePic, 150);	
}


