<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="{{DESCRIPTION}}" />
    <meta name="author" content="{{AUTHOR}}" />
    <meta name="keywords" content="{{KEYWORDS}}" />
    <meta charset="utf-8" />
    <meta property="og:title" content="{{TITLE}}"/>
    <meta property="og:type" content="website"/>
    <meta property="og:url" content=""/>
    <meta property="og:description" content="{{DESCRIPTION}}"/>
    <meta property="og:image" content="http://xia.dane.ac-versailles.fr/img/logo.jpg"/>
    <title>{{TITLE}}</title>
    <link rel="stylesheet" type="text/css" href="{{MainCSS}}"/>
    <script src="{{labJS}}"></script>
</head>
<body id="image-active">
  <div style="float:left;">
  <a class="meta-doc" href="#" title="information générale"></a>
  <a class="infos" href="#" title="à propos"></a>
</div>
    <div id="loader">
        <div id="splash">
            <p><img src="{{LogoLoading}}" alt="xia"/></p>
            <div id="progressbar-wrap">
                <div class="meter">
                    <span id="progressbar"></span>
                </div>
            </div>
        </div>
    </div>
    <div class="buttons_container">
        <div id="article_close"></div>
        <div id="article_move"></div>
    </div>
    <div id="container">

        <!-- <div id="detect"></div> -->
        <header>
            <h1 id="title">{{TITLE}}</h1>
        </header>
        <nav id="buttons" >{{BUTTONS}}</nav>
        <section id="content" >{{CONTENT}}</section>
        <div id="canvas"></div>

    </div>
    <footer class="overlay" id="rights">
        <section id="popup">
            <img id="popup_close" src="{{LogoClose}}" alt="close"/>
            <article id="popup_text">
                <img src="{{LogoLoading}}" alt="xia" />
                <p>{{METADATAS}}</p>
            </article>
        </section>
    </footer>
    {{datasJS}}
    <script>
        var loadLibs = function() {
            var lazyDatas = "{{lazyDatasJS}}";
            var embedded_scripts = [];
            var progressbar = document.getElementById("progressbar");
            var updateProgressbar = function(i) {
                var percentage = Math.floor((100 / embedded_scripts.length) * i);
                progressbar.style.width = percentage + "%";
                if (i + 1 < embedded_scripts.length) {
                    $LAB.script(embedded_scripts[i+1]).wait(function(){
                       updateProgressbar(i+1);
                    });
                }
                else {
                    $LAB.script(embedded_scripts[i+1]);
                }
            };

            embedded_scripts.push("{{kineticJS}}");
            if (lazyDatas !== "") embedded_scripts.push(lazyDatas);
            embedded_scripts.push("{{JqueryJS}}");
            embedded_scripts.push("{{sha1JS}}");
            embedded_scripts.push("{{hooksJS}}");
            embedded_scripts.push("{{xiaJS}}");

            $LAB.setGlobalDefaults({CacheBust:true});
            $LAB.script(embedded_scripts[0]).wait(function(){
                updateProgressbar(0);
            });
        }

        document.body.onload = loadLibs;
    </script>
</body>
</html>
