<?PHP

# if it appears that the software has not yet been installed
if ((!file_exists("config.php") || file_exists("NEWVERSION")) 
        && file_exists("installcwis.php"))
{
    # jump to installation
    ?><html>
    <head><meta http-equiv="refresh" content="0; URL=installcwis.php"></head>
    <body bgcolor="white"></body>
    </html><?PHP
    exit();
}

# set up operating environment
require_once("include/StartUp.php");

# set UI for logged-in user (or default UI if not logged in)
$AF->ActiveUserInterface(GetActiveUI());

# grab page to load
$Page = isset($_GET["P"]) ? $_GET["P"] : "Home";

# display errors if logged in with admin privileges
if ($G_User->HasPriv(PRIV_SYSADMIN))
{
    ini_set("display_errors", 1);
}

# tell application framework to load the page
$AF->LoadPage($Page);

?>
