var tmrNotify;
var tNotify;
var objNotify;


function notifyCall()
{
	objNotify = gObjNotify();
	//objNotify.innerHTML = "<div class=\"fa_close\"><a href=\"#\" onclick=\"hFaNotify()\"><img src=\"close1.jpg\" /></a></div>"
	//+ "<br /><br />Calling you now!";
	sLftNotify();
	shwNotify(true);
	tNotify = 0;
	sTmrNotify();
	setTimeout('closeNotify()',5000);
}

function notifyWaiting()
{
	objNotify = gObjNotify();
	objNotify.innerHTML += ".";
}

function closeNotify()
{
	objNotify = gObjNotify();
	if(objNotify.className == 'show')
	{
		tNotify = -100;
		sTmrNotify();
		return false;
	}
}

function sTmrNotify() {
	tmrNotify = setInterval("fdNotify()",20);
}
function fdNotify() {
	var amt = Math.abs(tNotify+=10);
	if(amt == 0 || amt == 100) clearInterval(tmrNotify);
	amt = (amt == 100)?99.999:amt;
  	
	objNotify.style.filter = "alpha(opacity:"+amt+")";
	objNotify.style.KHTMLOpacity = amt/100;
	objNotify.style.MozOpacity = amt/100;
	objNotify.style.opacity = amt/100;
	
	if(amt == 0) shwNotify(false);
}

function sLftNotify() {
	var w = 160;	// set this to 1/2 the width of the fa 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;

	objNotify.style.left = (l - w)+"px";
}

function gObjNotify() {
	return document.getElementById("divNotify");	
}

function shwNotify(b) {
	(b)? objNotify.className = 'show':objNotify.className = '';	
}

var tmr;
var t;
var obj;

function sFa() {
	obj = gObj();
	sLft();
	shw(true);
	t = 0;
	sTmr();
}

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;
	
	if(amt == 0) shw(false);
}

function sLft() {
	var w = 160;	// set this to 1/2 the width of the fa 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("fa");	
}

function shw(b) {
	(b)? obj.className = 'show':obj.className = '';	
}
