function redirect_popup_response($url = '')
{
    if (!$url) {
        $url = $_SERVER['PHP_SELF'];
    }
    $str = "<html><body><script>\r\n\t\t\t\t\t\t\tif(window.opener)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\thref = window.opener.location.href;";
    $str .= _add_js_random_to_url('href');
    $str .= " window.opener.location.href = href;";
    $str .= "\t\r\n\t\t\t\t\t\t\t\twindow.opener.focus();\r\n\t\t\t\t\t\t\t}";
    $str .= "href = '{$url}';";
    $str .= _add_js_random_to_url('href');
    $str .= "window.location.href = href;";
    $str .= '</script>
					</body>
				</html>';
    return $str;
}
function reload_popup($url = PHP_SELF)
{
    if (!isset($_REQUEST['popup']) || !$_REQUEST['popup']) {
        return;
    }
    ob_end_clean();
    ob_start();
    echo "<html><body><script>\r\n\t\t\t\t\t\t\tif(window.opener)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\thref = window.opener.location.href;";
    echo _add_js_random_to_url('href');
    echo " window.opener.location.href = href;";
    echo "\t\r\n\t\t\t\t\t\t\t\twindow.opener.focus();\r\n\t\t\t\t\t\t\t}";
    echo "href = '{$url}';";
    echo _add_js_random_to_url('href');
    echo "window.location.href = href;";
    echo '</script>
					</body>
				</html>';
    ob_end_flush();
    commit_user_transaction();
    exit;
}