/* individuazione lingua browser */

if (navigator.userLanguage) {
	theAgent = navigator.userLanguage;
} else {
	theAgent = navigator.language;
}

if (theAgent.indexOf('it') != -1) {
	lang = 'it';
} else {
	//lang = 'en';
	lang = 'it';
}

/*(C) Andrea Giammarchi*/
function alpha(a){
	var b=this.style;
	if(a==undefined){
		return b.opacity==undefined?100:b.opacity*100
	}else{
		b.opacity=b.MozOpacity=b.KhtmlOpacity=a/100;
		b.filter="alpha(opacity="+a+")";
		return this
	}
}

function enter(a){
	var c=a.style,e=0,d=44;
	setTimeout(function b(){
		e+=(d-e)*0.2;
		c.marginLeft=-e+"px";
		if(e<d-1){
			setTimeout(b,15)
		}else{
			setTimeout(function(){
				a=a.parentNode.appendChild(document.createElement("img"));
				a.setAttribute("width",d+6);
				a.setAttribute("height",14);
				c.marginLeft="6px";
				a.alpha=alpha;
				a.alpha(0).onload=function(){
					var f=0;
					setTimeout(function g(){
						if(a.alpha(f+=5).alpha()<100){
							setTimeout(g,15)
						}else{
							if(!a.onmousedown){
								a.onmousedown=function(){
									location.href='./'+ lang +'/home/';
								}
							}
							a.onmouseover=a.onmouseout=function(){
								this.src="enter.png?"+Math.random()
							};
							a.id="enter"
						}
					},15)
				};
				a.src="enter.png"
			},15)
		}
	},15)
}

var config;

onunload=function(){
	config={}
};

onload=function(){
	config=Liquid({
		speed:40,
		scale:2000,
		src:"topfuel.png?123",
		target:document.getElementById("logo"),
		direction:({top:"top",left:"left",right:"right"})[location.href.split("?")[1]]||"bottom",
		callback:function(b){
			var a=document.getElementById("brand").appendChild(document.createElement("img"));
			a.alpha=alpha;
			a.id = "entra";
			a.alpha(0).onload=function(){
				var c=0;
				setTimeout(function d(){
					if(a.alpha(c+=5).alpha()<100){
						setTimeout(d,15)
					}else{
						setTimeout(function(){
							enter(a);
							if(!a.onmousedown){
								a.onmousedown=function(){
									location.href='./'+ lang +'/home/';
								}
							}							
						},100)
					}
				},15)
			};
			a.src="entra_"+lang+".png"
		}
	})
};
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
												
