$usersmenus=new usersMenus();
if(!$usersmenus->AsDansGuardianAdministrator){
	$tpl=new templates();
	$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
	echo "<H2>$alert</H2>";
	die();	
}

if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["list"])){items();exit;}
if(isset($_GET["ruleid-js"])){rule_js();exit;}
if(isset($_GET["ruleid"])){rule();exit;}
if(isset($_POST["ID"])){rule_save();exit;}
if(isset($_GET["switch-js"])){switch_js();exit;}
if(isset($_POST["switch"])){switch_save();exit;}
if(isset($_GET["delete-js"])){delete_js();exit;}
if(isset($_POST["delete"])){delete();exit;}
popup();

function rule_js(){
	header("content-type: application/x-javascript");
	$page=CurrentPageName();
	$tpl=new templates();
	$ID=$_GET["ruleid-js"];
	if($ID==0){$title="{new_rule}";}else{$title="{rule}:: $ID";}
	$title=$tpl->_ENGINE_parse_body($title);
	$pattern=urlencode($_GET["pattern"]);
	echo "YahooWin('700','$page?ruleid=$ID&t={$_GET["t"]}&pattern=$pattern','$title')";
}
function delete_js(){
    exit;
}
if (isset($_GET["ruleid"])) {
    rule();
    exit;
}
if (isset($_POST["ID"])) {
    rule_save();
    exit;
}
if (isset($_GET["switch-js"])) {
    switch_js();
    exit;
}
if (isset($_POST["switch"])) {
    switch_save();
    exit;
}
if (isset($_GET["delete-js"])) {
    delete_js();
    exit;
}
if (isset($_POST["delete"])) {
    delete();
    exit;
}
popup();
function rule_js()
{
    header("content-type: application/x-javascript");
    $page = CurrentPageName();