if (document.images)
	testImage = new Image();

function popup (u,n,w,h,tb,sb,linked)
{
	var verticalAdjustment = 30;

	var url = 'javascript:';
	var name = 'untitled';
	var width = 600;
	var height = 400;

	var menubar = 'no';
	var toolbar = 'no';
	var location = 'no';
	var directories = 'no';
	var scrollbars = 'no';
	var resizable = 'no';
	var status = 'no';

	if (u == null) { u = url; }
	if (n == null) { n = name; }
	if (w == null) { w = width; }
	if (h == null) { h = height; }

	if (tb == null) { tb = toolbar; } else if (tb) { tb = 'yes'; } else { tb = 'no'; }
	if (sb == null) { sb = scrollbars; } else if (sb) { sb = 'yes'; } else { sb = 'no'; }

	var left = Math.round((window.screen.availWidth - w) / 2);
	var top = Math.round((window.screen.availHeight - h) / 2) - verticalAdjustment;

	if (left < 0) { left = 0; }
	if (top < 0) { top = 0; }

	var f =	'menubar='+menubar+','+
			'toolbar='+tb+','+
			'location='+location+','+
			'directories='+directories+','+
			'scrollbars='+sb+','+
			'resizable='+resizable+','+
			'status='+status+','+
			'width='+w+','+
			'height='+h+','+
			'left='+left+','+
			'top='+top;

	thePopupWindow = window.open(u,n,f);

	if (thePopupWindow.opener == null)
		thePopupWindow.opener = window;

	if (window.focus)
		thePopupWindow.focus();

	if (linked)
		window.onunload = function () { thePopupWindow.close(); }
}

function popupLinked (u,n,w,h,tb,sb)
{
	popup(u,n,w,h,tb,sb,true);
}
