<?php
    $siteRoot = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR;

    require_once $siteRoot . 'vendor/autoload.php';

    if (!class_exists('VWM', true)) {

        include_once("VWM/VWM.php");

    }

    $configfile = $siteRoot . 'vwm_config.xml';

    if (class_exists('VWM')) {

        // get VWM instance
        if ($vwm = VWM::getInstance($configfile)) {

        }
    }
?>

<?php echo '<?'; ?> xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl" lang="nl">
    <head>
        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
        <title>Pictures</title>
        <?php
        if ($_GET['region_style']) {
            $style = $_GET['region_style'];
        } else {
            $style = $_GET['style'];
        }
        ?>
        <link href="/css/<?php echo $style; ?>.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="/jscript/event-cache.js"></script>
        <script type="text/javascript" src="/jscript/common.js"></script>
    </head>
    <body>
    <div id="popup_wrapper">
        <div id="popup_floating"><div><div>
            <?php
                if ($_GET['imagepath']) {
                    $img = '<img src="'.htmlspecialchars($_GET['imagepath']).'" onclick="javascript:window.close()" alt=""/>';
                } else {
                    $img = '<img src="/images/' . $_GET['style'] . '/pinfo/' . $_GET['tsa'] . '/' . $_GET['id'] . 'gr.jpg" onClick="javascript:window.close()" />';
                }
                echo $img;
            ?>
        </div></div></div>
    </div>
    </body>
</html>
