function popup(pageurl, windowname, pagetosend, wwidth, wheight)
{
	if (! window.focus)return true;
	var href;
	if (typeof(pageurl) == 'string')
		href=pageurl;
	else
		href=pageurl.href;
	href = href + '?page=' + pagetosend;
	
	if ((wwidth > 0) && (wheight > 0)) {
		var w = wwidth, h = wheight;
		if (document.all || document.layers) {
			w = screen.availWidth;
			h = screen.availHeight;
		}
		leftPos = (w-wwidth)/2;
		topPos = (h-wheight)/2;
		stylestr = 'width=' + wwidth + ',height=' + wheight + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=yes';
	} else {
		stylestr = 'scrollbars=yes';
	}
	window.open(href, windowname, stylestr);
	return false;
}

function targetopener(mylink, closeme, closeonly)
{
	if (!(window.focus && window.opener))
		return true;
	window.opener.focus();
	if (!closeonly)
		window.opener.location.href=mylink.href;
	if (closeme)
		window.close();
	return false;
}
