//Minimalist Window Manager Script version 011504
//copyright © 2003 Hal Barwood & Finite Arts
//
//globals...
newurlwin = null;
opentime = null;

function openurlwin(newurl, name, w, h, m, s, r)
{
	//NOTE:
	//newurl == destination page
	//name   == new window name (never seems to work, but is required)
	//w      == window width
	//h      == window height
	//m      == menubar ("yes" or 1 means new window has menubar)
	//s      == scrollbars ("yes" or 1 means new window has scrollbars)
	//r	 == resizable ("yes" or 1 means new window can be resized)
	
	//make sure window will fit onscreen...
	var sw = screen.width * 0.8;
	var sh = screen.height * 0.8;
	if (w > sw || w == 0)
	{
		w = sw;
	}
	if (h > sh || h == 0)
	{
		h = sh;
	}

	//place window onscreen...
	var wl = (screen.width - w) / 2;
	var wt = (screen.height - h) / 2.5;

	//assemble properties...
	var wprops = 'width='+w+', height='+h+', top='+wt+', left='+wl+', menubar='+m+', scrollbars='+s+', resizable='+r+'';

	//open up...
	newurlwin = window.open(newurl, name, wprops);

	//set self-destruct...
	//////opentime = setTimeout("closeurlwin()", 180000);
}

//get rid of window...
function closeurlwin()
{
	if (newurlwin != null)
	{
		newurlwin.close();
	}
}
