// global.js
var globalLastId = '';

function toggleDiv(id)
{

	if ((globalLastId)&&(globalLastId != id))
	{
		divOff(globalLastId);
	}
	el = document.getElementById(id);
	
	if (el.style.display == 'block')
	{
		el.style.display = 'none';
	}
	else
	{
		el.style.display = 'block';
		globalLastId = id;
	}
	hideFocus();
}

function divOff(id)
{
	el = document.getElementById(id);
	el.style.display = 'none';
	hideFocus();
}

function divOn(id)
{
	el = document.getElementById(id);
	el.style.display = 'block';
	hideFocus();
}

function hideFocus()
// used to hide the "#" click focus in Firefox, requires div#hidden display: none
// and a text form id hideme
{
		if (navigator.userAgent.indexOf("Firefox") != -1)
		{
			document.getElementById('hideme').focus();
		}

}

function getWinHeight()
{
    if (window.innerHeight) return window.innerHeight - 18;
  	else if (document.documentElement && document.documentElement.clientHeight) 
  		return document.documentElement.clientHeight;
  	else if (document.body && document.body.clientHeight) 
  		return document.body.clientHeight;
  	else if (document.body && document.body.parentNode && document.body.parentNode.clientHeight) 
  		return document.body.parentNode.clientHeight;
}

function getWinWidth()
{
    if (window.innerWidth) return window.innerWidth - 18;
    else if (document.documentElement && document.documentElement.clientWidth) 
  		return document.documentElement.clientWidth;
    else if (document.body && document.body.clientWidth) 
  		return document.body.clientWidth;
  	else if (document.body && document.body.parentNode && document.body.parentNode.clientWidth) 
 		return document.body.parentNode.clientWidth;
}

