﻿/* ******************************************** *\
|*                                              *|
|*          WReport manager javascript          *|
|*                                              *|
\* ******************************************** */

WReportManager = function() {
}

WReportManager.Register = function(section, subSection, content) {
    if (!Environment.WReportEnabled) {
        return;
    }

    var rSection = (section) ? section : WRP_SECTION;
    var rSubSection = (subSection) ? subSection : WRP_SUBSECTION;
    var rContent = (content) ? content : WRP_CONTENT;

    //Create WReport counter...
    var w_counter = new wreport_counter(rSection, rSubSection, WRP_ID, WRP_ACC, WRP_CHANNEL, WRP_SECTION_GRP, WRP_SUBSECTION_GRP);
    if (rContent) {
        w_counter.add_content(rContent);
    }
    w_counter.profiling_cookie_mode = 'off';
    /*for (var i = 0; i < this._profile.length; i++) {
    w_counter.add_profile(this._profile[i].key, this._profile[i].name);
    }*/

    if (Environment.DebugMode) {
        alert("WReportManager.Register("
                    + "section=" + rSection
                    + ", subSection=" + rSubSection
                    + ", siteId=" + WRP_ID
                    + ", content=" + rContent
                    + ")");
        return;
    }

    w_counter.count();

    return true;
}
