function createPopup(width, height, doc) {
	popup=window.open(doc.href, doc.target, 'height='+height+',width='+width+',status,resizable=yes,scrollbars=yes'); 
	popup.focus(); 
	return false;
}

/**
 * Reload the parent window or submit a specific form of the
 * parent window. The form name is defined in the GET param reloadform.
 * 
 * Example for an url (which opens a popup window):
 * http://www.mysite.com/popup.php?reloadform=adminform
 *
 * If reloadform is set and the form exists, the form will be submitted.
 * Otherwise perform a normal reload.
 *
 */
function reloadOpenerForm() {
	var url = document.URL;
	var params = url.split('?');
	if (params.length > 1) {
		var pairs = params[1].split('&');
		if (pairs.length > 0) {
			for (var i = 0; i < pairs.length; ++i) {
				var pair = pairs[i].split('=');
				if (pair[0] == 'reloadform') {
					var formToReload = pair[1];
				}
			}
		}
	}
	if (formToReload) {
		window.opener.document.forms[formToReload].submit();  	
	} else {
		window.opener.location.reload();
	}
}

/**
 * Close the (current) popup window
 *
 */
function closeWindow() {
	window.close();
}
