var tmr;
var t;
var obj;

var obj2;
var t2;
var tmr2;

function sFa() {
	obj = gObj();
	sLft();
	shw(true);
	t = 0;
	sTmr();
}

function hFa() {
	t = -100;
	sTmr();
	return false;
}

function sTmr() {
	tmr = setInterval("fd()",1);
}


function fd() {
	var amt = Math.abs(t+=2);
	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;
	
	if(amt == 0) shw(false);
}

function sLft() {
	var w = 261;	// 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 shw(b) {
	(b)? obj.className = 'show':obj.className = '';	
}








// second popup 



function sFa2() {
	
	sLft2();
	shw2(true);
	t2 = 0;
	sTmr2();
}



function hFa2() {
	t2 = -100;
	sTmr2();
	return false;
}



function sTmr2() {
	tmr2 = setInterval("fd2()",1);
}



function fd2() {
	var amt2 = Math.abs(t2+=2);
	if(amt2 == 0 || amt2 == 100) clearInterval(tmr2);
	amt2 = (amt2 == 100)?99.999:amt2;
  	
	document.getElementById('faw2').style.filter = "alpha(opacity:"+amt2+")";
	document.getElementById('faw2').style.KHTMLOpacity = amt2/100;
	document.getElementById('faw2').style.MozOpacity = amt2/100;
	document.getElementById('faw2').style.opacity = amt2/100;
	
	if(amt2 == 0) shw2(false);
}


function sLft2() {
	var wi = 261;	// 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 le = (document.body.innerWidth)? document.body.innerWidth / 2:document.body.offsetWidth / 2;

	document.getElementById('faw2').style.left = (le - wi)+"px";
}




function shw2(b) {
	(b)? document.getElementById('faw2').className = 'show':document.getElementById('faw2').className = '';	
}
