if(typeof KIDS == "undefined" || !KIDS) var KIDS = {};

KIDS.namespace("reporting");

KIDS.reporting.config;
KIDS.reporting.qs;

Configuration.prototype.initialize = function(){
	try{
		this.init();
		this.setting["name"]="the-n";
		this.setting["dynamicAccountSelection"] = false;
		this.setting["dynamicAccountList"] = "the-ndev=teennick-d.mtvi.com,teennick-q.mtvi.com";
		this.setting["linkInternalFilters"] = "javascript:,teennick.com";
		this.setting["trackExternalLinks"] = true;
		this.setting["trackDownloadLinks"] = true;
		this.setting["trackInlineStats"] = true;
		if(!this.isLink()){
		this.setting.pageName = location.pathname;
			this.setting.pageName = (this.setting.pageName=="/" || this.setting.pageName== "/index.html") ? "/index.html" : (this.setting.pageName.length - this.setting.pageName.lastIndexOf('.html') == 1) ? this.setting.pageName : (this.setting.pageName.length - this.setting.pageName.lastIndexOf('/') > 1 && this.setting.pageName.indexOf(".")<0) ? this.setting.pageName+"/" : this.setting.pageName;
			if(this.setting.pageName.indexOf(".")<0){
				if(this.setting.pageName.lastIndexOf("/")!=this.setting.pageName.length-1) this.setting.pageName+="/";	
			}
			this.setting.channel = (this.setting.pageName=="/index.html") ? "homepage" : this.setting.hier2.substr(0,this.setting.hier2.indexOf("/"));
			if(KIDS.get("adfree")=="true")this.setting.channel="AdFreePages";
			this.setting.prop3 = location.search;
			this.setting.prop4 = (KIDS.get("type")=="game" && KIDS.get("isDetailPage")=="true") ? KIDS.get("urlAlias"):"";
			this.setting.prop11 = KIDS.get("fccRelatedShow");
			if(this.setting.prop11.indexOf(":")>0)this.setting.prop11=this.setting.prop11.split(":")[1];
			if(this.setting.pageName.indexOf("/kids-choice-awards")>-1){
				this.setting.prop11 = "kca";
				this.setting.channel = "kids-choice-awards";
				if(this.setting.pageName.indexOf("/kids-choice-awards/vote")>-1){
					var kcaCurrentCat = NICK.utils.getCookie("nkcavcc");
					if(kcaCurrentCat && this.setting.pageName.indexOf(kcaCurrentCat)<0){
						this.setting.pageName+=kcaCurrentCat+"/";
						this.setting.hier2+=kcaCurrentCat+"/";
					}else{
						this.setting.pageName+="tv-show/";
						this.setting.hier2+="tv-show/";
					}
				}
			}
			this.setting.hier2 = this.setting.pageName.substr(1);
			if(this.setting.pageName.indexOf(".")<0){
				this.setting.hier2+="index.html";
			}
			this.setting.eVar16 = this.setting.pageName;
			this.setting.eVar13 = KIDS.reporting.qs.navid;
		}
	}catch(e){}
}
KIDS.reporting.init = function(){
	KIDS.reporting.qs = btg.String.queryStringToObject(location.href);
	KIDS.reporting.config = new Configuration();
	KIDS.reporting.config.initialize();
	btg.config.Omniture.account = 'the-n';
	btg.config.Omniture.dynamicAccountSelection = 'false';
	btg.config.Omniture.linkInternalFilters = 'javascript:,teennick.com';
	btg.config.Omniture.trackInlineStats = true;
	btg.config.Omniture.trackExternalLinks = true;
	btg.config.Omniture.trackDownloadLinks = true;
}
KIDS.reporting.firePageLoad = function(){
	KIDS.reporting.omnifunctions.sendReportingCall();
}

