function openWin_(prg, args, winname, width, height, side)
{
	// side = (L)eft (R)ight or (C)entre


	if (side == 'R')
	{
		if (screen)
		        leftpos = screen.width - width - 25
		else
        		leftpos = 800 - width - 25
	}
	else
	{// Find Center
		if (screen)
		        leftpos = screen.width / 2 - width / 2
		else
        		leftpos = 400 - width / 2
	}

	if (screen)
	{
		toppos = screen.height / 2 - height / 2 

		if (toppos < 15) toppos = 15
		if (toppos > 100) toppos = 100
	}
	else
		toppos = 15

	if (args=='URL')
	{
	new_win = window.open( prg , winname, 'width= ' + width + ',height=' + height + ',left=' + (side == 'L' ? 5 : leftpos) + ',top='+toppos+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1')
	}
	else
	{
	new_win = window.open('/scripts/mgrqispi.dll?appname=h42&prgname=' + prg + (args != '' ? '&arguments=' + args : '') , winname, 'width= ' + width + ',height=' + height + ',left=' + (side == 'L' ? 5 : leftpos) + ',top='+toppos+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1')
	}
	if (new_win) new_win.focus()

	return

}

function getOpenWin_(prg, args, winname, width, height, side)
{
	// side = (L)eft (R)ight or (C)entre

	if (side == 'R')
	{
		if (screen)
		        leftpos = screen.width - width - 25
		else
        		leftpos = 800 - width - 25
	}
	else
	{// Find Center
		if (screen)
		        leftpos = screen.width / 2 - width / 2
		else
        		leftpos = 400 - width / 2
	}

	if (screen)
	{
		toppos = screen.height / 2 - height / 2 

		if (toppos < 15) toppos = 15
		if (toppos > 100) toppos = 100
	}
	else
		toppos = 15

	if (args=='URL')
	{
	new_win = window.open( prg ,
			winname, 
			'width= ' + width + ',height=' + height + 
			',left=' + (side == 'L' ? 5 : leftpos) +
			',top='+toppos+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
	}
	else
	{
	new_win = window.open('/scripts/mgrqispi.dll?appname=h42&prgname=' +
			prg + (args != '' ? '&arguments=' + args : '') ,
			winname, 
			'width= ' + width + ',height=' + height + 
			',left=' + (side == 'L' ? 5 : leftpos) +
			',top='+toppos+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
	}
	if (new_win) new_win.focus()

	return new_win

}
/***********************************************
* Auto Maximize Window Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for this script and 100's more.
***********************************************/

function max_win()
{
	var intWidth = screen.availWidth * 0.9
	var intHeight = screen.availHeight * 0.9
	var intLeft = (screen.availWidth - (screen.availWidth * 0.9)) / 2
	var intTop = (screen.availHeight - (screen.availHeight * 0.9)) / 2

	top.window.moveTo(intLeft,intTop)

	if (document.all)
	{
		top.window.resizeTo(intWidth,intHeight)
	}
	else if (document.layers||document.getElementById) 
	{
		if (top.window.outerHeight < intHeight || top.window.outerWidth < intWidth)
		{
			top.window.outerHeight = intHeight
			top.window.outerWidth = intWidth
		}
	}
}

