/* Namespace setup */
if (typeof dj == "undefined") { var dj = {}; }
if (typeof dj.util == "undefined") { dj.util = {}; }

/**
 * Tracking utility
 * 
 * dependencies:
 *   - dj.util.Cookie  [utils.js]
 *   - s (Object)      [s_code_wsj.js]
 *   - setMetaData     [s_code_wsj.js]
 */
dj.util.Tracking = {
  omniture: {
    _initd: false,
    
    init: function(){
      var localSuppressOmniture = false;

      this._initd = true;
    },
    
    
    firePixel: function(){
      if (this._initd !== true) {
        //console.info("{Tracking} tracking not initd.");
        return;
      }
      
      if (s.prop19 == 'article') {
        s.hier1 =[s.channel,s.prop1,s.prop2,s.prop22,s.prop3,s.prop20,s.prop4,s.prop6] .join(",");
      }
      else {
        s.hier1 =[s.channel,s.prop1,s.prop2,s.pageName,s.prop6] .join(",");
      }
      
      /** pageView event and eVar value **/
      s.events = s.events ? (s.events + ",event12") : "event12";
      s.eVar3 = "";
      
      //if (this.cookieUserType !== null) {
      // s.eVar3 = this.cookieUserType;
      //}
      
      if (s.eVar3 === null) {
        //console.info("{Tracking} could not get cookie 'TR'.");
      }
      
      s.eVar4 = s.pageName;
      s.eVar5 = "";
      s.eVar6 = "";
      
      if (this.link) {
        s.eVar5 = this.link;
      }
      if (this.reflink) {
        s.eVar6 = this.reflink;
      }
      s.eVar8 = "";
      if (s.prop18) {
        s.eVar8 = s.prop18;
      }
      s.eVar11 = s.channel;
      s.eVar25 = s.prop2;
      
      /** DO NOT ALTER ANYTHING BELOW THIS LINE **/
      var s_code = s.t();
      if (s_code) {
        document.write(s_code);
      }
    }
  }
};
