function openPopup(url,name,width,height) {
	var popupWin = top[name];
	if (popupWin != null && typeof(popupWin) == 'object' && !popupWin.closed) {
		if (popupWin.document.location.href != url) {
			popupWin.document.location.href = url;
		}
	} else {
		popupWin = window.open(url, name, 'width=' + width + ',height=' + height + ',status=yes,menubar=yes,resizable=yes,scrollbars=yes,left=' + String((screen.width-width)/2) + ',top=' + String((screen.height-height)/2));
	}
	popupWin.focus();
}

function closePopup(url) {
	if (opener) {
		if (opener.closed) window.open(url, "");
		self.close();
		return false;
	}
	return true;
}
