	var tab_num = 1;
	var stoper = 0;

	
	function start()
	{
		for(i=1;i<4;i++)
		{
			
			document.getElementById("MTelem"+i+"_l").onclick=function(){show(this.id); stop_it()};
		}
		
		tab_switcher();
	}
	
	function tab_switcher()
	{
		if(window.stoper==0)
		{
			show("MTelem"+tab_num+"_l");
			window.tab_num++;
			
			if(window.tab_num>3)
			{
				window.tab_num=1;
			}
					
			setTimeout("tab_switcher()",odstep);
		}
	}

	function stop_it()
	{
		window.stoper=1;
	}
	
	function show(what)
	{
		var tab_lewy=document.getElementById(what);
		var tab_prawy=document.getElementById(what.replace("_l","_r"));

		for(i=1;i<4;i++)
		{
			var tab_l = document.getElementById("MTelem"+i+"_l");
			var tab_r = document.getElementById("MTelem"+i+"_r");	
			tab_l.className=tab_l.className.replace(" active","");
			tab_r.className="deactived";		
		}
		
		tab_lewy.className=tab_lewy.className+" active";		
		tab_prawy.className="active";		
		
	}

start();

