
(function(){
    if ( typeof GEL == 'undefined') {
	setTimeout(arguments.callee, 100); /* Will call back into this function every 100 ms until GEL is available */
	return false; 
    }
   var 
	   _G= GEL,  
	   _C= _G.config, 
	   _I= _G.thepage.initializer,
	   _W= window, 
	   _U= _W.location.host,
	   _C= _G.config,
	   _LURL= '',
           _SD= '',
	   _P= _G.namespace("config.bus.providers"),
           _QSP = GEL.env.url.qsv
   ;
   // Sub-domains are where the co-brand id are located at.
   _D = _G.env.url.hostname.split('.')
   _SD = _D[0]
   if(_SD == 'g8') {
    _SD = 'indystar'
   }
   
   _LURL= ['http://', _SD , ".gannettdigital.com/localvars.js"].join("");
    
    GEL.log("co-brand localvars.js: " +  _LURL);
    
   
   _P.sitecat= 100; _P.bt= 100; _P.comscore= 100;
   
   (function(){ 
	   var _CFG= GEL.namespace("config.comscore"); 
	   _CFG.comscoreenable= "on";
	   _CFG.c1= 2;
	   _CFG.c4= GEL.namespace("thepage.pageinfo").articleinturl || '';
	   _P.comscore= 100;
   })();
   
   /*_G.register("localconfig", {path: _LURL, base: "relative"}); */
   _G.register("localconfig", {path: _LURL});
   _G.register("com.Omniture", {path: "vendor/omniture/sitecatalyst.js"}); 
   _G.util.importer.require("localconfig").write(); 
   _G.util.importer.require("com.Omniture").write(); 
   _I.add({ 
	   name: "analytics", 
	   namespace: ["analytics"], 
	   priority: 100, 
	   callback: loadAnalytics 
   });   
   _I.add({ 
	   name: "ur", 
	   namespace: ["legacy.GDN"],
	   priority: 150, 
	   callback: function(){ GDN.UR.Page.Intercept= new Function(); GDN.UR.Page.Load(); }
   }); 
   
   function loadAnalytics(){
	   GEL.log("loadAnalytics");
           setBusConfig(); 
	   var 
	   _V= _G.thepage.viewTracker || (function(){ 
		   _G.thepage.viewTracker= new GEL.bus.PageTrack(); 
		   return _G.thepage.viewTracker; 
	   })();
   
	   for(var _p in _P)
		   _V.init(_p) ;
	   _V.trackView(); 
   }
   
   
   function setBusConfig(){ 
   var 
	   _W=window,
	   _obj= { 
		   channel: '',
		   currencyCode: "USD",
		   trackDownloadLinks: true,
		   trackExternalLinks: false,
		   trackInlineStats: true,
		   linkDownloadFileTypes: "exe,zip,wav,mp3,mp4,m4v,mov,mpg,avi,wmv,doc,pdf,xls",
		   linkInternalFilters: "javascript:apartments,careerbuilder,cars,customcoupon,customwire.ap.org,eharmony,gannett,gbahn,highschoolsports,homefinder,homescape,infi,job,legacy,network,newsbank,newslibrary,pictopia,salary,topix,ur.gcion.com,usatoday,traffic,planetdiscover,metromix,mom,mycapture",
		   linkLeaveQueryString: false,
		   linkTrackVars: "None",
		   usePlugins: true, 
		   linkTrackEvents: "None"
	   },
	   _C= _G.namespace("config"), 
	   _A= _G.namespace("config.bus.properties"),
	   _O= _G.namespace("config.omniture")
	   ;
	   for(var p in _obj){ 
		   if(!(p in _O)) 
			   _O[p]= _obj[p]; 
	   }
	   _G.config.bus.properties= { 
		   
                   channel: "MyCapture",
		   server: "MyCapture",
		   custom6: "news",
		   custom8: "MyCapture.com",
		   pageName: "MyCapture",
		   contenttype: "section",
		   location: _W.location.href.split("?")[0],
		   syndication: _W.location.href.split("?")[1],
		   marketname: _W['g_affilSstatId'],
                   useraction: (function() {
                         var _p = GEL.env.url.qsv;
                         if(_p.odyssey)
                              return _p.odyssey;
                   })()
	   };
   
   }
})(); 
