exit;
}
if (isset($_GET["popup-spamass-rewrite-headers"])) {
    rewrite_headers_form();
    exit;
}
if (isset($_GET["popup-spamass-add-headers"])) {
    add_headers_form();
    exit;
}
if (isset($_GET["popup-spamass-check"])) {
    popup_spamass_check();
    exit;
}
if (isset($_GET["popup-spamass-check-perform"])) {
    popup_spamass_check_perform();
    exit;
}
js();
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{APP_SPAMASSASSIN}");
    $scores_behavior = $tpl->_ENGINE_parse_body("{scores_behavior}");
    $title1 = $tpl->_ENGINE_parse_body("{title1}");
    $spamassassin_check_config = $tpl->_ENGINE_parse_body("{spamassassin_check_config}");
    $html = "\n\t\n\t\tfunction SPAMASS_LOADP(){\n\t\t\tYahooWin2(750,'{$page}?popup=yes','{$title}');\n\t\t\n\t\t}\n\t\tvar refreshTrustedNet=function(obj){\n\t\tRefreshTab('main_config_spamass');\n      }\n\n\nfunction SpamassAddTrustedNetwork(){\n        var net;\n        net=prompt(document.getElementById('addtrustednet').value);\n        if(net){\n             var XHR = new XHRConnection();\n             XHR.appendData('SpamassAddTrustedNetwork',net);\n\t     XHR.sendAndLoad('spamassassin.index.php', 'GET',refreshTrustedNet);   \n        }\n}\n\nfunction SpamassDelTrustedNetwork(index){\n       \tvar XHR = new XHRConnection();\n        XHR.appendData('SpamassDelTrustedNetwork',index);\n\t    XHR.sendAndLoad('spamassassin.index.php', 'GET',refreshTrustedNet);      \n        }\t\t\nfunction spamass_scores_behavior(){\n\tYahooWin4(550,'{$page}?popup-spamass-scores-behavior=yes','{$scores_behavior}');\n}\nfunction spamass_rewrite_headers(){\n\tYahooWin4(370,'{$page}?popup-spamass-rewrite-headers=yes','{$title1}');\n}\nfunction spamass_add_headers(){\n\tYahooWin4(550,'{$page}?popup-spamass-add-headers=yes','{$title1}');\n}\n\n\nvar X_SpamassinScoreBehavior= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif (results.length>0){alert(results);}\n\t\tspamass_scores_behavior();\n\t}\t\t\nfunction SpamassinScoreBehavior(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('SaveGeneralSettings','yes');\n\t\tXHR.appendData('report_safe',document.getElementById('report_safe').value);\n\t\tXHR.appendData('use_bayes',document.getElementById('use_bayes').value);\n\t\tXHR.appendData('bayes_auto_learn',document.getElementById('bayes_auto_learn').value);\n\t\tXHR.appendData('required_score',document.getElementById('required_score').value);\n\t\tXHR.appendData('block_with_required_score',document.getElementById('block_with_required_score').value);\n\t\tdocument.getElementById('SpamassinScoreBehaviorDiv').innerHTML='<center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',X_SpamassinScoreBehavior);\n\t\t}\n\t\t\nfunction SpamAssassinCheckService(){\n\tYahooWin4(750,'{$page}?popup-spamass-check=yes','{$spamassassin_check_config}');\n\n}\n\t\t\n\t\n\tSPAMASS_LOADP()";
    echo $html;
}
function popup_spamass_check()
	if(isset($_GET["SaveGeneralSettings"])){SaveConf();exit;}
	if(isset($_GET["rewrite_headers"])){rewrite_headers();exit;}
	if(isset($_GET["add_headers"])){add_headers();exit;}
	if(isset($_GET["status"])){echo main_status();exit;}
	if(isset($_GET["SpamassAddTrustedNetwork"])){Save_Trusted_Networks();exit;}
	if(isset($_GET["SpamassDelTrustedNetwork"])){Delete_Trusted_Networks();exit;}
	if(isset($_GET["salearn-schedule-js"])){salearn_schedule_js();exit;}
	if(isset($_GET["salearn-schedule-popup"])){salearn_schedule_popup();exit;}
	if(isset($_GET["SalearnSchedule"])){salearn_schedule_save();exit;}
	
	if(isset($_GET["popup-spamass-scores-behavior"])){scores_behavior();exit;}
	if(isset($_GET["popup-spamass-rewrite-headers"])){rewrite_headers_form();exit;}
	if(isset($_GET["popup-spamass-add-headers"])){add_headers_form();exit;}
	
	if(isset($_GET["popup-spamass-check"])){popup_spamass_check();exit;}
	if(isset($_GET["popup-spamass-check-perform"])){popup_spamass_check_perform();exit;}
	
	js();
	
	
function js(){

	$page=CurrentPageName();
	$tpl=new templates();
	$title=$tpl->_ENGINE_parse_body("{APP_SPAMASSASSIN}");
	$scores_behavior=$tpl->_ENGINE_parse_body("{scores_behavior}");
	$title1=$tpl->_ENGINE_parse_body("{title1}");
	$spamassassin_check_config=$tpl->_ENGINE_parse_body("{spamassassin_check_config}");
	$html="
	
		function SPAMASS_LOADP(){