// 6/30/04	YG	Open - create file with functions
//                      Closed
// 7/1/04	YG	Open - change window_resize function

//set width and height of window, and center
function window_resize (vWidth, vHeight, maxWidth, maxHeight)
{

/***************************

        vWidth = 650;
        vHeight = 570;
        maxWidth = screen.availWidth-20;
        maxHeight = screen.availHeight-20;

        window_resize(vWidth, vHeight, maxWidth, maxHeight);


*****************************/

	var tmp, vLeft, vTop;

        if (vWidth > maxWidth)
        {
                vWidth = maxWidth;
        }

        if (vHeight > maxHeight)
        {
                vHeight = maxHeight;
        }

	//center on screen
	tmp = (screen.availWidth - vWidth) / 2;
	vLeft = tmp;
	tmp = (screen.availHeight - vHeight) / 2;
	vTop = tmp;

        top.window.moveTo(vLeft,vTop);

        if (document.all)
        {
                top.window.resizeTo(vWidth,vHeight);
        }
        else if (document.layers||document.getElementById)
        {
                if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
                {
                        top.window.outerHeight = vHeight;
                        top.window.outerWidth = vWidth;
                }
        }
}

function window_maximize()
{

/***********************************************
* 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.
***********************************************/

	top.window.moveTo(0,0);

	if (document.all) {

		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if (document.layers||document.getElementById) {

		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){

			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
}
