
// Open a page in a window, resize and reposition the window in the center.
function openPopupWindow(oLink, sName, nWidth, nHeight)
{
	var sLink = (typeof(oLink.href) == 'undefined') ? oLink : oLink.href;
	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=no,resizable=yes,scrollbars=yes,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(nHeight).concat(',').concat('width=').concat(nWidth).concat(',');
	winDef = winDef.concat('top=').concat((screen.availHeight - nHeight)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.availWidth - nWidth)/2);
	newwin = window.open(sLink, sName, winDef, true);
	newwin.focus();

	return true;
}

// Open a page in a window with toolbar only, resize and reposition the window in the center.
function openPopupWindow2(oLink, sName, nWidth, nHeight)
{
	var sLink = (typeof(oLink.href) == 'undefined') ? oLink : oLink.href;
	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=no,resizable=yes,scrollbars=yes,toolbar=yes,location=no,fullscreen=no,titlebar=yes,height='.concat(nHeight).concat(',').concat('width=').concat(nWidth).concat(',');
	winDef = winDef.concat('top=').concat((screen.availHeight - nHeight)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.availWidth - nWidth)/2);
	newwin = window.open(sLink, sName, winDef, true);
	newwin.focus();

	return true;
}

// Open a page in FULL a window with menu, tool bar, address bar.
function openFullWindow1(oLink, sName)
{
	var sLink = (typeof(oLink.href) == 'undefined') ? oLink : oLink.href;
	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=yes,resizable=yes,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,fullscreen=no,titlebar=yes,left=0,top=0,';
	/*
	winDef = winDef.concat('height=').concat(screen.availHeight-60).concat(',');
	winDef = winDef.concat('width=').concat(screen.availWidth-10);
	*/
	newwin = window.open(sLink, sName, winDef, true);
	newwin.resizeTo(screen.availWidth, screen.availHeight);
	newwin.moveTo(0,0);
	newwin.focus();

	return true;
}

// Open a page in FULL a window without menu, tool bar, address bar.
function openFullWindow2(oLink, sName)
{
	var sLink = (typeof(oLink.href) == 'undefined') ? oLink : oLink.href;
	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=yes,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,left=0,top=0,';
	/*
	winDef = winDef.concat('height=').concat(screen.availHeight-40).concat(',');
	winDef = winDef.concat('width=').concat(screen.availWidth-10);
	*/
	newwin = window.open(sLink, sName, winDef, true);
	newwin.resizeTo(screen.availWidth, screen.availHeight);
	newwin.moveTo(0,0);
	newwin.focus();

	return true;
}

function showMenu(id)
{
	//closeAllMenus();
	document.getElementById(id).style.display = "block";
}

