var popup_content = null;
var popup_background = null;
var timer = null;
var showTimer = null;

function show_tax_popup_delay(delay)
{
	if (showTimer != null)
		clearTimeout(showTimer);
	showTimer = setTimeout("show_tax_popup()", delay);
	
	return false;
}

function show_tax_popup()
{
	popup_content = document.getElementById('pTaxPopup_content');
	popup_background = document.getElementById('pTaxPopup_background');

	positionDiv();
	timer = setInterval("positionDiv()", 250);
	popup_background.style.display = 'block';
	popup_content.style.display = 'block';

	return false;
}

function hide_tax_popup()
{
	document.getElementById('pTaxPopup_content').style.display = 'none';
	document.getElementById('pTaxPopup_background').style.display = 'none';

	if (timer != null) {
		clearTimeout(timer);
		timer = null;
	}

	if (showTimer != null) {
		clearTimeout(showTimer);
		showTimer = null;
	}

	return false;
}

function positionDiv()
{
	scrollTop = document.documentElement.scrollTop;
	if (scrollTop == 0)
		scrollTop = document.body.scrollTop;

	y = scrollTop + 150;

	x = parseInt((document.body.clientWidth - 755) / 2);

	popup_content.style.top = y + 'px';
	popup_content.style.left = x + 'px';
	popup_background.style.top = y + 'px';
	popup_background.style.left = x + 'px';
}