ini_set('error_prepend_string', "<p class='text-error'>");
    ini_set('error_append_string', "</p>");
    $GLOBALS["VERBOSE"] = true;
}
$users = new usersMenus();
if (!$users->AsAnAdministratorGeneric) {
    header("content-type: application/x-javascript");
    echo "alert('No privileges');";
    die;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_POST["STATUSOF"])) {
    STATUSOF();
    exit;
}
if (isset($_POST["LOGSOF"])) {
    LOGSOF();
    exit;
}
if (isset($_GET["ifStopped"])) {
    ifStopped();
    exit;
}
js();
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-cache, must-revalidate");
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.ini.inc');
	if(isset($_GET["verbose"])){
		ini_set('display_errors', 1);
		ini_set('error_reporting', E_ALL);
		ini_set('error_prepend_string',"<p class='text-error'>");
		ini_set('error_append_string',"</p>");
		$GLOBALS["VERBOSE"]=true;}
	
	$users=new usersMenus();
	if(!$users->AsAnAdministratorGeneric){header("content-type: application/x-javascript");echo "alert('No privileges');";die();}
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_POST["STATUSOF"])){STATUSOF();exit;}
	if(isset($_POST["LOGSOF"])){LOGSOF();exit;}
	if(isset($_GET["ifStopped"])){ifStopped();exit;}
	js();
	
function js(){
	$page=CurrentPageName();
	$tpl=new templates();
	header("content-type: application/x-javascript");
	$appname=$_GET["APPNAME"];
	$action=$_GET["action"];
	$title=$tpl->javascript_parse_text("{{$appname}}::{{$action}}");
	$_GET["cmd"]=urlencode($_GET["cmd"]);
	$html="YahooWinBrowse('1036','$page?popup=yes&appname=$appname&action=$action&cmd={$_GET["cmd"]}&id={$_GET["id"]}&appcode={$_GET["appcode"]}','$title')";
	echo $html;