<!--

function getElementPosition(elemID){
var offsetTrail = document.getElementById(elemID);
var offsetLeft = 0;
var offsetTop = 0;
while (offsetTrail){
	offsetLeft += offsetTrail.offsetLeft;
	offsetTop += offsetTrail.offsetTop;
	offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
	offsetLeft += document.body.leftMargin;
	offsetTop += document.body.topMargin;
	}
	return {left:offsetLeft,top:offsetTop};
}

function initImage() {
	imageId = 'FadeOutObject';
	image = document.getElementById(imageId);
	setOpacity(image, 100);
	image.style.visibility = "visible";
	fadeIn(imageId,100);
}

function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity >= 0) {
			setOpacity(obj, opacity);
			opacity -= 10;
			//window.setTimeout("fadeIn('"+objId+"',"+opacity+")", timeout in ms);
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 200);
		}
	}
}

function setOpacity(obj, opacity) {
	//opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

function SetZIndexModules() {
	document.getElementById('ToShow').style.position = 'relative';
	document.getElementById('ToShow').style.zIndex = +1;
}

function ShowPlayer() {
	document.getElementById('player').style.position = 'relative';
	//position is necessary to make zIndex work
	document.getElementById('player').style.zIndex = +1;
	document.getElementById('player').style.visibility = 'visible';
}


/*
NOTE for setTimeout function : each setTimeout runs its function x ms after the whole window.onload script has started
so a setTimeout doesn't start ONCE the previous setTimeout has been executed, as they all have the starting time reference
example : having 3 consecutive setTimeout with 100ms delay will make all 3 start at the same time (after 100ms),
because all 3 set the delay relatively to the start of the window.onload script.
To have each one running after the other, increase each delay relatively to the whole script start
*/

window.onload = function() {

document.getElementById('FadeOutObject').style.top = getElementPosition('PositionReference').top;
document.getElementById('FadeOutObject').style.left = getElementPosition('PositionReference').left;

window.setTimeout("initImage()", 1000);

//this function has to be executed, otherwise links in modules can not be clicked
window.setTimeout("SetZIndexModules()", 2000);

window.setTimeout("ShowPlayer()", 3000);

//alert(getElementPosition('PositionReference').top+'|'+getElementPosition('PositionReference').left);
//alert(navigator.appName);
//if(navigator.appName == 'Microsoft Internet Explorer'){
}

// -->