// will center popup window
// default is popup with scrollbars only

function centered(whatPage, windowType)
	{
	var sw = 640, sh = 480;
	sw = screen.availWidth; sh = screen.availHeight;
	
	var popW = 460, popH = 300;
	
	var windowName="centered";
	
	// default: scrollbars only
	// if "windowType" not specified
	var otherFeatures = ",menubar=0,scrollbars=1,resizable=0,status=0,directories=0,location=0,toolbar=0";

	// no chrome
	if ( windowType == "none" ) { otherFeatures = ",menubar=0,scrollbars=0,resizable=0,status=0,directories=0,location=0,toolbar=0"; }
	
	// some chrome: season to taste
	if ( windowType == "some" ) { otherFeatures = ",menubar=1,scrollbars=1,resizable=0,status=0,directories=0,location=0,toolbar=1"; }

	// all chrome: a normal window with all chrome, but size controlled and centered;
	if ( windowType == "all" )
		{
		popW = 800;
		popH = 600;
		otherFeatures = ",menubar=1,scrollbars=1,resizable=1,status=1,directories=1,location=1,toolbar=1";
		}
	
	var topPos = ((sh-popH)/2)-80, leftPos = ((sw-popW)/2-15);
	window.open( (whatPage),(windowName),"width="+popW+",height="+popH+",top="+topPos+",left="+leftPos+otherFeatures);
	}

function openParent(url) 
	{ window.opener.location = url; }

function closeWin() 
	{ top.window.close(); }

/*
// regular pop up link
<a href="#" onclick="centered(this.href); return false;" target="_blank">Link</a>

// link that closes pop up and opens new info in parent
<a href="#" onclick="openParent(this.href); closeWin(); return false;" target="_blank">Link</a>
*/