			var rate_fadein_opacity = 0;
			var rate_fadeout_opacity = 100;
			var is_ie = (document.all && document.getElementById);
			var is_moz = (!document.all && document.getElementById);
			var is_opera = (navigator.userAgent.indexOf("Opera") > -1);
						
			function fade_out(it) {
				var item = document.getElementById('album_'+ it);
				if (!item) return;
				if(rate_fadeout_opacity > 0) {
					rate_fadeout_opacity -= 10;
					if(is_opera) {
						rate_fadein_opacity = 0;
					} else if(is_ie) {
						item.style.filter = 'alpha(opacity=' + rate_fadeout_opacity + ')';
					} else if(is_moz) {
						item.style.MozOpacity = (rate_fadeout_opacity/100);
					}
					setTimeout(function(){fade_out(it)},30);
				} else {
					rate_fadeout_opacity = 0;
					rate_fadein_opacity = 0;
					current_img = alb[current_alb][current_img+1]?current_img+1:0;
					currents[current_alb] = current_img;
					img = alb[current_alb][current_img];
					item.src = img;
					setTimeout(function(){fade_in(current_alb)},100);
				}
			}

			function fade_in(it) {
				var item = document.getElementById('album_'+it);
				if (!item) return;				
				if(rate_fadein_opacity < 100) {
					rate_fadein_opacity += 10;
					if(is_opera)  {
						rate_fadein_opacity = 100;
					} else	 if(is_ie) {
						item.style.filter = 'alpha(opacity=' + rate_fadein_opacity + ')';
					} else	 if(is_moz) {
						item.style.MozOpacity = (rate_fadein_opacity/100);
					}
					setTimeout(function(){fade_in(it)}, 30); 
				} else {
					rate_fadein_opacity = 100;
					rate_fadeout_opacity = 100;
					current_alb = alb[current_alb+1]?current_alb+1:0;
					current_img = currents[current_alb];
					img = alb[current_alb][current_img];
					setTimeout(function(){fade_out(current_alb)}, 1000);
				}
			}

			if (window.addEventListener)
				window.addEventListener('load',so_init,false);
			else
				window.attachEvent('onload',so_init);


			function so_init()
			{
				if(!document.getElementById || !document.createElement)return;
				for(i=0; i<alb.length; i++) {
					var item = document.getElementById('album_'+ i);
					var img = alb[i][currents[i]];
					if (item && img) {				
						item.src = img;
					}
				}
				setTimeout(function(){fade_out(current_alb)}, 1000);
			}