	flag = 0;
	currentImg = 1;
	currentOpacity = 1.0;
	currentOpacityIE = 100;
	
	lastImg = 2;
	
	links_array_january = Array("http://www.reglament.net/news_202.htm", "http://www.reglament.net/news_203.htm");
	pictures_array_january = new Array("pictures/events/january/1.jpg", "pictures/events/january/2.jpg");

	function getNameBrouser()
	{
		var ua = navigator.userAgent.toLowerCase();
		
		// Определим Internet Explorer
		if ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1))
		{
			return NameBrouser = "msie";
		}
		// Opera
		else if (ua.indexOf("opera") != -1)
		{
			return NameBrouser = "opera"
		}
		// Gecko = Mozilla + Firefox + Netscape
		else if (ua.indexOf("gecko") != -1)
		{
			return NameBrouser = "gecko";
		}
		// Safari, используется в MAC OS
		else if (ua.indexOf("safari") != -1)
		{
			return NameBrouser = "safari";
		}
		// Konqueror, используется в UNIX-системах
		else if (ua.indexOf("konqueror") != -1)
		{
			return NameBrouser = "konqueror";
		}
		else return NameBrouser = "unknown";
	}

	function img_preload()
	{
		im = new Array();
		
		for (var i = 0; i < pictures_array_january.length; i++)
		{
			im[i] = new Image();
			im[i].src = pictures_array_january[i];
		}
	}
	
	function changeImg()
	{	
		if(currentImg<lastImg)
		{
			document.getElementById(action_name).innerHTML = "<a href='" + links_array_january[currentImg] + "' class='actions_link'><img src='pictures/events/" + action_name + "/" + (currentImg+1) + ".jpg' class='actions_img' id='" + action_name + "_img'></a>";

			currentImg += 1;
		}
		else
		{
			document.getElementById(action_name).innerHTML = "<a href='" + links_array_january[0] + "' class='actions_link'><img src='pictures/events/" + action_name + "/1.jpg' class='actions_img' id='" + action_name + "_img'></a>";

			currentImg = 1;
		}
	}

	function opacityLow()
	{	
		if((currentOpacity > 0.1) || (currentOpacityIE > 10))
		{
			if(NameBrouser != 'msie') document.getElementById(action_name).style.opacity = +currentOpacity - 0.1;
			else document.getElementById(action_name + "_img").style.filter = "alpha(opacity=" + (+currentOpacityIE - 10) + ")";
			
			//document.getElementById('view').innerHTML = document.getElementById('event1').style.filter;
			
			currentOpacity -= 0.1;
			currentOpacityIE -= 10;
			
			clearTimeout(timeoutId);
			timeoutId = setTimeout(opacityLow, 50);
		}
		else
		{
			changeImg();
			opacityUp();
		}	
	}
	
	function opacityUp()
	{
		if((currentOpacity < 0.9) || (currentOpacityIE < 90))
		{
			if(NameBrouser != 'msie') document.getElementById(action_name).style.opacity = +currentOpacity + 0.1;
			else document.getElementById(action_name + "_img").style.filter = "alpha(opacity=" + (+currentOpacityIE + 10) + ")";
			
			//document.getElementById('view').innerHTML = document.getElementById('event1').style.filter;
			
			currentOpacity += 0.1;
			currentOpacityIE += 10;
			
			clearTimeout(timeoutId);
			timeoutId = setTimeout(opacityUp, 50);
		}
		else
		{
			if(NameBrouser != 'msie') document.getElementById(action_name).style.opacity = 1.0;
			else document.getElementById(action_name + "_img").style.filter  = "alpha(opacity=" + 100 + ")";
			
			init();
		}	
	}

	function init(action)
	{
		getNameBrouser();	
		
		//document.getElementById('event1').style.filter = "alpha(opacity=50)";
		//document.getElementById('event').style.opacity = 0.5;
		//filter: alpha(opacity=50);
		
		if(flag) clearTimeout(timeoutId);
		else 
		{
			action_name = action;
			
			//document.getElementById('view').innerHTML = action_name;
			
			img_preload();
		
			if(NameBrouser != "msie") document.getElementById(action_name).style.opacity = currentOpacity;
			else document.getElementById(action_name + "_img").style.filter  = "alpha(opacity=" + currentOpacityIE + ")";
		}
		

		timeoutId = setTimeout(opacityLow, 1500);
		
		flag = 1;
	}
