var entered = false;
function enter() {
	if (entered==false) {
		entered = true;
		scroll(0,0);
		//hide('bg',500);
		//setTimeout("hide('welcome',250)",400);
		hide('welcome',250);
	}
}

function hide(id,time) {
	e=document.getElementById(id);
	if (e) {
		if (e.style.display != "none") {
			if (time != false) {
				if (time == null) {
					time = 250;
				}
				p=1000/20;
				t=0;
				s= 100/(time/p);
				o=0;
				o=100;
				changeOpac(o,id);
				while (o>=0) {
					setTimeout("changeOpac("+Math.round(o)+",'"+id+"')",t);
					o=o-s;
					t = t+p;
				}
				setTimeout('document.getElementById("'+id+'").style.display = "none";',t+p);
			}
			else {
				e.style.display = "none"
			}
		}
	}
}
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}
function mouse(e) {
	document.onmousemove = null;
	enter();
}
function pageload() {
	document.onmousemove = mouse;
}
function pageunload() {

}
if( window.addEventListener ) {
    window.addEventListener( 'load', pageload, false );
    window.addEventListener( 'unload', pageunload, false );
} else if( document.addEventListener ) {
    document.addEventListener('load' , pageload, false );
    document.addEventListener( 'unload', pageunload, false );
} else if( window.attachEvent ) {
    window.attachEvent( 'onload', pageload );
    window.attachEvent( 'onunload', pageunload );
} else {
    if( window.onload ) { window.XTRonload = window.onload; }
    if( window.onunload ) { window.XTRonunload = window.onunload; }
    window.onload = pageload;
    window.onunload = pageunload;
}
