

// open [url] in the parent (opener) window if such exists,
// or failing that, in a new window with window name [name]

function getURLinParent(url, name, trytop) {
	if ( ! window.opener || window.opener.closed ) {
		var op = window.open(url, name);
	} else {
		var op = window.opener;
		if (trytop && op.top.location) {
			op.top.location = url;
		} else {
			op.location = url;
		}
	}
	op.focus();
}

