/*******************************************************************
 * Loads the various JS for web analytics.  This file allows us to
 * configure the web stats information specifically to the environment/site.
 * This should be adjusted for each unique environment or site.
 *
 * JavaScript File Dependencies:
 *   cfc.js
 *   
 * @Author Pat B
 * @version 0.1
 *******************************************************************/

// Within a private scope, load external JS files
(function() {

    // setup namespace
    cfc.namespace("wStats");
    
    cfc.wStats.webStatsConfig = {
    
        // General configurations that to be used by any web analytics package
        host: "//wstats.rtfc.coop/", // used for both http and https connections
        //host: "//wstats.statstest.com/", // used for both http and https connections
        cfcLibPath: "cfc-lib/cfc/js/",
        
        // Unica specific
        unicaLibPath: "cfc-lib/unica/"
    };
    
    cfc.wStats.jsPath = cfc.wStats.webStatsConfig.host + cfc.wStats.webStatsConfig.cfcLibPath;
    cfc.wStats.jsPathUnica = cfc.wStats.webStatsConfig.host + cfc.wStats.webStatsConfig.unicaLibPath;
    
	// configure JS files to load dynamically
    cfc.wStats.jsFilesToLoad = [["cfc.wStats.js", cfc.wStats.jsPath], 
		["cfc.wStats.unica.js", cfc.wStats.jsPath], 
		["ntpagetag.js", cfc.wStats.jsPathUnica]];
		
    cfc.wStats.webStatsConfig.unica = {
        imageBeacon: cfc.wStats.webStatsConfig.host + cfc.wStats.webStatsConfig.unicaLibPath + "images/ntpagetag.gif"
    };
    
    /********* load scripts *********/
    // Loop through the array of files to load
    for (var i = 0; i < cfc.wStats.jsFilesToLoad.length; i++) {
        var file = cfc.wStats.jsFilesToLoad[i][0]; // for debugging
        var path = cfc.wStats.jsFilesToLoad[i][1]; // for debugging
        cfc.util.loadScript({
            file: cfc.wStats.jsFilesToLoad[i][0],
            path: cfc.wStats.jsFilesToLoad[i][1]
        });
    }
    
})();

