window.onload = function(){
	var bg = document.getElementById('intro');
	var diffY = (parseInt(window.screen.availHeight - 930)/2);
	var diffX = (parseInt(window.screen.availWidth - 830)/2);
	bg.style.top = (diffY>0?diffY:0)+'px';
	bg.style.left = (diffX>0?diffX:0)+'px';
	bg.style.visibility = 'visible';
	if(!nC.checkName('IE')){
		var y = document.getElementById('y');
		var g = document.getElementById('g');
		var b = document.getElementById('b');
		var imgY = new Image();
		var imgG = new Image();
		var imgB = new Image();
		var imgC = new Image();
		imgY.src = 'visual/img/layout/zolty3.png';
		imgG.src = 'visual/img/layout/ziel1.png';
		imgB.src = 'visual/img/layout/nieb_2.png';
		imgC.src = 'visual/img/layout/cien.jpg';
		var introTree = document.getElementById('bg');
		introTree.style.opacity = '0';
		var cien = document.getElementById('cien');
		
		showL = function(k,s){
			if(k==0){
				s.style.height = k+'%';
				s.parentNode.style.zIndex = -1;
				return;
			}
			s.style.height = k+'%';
			k -= 0.25;
			window.setTimeout(showL,10,k,s);
		}
		showL2 = function(k,s){
			if(k==0){
				s.style.height = k+'%';
				s.parentNode.style.zIndex = -1;
				return;
			}
			s.style.height = k+'%';
			k -= 0.25;
			window.setTimeout(showL2,10,k,s);
		}
		showTreeV = function(img,i,menu,logo,footer){
			if(i>1){
				menu.style.opacity = '1';
				img.style.opacity = '1';
				logo.style.opacity = '1';
				footer.style.opacity = '1';
				return;
			}
			img.style.opacity = new String(i);
			i+=0.006;
			window.setTimeout(showTreeV,5,img,i,menu,logo,footer);
		}
		showTree = function(){
			var menu = document.getElementById('menu');
			var logo = document.getElementById('logo');
			var footer = document.getElementById('footer');
			menu.style.opacity = '0';
			logo.style.opacity = '0';
			footer.style.opacity = '0';
			var introTree = document.getElementById('bg');
			introTree.style.opacity = '0';
			var loadLabel = document.getElementById('loadLabel');
			loadLabel.parentNode.removeChild(loadLabel);
			var show1 = document.getElementById('show1');
			var show2 = document.getElementById('show2');
			var i =50;
			window.setTimeout(showL,200,i,show1);
			window.setTimeout(showL2,200,i,show2);
			window.setTimeout(showTreeV,200,introTree,0,menu,logo,footer);
		}
		imgPreLoad = function(imgY,imgG,imgB,imgC){
			if(imgY.complete && imgG.complete && imgB.complete && imgC.complete){
				y.style.background = 'url('+imgY.src+') no-repeat';
				g.style.background = 'url('+imgG.src+') no-repeat';
				b.style.background = 'url('+imgB.src+') no-repeat';
				cien.setAttribute('src',imgC.src);
				window.setTimeout(showTree,1000);
				return;
			}
			window.setTimeout(imgPreLoad,10,imgY,imgG,imgB,imgC);
		}
		imgPreLoad(imgY,imgG,imgB,imgC);
	}
}