var rootURL = 'http://novaserver.vertice.fr/novaserver/';var newRootURLSession = 'http://novaserver.vertice.fr/NovaServer/(S(f1jav355z0lhavnnmbtbac45))/';var cookieName = "Nova.RootURL";
var rootURLSession;


function setCookie(cookie_name, cookie_value, cookie_life, cookie_path) {
    var today = new Date()
    var expiry = new Date(today.getTime() + cookie_life * 24 * 60 * 60 * 1000)
    if (cookie_value != null && cookie_value != "") {
        var cookie_string = cookie_name + "=" + escape(cookie_value)
        if (cookie_life) { cookie_string += "; expires=" + expiry.toGMTString() }
        if (cookie_path) { cookie_string += "; path=" + cookie_path }
        document.cookie = cookie_string
    }
}

function getCookie(name) {
    var index = document.cookie.indexOf(name + "=")
    if (index == -1) { return null }
    index = document.cookie.indexOf("=", index) + 1
    var end_string = document.cookie.indexOf(";", index)
    if (end_string == -1) { end_string = document.cookie.length }
    return unescape(document.cookie.substring(index, end_string))
}

rootURLSession = getCookie(cookieName);

if (rootURLSession == null) {
    setCookie(cookieName, newRootURLSession, 10);
    //alert("Cookie SET");
    rootURLSession = newRootURLSession;
    //alert(rootURLSession);
}

var head = document.getElementsByTagName("head");

function WaitTillScriptsLoaded() {
    if (typeof (NovaLoaded) == 'undefined') { window.setTimeout("WaitTillScriptsLoaded()", 50); }
    else {Ready();}
}

if (head != null) {
    head = head[0];

    if (document.getElementById("nova.css") == null) {
        var dyncss = document.createElement("link");
        dyncss.setAttribute("type", "text/css");
        dyncss.setAttribute("id", "nova.css");
        dyncss.setAttribute("rel", "stylesheet");
        dyncss.setAttribute("href", rootURL + "styles.ashx");
        dyncss.setAttribute("title", "nwgcss");
        head.appendChild(dyncss);
    }

    if (document.getElementById("nova.scripts") == null) {
        var dynscript = document.createElement("script");
        dynscript.setAttribute("type", "text/javascript");
        dynscript.setAttribute("src", rootURL + "scripts.ashx");
        dynscript.setAttribute("id", "nova.scripts");
        head.appendChild(dynscript);
        WaitTillScriptsLoaded();
    }
}

//alert("init.js loaded");

