var timer;
var t;

function startAf() {
	setLeft();
	showAf();	
}

function showAf() {
	t = 100;
	moveUp(100000);
	fade(0);	
}

function hideAf() {
	t = 0;
	fade(100);	
}

function fade(amt) {
	if((t == 100 && amt <= t) || (t == 0 && amt >= t)) setFade(amt);
	else if(t == 0) moveUp(0);
    
	amt += (t > 0)? 10:-10;
	
    if(timer!=null) clearInterval(timer);
	timer = setTimeout("fade("+amt+")", 20);
}

function setFade(amt) {
	var obj;
	
	if (document.layers) obj = document.layers.fa;
	else if (document.all) obj = document.all.fa;
	else if (document.getElementById) obj = document.getElementById("fa");
	
	amt = (amt == 100)?99.999:amt;
  
	// IE
	obj.style.filter = "alpha(opacity:"+amt+")";
  
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = amt/100;
  
	// Mozilla and Firefox
	obj.style.MozOpacity = amt/100;
  
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = amt/100;
}

function setLeft() {
	var w = 270;	// set this to the same value of the width property for the pa div in the style sheet, 
					// smaller to move it to the right, larger to move it to the left

	if (document.layers) document.layers.fa.left = ((window.innerWidth / 2) - (w / 2))+"px";
	else if (document.all) document.all.fa.style.left = ((document.body.offsetWidth / 2) - (w / 2))+"px";
	else if (document.getElementById) document.getElementById("fa").style.left = ((window.innerWidth / 2) - (w / 2))+"px";
}

function moveUp(amt) {
	if (document.layers) document.layers.fa.zIndex = amt;
	else if (document.all) document.all.fa.style.zIndex = amt;
	else if (document.getElementById) document.getElementById("fa").style.zIndex = amt;
}



