function popup_index()
{
    $main = new main_cf();
    $html = "\n<H1>{smtp_connection_cache_destinations}</H1>\n<table style='width:600px' align=center>\n<tr>\n<td valign='top'>\n" . RoundedLightWhite("<div style='text-align:justify;font-size:12px;height:200px;overflow:auto;width:99%'>{smtp_connection_cache_destinations_text}</div>") . "\n<br>\n" . RoundedLightWhite("\n<form name='FFMA'>\n<table style='width:500px'>\n\t<tr>\n\t\t<td class=legend nowrap><strong>{smtp_connection_cache_on_demand}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_yesno_checkbox_img('smtp_connection_cache_on_demand', $main->main_array["smtp_connection_cache_on_demand"], '{enable_disable}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{smtp_connection_cache_time_limit}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('smtp_connection_cache_time_limit', $main->main_array["smtp_connection_cache_time_limit"], 'width:20%', null, null, '{smtp_connection_cache_time_limit_text}') . "\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{smtp_connection_reuse_time_limit}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('smtp_connection_reuse_time_limit', $main->main_array["smtp_connection_reuse_time_limit"], 'width:20%', null, null, '{smtp_connection_reuse_time_limit_text}') . "\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{connection_cache_ttl_limit}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('connection_cache_ttl_limit', $main->main_array["connection_cache_ttl_limit"], 'width:20%', null, null, '{connection_cache_ttl_limit_text}') . "\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{connection_cache_status_update_time}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('connection_cache_status_update_time', $main->main_array["connection_cache_status_update_time"], 'width:20%', null, null, '{connection_cache_status_update_time_text}') . "\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap colspan='2' style='border-top:1px solid #CCCCCC'><input type='button' value='{edit}&nbsp;&raquo;' OnClick=\"javascript:PostFixSaveServerCacheSettings();\"></td>\n\t\t\n\t</tr>\t\t\t\n\t\t\t\t\t\n\t\t\n</form>\t") . "\n\t\n\t<tr>\n\t\n\t\n\t\t<td class=legend nowrap><strong>{smtp_connection_cache_destinations_field}&nbsp;:</strong></td>\n\t\t<td align='left'><input type='button' value='{add_server_domain}&nbsp;&raquo;' OnClick=\"javascript:PostFixAddServerCache();\">\n\t</tr>\n</table>\t\n\n\n</td>\n</tr>\n</table><div id='ServerCacheList'>" . PostFixServerCacheList() . "</div>";
    $tpl = new Templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function popup_index()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $add_server_domain = $tpl->_ENGINE_parse_body("{add_server_domain}");
    $main = new maincf_multi($_GET["hostname"]);
    $smtp_connection_cache_on_demand = $main->GET("smtp_connection_cache_on_demand");
    $smtp_connection_cache_time_limit = $main->GET("smtp_connection_cache_time_limit");
    $smtp_connection_reuse_time_limit = $main->GET("smtp_connection_reuse_time_limit");
    $connection_cache_ttl_limit = $main->GET("connection_cache_ttl_limit");
    $connection_cache_status_update_time = $main->GET("connection_cache_status_update_time");
    if (!is_numeric($smtp_connection_cache_on_demand)) {
        $smtp_connection_cache_on_demand = 1;
    }
    if ($smtp_connection_cache_time_limit == null) {
        $smtp_connection_cache_time_limit = "2s";
    }
    if ($smtp_connection_reuse_time_limit == null) {
        $smtp_connection_reuse_time_limit = "300s";
    }
    if ($connection_cache_ttl_limit == null) {
        $connection_cache_ttl_limit = "2s";
    }
    if ($connection_cache_status_update_time == null) {
        $connection_cache_status_update_time = "600s";
    }
    $html = "\n<div id='smtp_connection_cache_on_demand_div'></div>\n<table style='width:99%' class=form>\n<tbody>\n\t<tr>\n\t\t<td class=legend nowrap><strong>{smtp_connection_cache_on_demand}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_checkbox('smtp_connection_cache_on_demand', 1, $smtp_connection_cache_on_demand) . "</td>\n\t\t<td width=1%>" . help_icon("{smtp_connection_cache_destinations_text}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{smtp_connection_cache_time_limit}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('smtp_connection_cache_time_limit', $smtp_connection_cache_time_limit, 'width:50px;font-size:14px', null, null, '') . "\n\t\t<td width=1%>" . help_icon("{smtp_connection_cache_time_limit_text}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{smtp_connection_reuse_time_limit}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('smtp_connection_reuse_time_limit', $smtp_connection_reuse_time_limit, 'width:50px;font-size:14px', null, null, '') . "\n\t\t<td width=1%>" . help_icon("{smtp_connection_reuse_time_limit_text}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{connection_cache_ttl_limit}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('connection_cache_ttl_limit', $connection_cache_ttl_limit, 'width:50px;font-size:14px', null, null, '') . "\n\t\t<td width=1%>" . help_icon("{connection_cache_ttl_limit_text}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap valign='top' nowrap><strong>{connection_cache_status_update_time}&nbsp;:</strong></td>\n\t\t<td align='left'>" . Field_text('connection_cache_status_update_time', $connection_cache_status_update_time, 'width:50px;font-size:14px', null, null) . "\n\t\t<td width=1%>" . help_icon("{connection_cache_status_update_time_text}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap colspan='3' align='right'><hr>\n\t\t" . button("{apply}", "smtp_connection_cache_on_demand_save()") . "\n\t</td>\n\t\t\n\t</tr>\t\t\t\n\t</tbody>\n</table>\t\t\t\t\n\n<table style='width:99%' class=form>\n<tbody>\n\t<tr>\n\t\n\t\n\t\t<td class=legend nowrap><strong>{smtp_connection_cache_destinations_field}&nbsp;:</strong></td>\n\t\t<td align='left'><input type='button' value='{add_server_domain}&nbsp;&raquo;' OnClick=\"javascript:PostFixAddServerCache();\">\n\t</tr>\n</tbody>\n</table>\t\n\n\n</td>\n</tr>\n</table><div id='ServerCacheList'>" . PostFixServerCacheList() . "</div>\n\n<script>\n\n\tvar x_smtp_connection_cache_on_demand_save=function(obj){\n    \tvar tempvalue=trim(obj.responseText);\n\t  \tif(tempvalue.length>3){alert(tempvalue);}\n\t\tdocument.getElementById('smtp_connection_cache_on_demand_div').innerHTML='';\n\t\t}\n\nfunction smtp_connection_cache_on_demand_save(){\n\tvar XHR = new XHRConnection();\t\n\tif(document.getElementById('smtp_connection_cache_on_demand').checked){XHR.appendData('smtp_connection_cache_on_demand','1');}else{XHR.appendData('smtp_connection_cache_on_demand','0');}\n\tXHR.appendData('smtp_connection_cache_time_limit',document.getElementById('smtp_connection_cache_time_limit').value);\n\tXHR.appendData('smtp_connection_reuse_time_limit',document.getElementById('smtp_connection_reuse_time_limit').value);\n\tXHR.appendData('connection_cache_ttl_limit',document.getElementById('connection_cache_ttl_limit').value);\n\tXHR.appendData('connection_cache_status_update_time',document.getElementById('connection_cache_status_update_time').value);\n\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\tAnimateDiv('smtp_connection_cache_on_demand_div');\n\tXHR.sendAndLoad('{$page}', 'POST',x_smtp_connection_cache_on_demand_save);\t\n}\nfunction PostFixAddServerCache(){\n\tYahooWin3(550,'{$page}?PostFixAddServerCache=yes&hostname={$_GET["hostname"]}','{$add_server_domain}');\n\t}\n\t\nfunction CacheReloadList(){\n\tLoadAjax('ServerCacheList','{$page}?CacheReloadList=yes&hostname={$_GET["hostname"]}');\n\t}\t\n\tCacheReloadList();\n</script>\n\n\n";
    $tpl = new Templates();
    echo $tpl->_ENGINE_parse_body($html);
}