var tmr;
var t;
var obj;
var bgobj;
var bgobj2;

function sFa() {
	obj = gObj();
	bgobj = bgObj();
	sLft();
	shw(true);
	t = 0;
	sTmr();
	setTimeout('hFa()',5000);
}

function hFa() {
	t = -100;
	sTmr();
	return false;
}

function sTmr() {
	tmr = setInterval('fd()',20);
}

function fd() {
	var amt = Math.abs(t+=10);
	if(amt == 0 || amt == 100) clearInterval(tmr);
	amt = (amt == 100)?99.999:amt;

	obj.style.filter = "alpha(opacity:"+amt+")";
	obj.style.KHTMLOpacity = amt/100;
	obj.style.MozOpacity = amt/100;
	obj.style.opacity = amt/100;

	bgobj.style.filter = "alpha(opacity:"+ (amt * .6) +")";
	bgobj.style.KHTMLOpacity = amt/150;
	bgobj.style.MozOpacity = amt/150;
	bgobj.style.opacity = amt/150;

	if( typeof bgobj2.style != "undefined" ) {
		bgobj2.style.filter = "alpha(opacity:"+ (amt * .6) +")";
		bgobj2.style.KHTMLOpacity = amt/150;
		bgobj2.style.MozOpacity = amt/150;
		bgobj2.style.opacity = amt/150;
	}

	if(amt == 0) shw(false);
}

function sLft() {
	var w = 170;	// set this to 1/2 the width of the faw div defined in the style sheet
			// there's not a reliable way to retrieve an element's width via javascript!!

	var l = (document.body.innerWidth)? document.body.innerWidth / 2:document.body.offsetWidth / 2;

	obj.style.left = (l - w)+"px";
}

function gObj() {
	return document.getElementById("faw");
}

function bgObj() {
	return document.getElementById("fawbg");
}


function shw(b) {
	(b)? obj.className = 'show':obj.className = '';
	(b)? bgobj.className = 'show':bgobj.className = '';
	if( typeof bgobj2.style != "undefined" ) {
		(b)? bgobj2.className = 'show':bgobj2.className = '';
	}
}
