<%@ language = "JavaScript" %>
<% /*
     $Revision$
     $Id$

     File:    fac/help.asp
     Context: vanuit header.inc

*/
%>
<!-- #include file="../Shared/common.inc" -->
<%
FCLTHeader.Requires({ plugins: [], js: [] });

var url = getQParam("url", "");
var usedefault = getQParamInt("default", 0) == 1;
// Vertaalt de url (van de pagina in het actieve frame) naar de naam/code van de module
// zodat naar de juiste modulestartpagina kan worden gesprongen
function findparam(params, name)
{
    var ii;
    for (ii in params)
    {
        if (params[ii].split("=")[0] == name)
            return params[ii].split("=")[1];
    }
    return "";
}

var urls = url.split("?");
var pathparts = urls[0].split("/");
if (urls.length>1)
    params = urls[1].split("&");
else
    params = [];
var module = pathparts[pathparts.length-2]; // één na laatste folder
var file = pathparts[pathparts.length-1];

var helppage_url = S("helppage_url");
var sql = "SELECT fac_setting_default"
        + "     , fac_setting_pvalue"
        + "  FROM fac_setting fs"
        + " WHERE fs.fac_setting_name = 'helppage_url'";
var oRs = Oracle.Execute(sql);
if (usedefault)
{ // Default waarde niet overrulen
  helppage_url = "" + oRs("fac_setting_default").value;
}

var url = helppage_url+"?mod="+Server.URLencode(module)+"&file="+Server.URLencode(file)+"&cust="+customerId + "&fcltversion="+FCLTVersion;
if (S("iLearning_enabled")==1)
    url += '&ilearning=1';

if (Session("user_lang"))
    url += '&lang='+Session("user_lang");

urole = findparam(params, "urole");
if (urole)
    url += "&urole=" + urole;

Response.Redirect(protectQS.create(url, { sleutel: S("helppage_secret"), no_user_key: true }));
Response.End;
%>
<% ASPPAGE_END(); %>
