
function OpenWin(address, winName, width, height)
{
	var newLeft = (window.screen.availWidth - width) / 2;
	var objPopup = window.open(address, winName, 'width=' + width + ',height=' + height + ',top=' + 100 + ',left=' + newLeft + ',menubar=no,toolbar=no,scrollbars=yes,resizable=yes,directories=no,status=yes');
	objPopup.focus();
}

function AutoSizePopup()
{
	var viewableHeight = 0;
	var counter = 0;
		// Workaround fix for Firefox 1.0.x (not necessary for v1.5)
	for (counter = 1; counter <= 50; counter++)
		window.resizeBy(0, (document.body.scrollHeight - document.documentElement.clientHeight) / 2);
	window.resizeBy(0, document.body.scrollHeight - document.documentElement.clientHeight);
}

function AutoSizePopupCompare()
{
	var viewableHeight = 0;
	var counter = 0;
		// Workaround fix for Firefox 1.0.x (not necessary for v1.5)
if(document.body.scrollWidth==740)
{
	for (counter = 1; counter <= 50; counter++)
		window.resizeBy(0, (document.body.scrollHeight - document.documentElement.clientHeight) / 2);
	window.resizeBy(0, document.body.scrollHeight - document.documentElement.clientHeight);
}
}

function ClosePopup()
{
	window.close();
}

function resizeNote()
{

document.getElementById('noteiframe').height = document.documentElement.clientHeight - 150;

}
function resizeBioTree()
{
document.getElementById('noteiframe').height = document.documentElement.clientHeight -200;

var MasterPanelObj = document.getElementById("MasterPanel");
MasterPanelObj.style.height = (document.documentElement.clientHeight - 130) + "px";
}

function ChangePanel(PanelNum)
{
	var counter = 0;
	var panelCount = 0;
	
	for (counter = 1, panelCount = 0; counter <= 10; counter++)
		if (document.getElementById("Panel" + counter))
			panelCount++;
	
	for (counter = 1; counter <= panelCount; counter++)
	{
		document.getElementById("Panel" + counter).style.display = (counter == PanelNum ? "block" : "none");
		document.getElementById("Bull" + counter).style.visibility = (counter == PanelNum ? "visible" : "hidden");
	}
}

function ChangeTab(TabNum)
{
	var counter = 0;
	var tabCount = 0;

	while (document.getElementById("Tab" + (tabCount + 1)))
		tabCount++;

	for (counter = 1; counter <= tabCount; counter++)
	{
		if (counter == TabNum)
		{
			document.getElementById("Tab" + counter).style.display = "block";
			document.getElementById("TabLbl" + counter).className = "Active";
		}
		else
		{
			document.getElementById("Tab" + counter).style.display = "none";
			document.getElementById("TabLbl" + counter).className = "Inactive";
		}
	}
}