function echo_js()
{
    if ($_GET["script"] == "ssl") {
        script_ssl();
        exit;
    }
    $page = CurrentPageName();
    $html = "\n\tvar tmpval='';\n\t\n\t\n\tYahooWin2(750,'{$page}?main_page=yes','master.cf (services)',''); \n\t\n\tfunction PostfixServiceInfo(servname,service_label){\n\t\tYahooWin3(550,'{$page}?service-info='+servname,'master.cf ('+service_label+')',''); \n\t\t}\n\t\t\n\t\t\n\tfunction PostfixServiceInfo2(){\n\t\tYAHOO.example.container.dialog3.hide();\n\t\t\n\t\n\t}\n\t\n\t\nvar x_AddOptionService=function(obj){\n\t\ttext=obj.responseText;\n\t\tif(text.length>0){\n\t\t\talert(text);\n\t\t}\n\t\tPostfixServiceInfo(tmpval);\n      }\t\t\n      \nvar x_service=function(obj){\n\t\tPostfixServiceTable();\n      }\t      \n\t\t\n\tfunction AddOptionService(servname){\n\t\tvar text=document.getElementById('AddOptionService_text').value;\n\t\tvar option=prompt(text);\n\t\tif(option){\n\t\t\ttmpval=servname;\n\t\t\tvar XHR = new XHRConnection();\n    \t\tXHR.appendData('add_option_service',servname);\n    \t\tXHR.appendData('option',option);\n    \t\tXHR.sendAndLoad('{$page}','GET',x_AddOptionService);\n\t\t\n\t\t}\n\t}\n\t\n\tfunction DelOptionService(servname,index){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\ttmpval=servname;\n    \t\tXHR.appendData('del_option_service',servname);\n    \t\tXHR.appendData('index',index);\n    \t\tXHR.sendAndLoad('{$page}','GET',x_AddOptionService);\n\t}\n\t\n\t\n\tfunction DeleteMasterService(servname){\n\t\t\tvar XHR = new XHRConnection();\n    \t\tXHR.appendData('del_service',servname);\n    \t\tXHR.sendAndLoad('{$page}','GET',x_service);\n\t\n\t}\n\t\n\tfunction PostfixServiceTable(){\n\t\tLoadAjax('dialog2_content','{$page}?main=default&hostname={$_GET["hostname"]}')\n\t\n\t}\n\t\n\t\n\tfunction RebuildMaster(){\n\t\t\tvar XHR = new XHRConnection();\n    \t\tXHR.appendData('RebuildMaster','yes');\n    \t\tXHR.sendAndLoad('{$page}','GET',x_service);\n\t\n\t}\n\t\n\t";
    echo $html;
}
function echo_js()
{
    if ($_GET["script"] == "ssl") {
        script_ssl();
        exit;
    }
    if ($_GET["hostname"] == null) {
        $_GET["hostname"] = "master";
    }
    $page = CurrentPageName();
    $hostname = $_GET["hostname"];
    $html = "\n\tvar tmpval='';\n\t\n\t\n\tYahooWin2(950,'{$page}?tabs=yes&hostname={$_GET["hostname"]}','master.cf (services)',''); \n\t\n\tfunction PostfixServiceInfo(key,service_label){\n\t\tYahooWin3(550,'{$page}?service-info='+key+'&hostname={$_GET["hostname"]}','master.cf ('+service_label+')',''); \n\t\t}\n\t\t\n\n\t\n\tfunction PostfixServiceTable(){\n\t\tLoadAjax('dialog2_content','{$page}?main=default&hostname={$_GET["hostname"]}')\n\t\n\t}\n\t\n\t\n\tfunction RebuildMaster(){\n\t\t\tvar XHR = new XHRConnection();\n    \t\tXHR.appendData('RebuildMaster','yes');\n    \t\tXHR.sendAndLoad('{$page}','GET',x_service);\n\t\n\t}\n\t\n\t";
    echo $html;
}