function getCenterPosition (inWidth) {
	return ((document.body.clientWidth - inWidth) >> 1);
}
function openWindow (width, height, URL, xPos, yPos, scrollbars) {
	if (!xPos) xPos = (document.body.clientWidth-width) >> 1;
	if (!yPos) yPos = (document.body.clientHeight-height) >> 1;	
	window.open(URL, "", "width="+width+", height="+height+", left="+xPos+", top="+yPos+",menubar=no, location=no, toolbar=no, directories=no, status=no, scrollbars="+scrollbars+", resizable=yes");
}
function openDocumentWindow (URL) {
	window.open(URL, "", "width=770, height="+(screen.availHeight-30)+", left=0, top=0,menubar=no, location=no, toolbar=no, directories=no, status=no, scrollbars=yes, resizable=yes");
}

function openBigWindow(URL)
{
	width = screen.availWidth - 50;
	height = screen.availHeight - 50;
	window.open(URL, "", "width="+width+", height="+height+", left=10, top=10,menubar=no, location=no, toolbar=no, directories=no, status=no, scrollbars=no, resizable=yes");
}

function openFile (URL) {
	xPos = Math.round(screen.availWidth - screen.availWidth/100*44);
	width = Math.round(screen.availWidth/100*44 - 5);
	height = Math.round(screen.availHeight-28);
	window.open(URL, "", "width="+width+", height="+height+", left="+xPos+", top=0,menubar=no, location=no, toolbar=no, directories=no, status=no, scrollbars=no, resizable=yes");
}

function newGr3WinPopUp(strWidth, strHeight, strUrl, strMenubar, strToolbar, strStatusbar, strLocation, strDirectories, strScrollbar, strResizable, strXPos, strYPos)
{
	if (!strXPos) strXPos = (document.body.clientWidth-strWidth) >> 1;
	if (!strYPos) strYPos = (document.body.clientHeight-strHeight) >> 1;	
	window.open(strUrl, "", "width="+strWidth+", height="+strHeight+", left="+strXPos+", top="+strYPos+",menubar="+strMenubar+", location="+strLocation+", toolbar="+strToolbar+", directories="+strDirectories+", status="+strStatusbar+", scrollbars="+strScrollbar+", resizable="+strResizable+"");
}