/* 
 * CODA utility functions for NewNowNext
 */

/*
 * Make a CODA reporting call
 * Constructs the pageName and also sets Author's name
 */
NNNPageReportingCall = function(paramSiteName, paramPathName, paramAuthorName) {
	var myPageName = paramSiteName + paramPathName;
//	console.log(myPageName);
	
	// Initialize Controller
	btg.Controller.init();
	
	var reportingParams = {
		pageName: "/"+myPageName,	
		channel: 'NewNowNext',
		hier1:	myPageName,
		hier2:	myPageName,
		prop17:'NewNowNext',
		prop20:     paramAuthorName	
		};
	if(typeof addSearchReportingParams == 'function')reportingParams = addSearchReportingParams(reportingParams);

	// Send a page call		
	btg.Controller.sendPageCall(reportingParams);
}

NNNPlaceAd = function(strSize, strSections, strKeyvalues) {
	if(typeof(strSize) == 'undefined') strSize = '1x1';
	if(typeof(strKeyvalues) == 'undefined')
		strKeyvalues = '!category=video;!category=expandable;!category=pop;!category=float;dcopt=ist;';
	if(typeof(strSections) == 'undefined') strSections = '';
	
	if(strKeyvalues.charAt(strKeyvalues.length-1) != ';')
		strKeyvalues += ';';
	
	// Initialize Controller
	btg.Controller.init();
	
	var zoneStr = "atf_j_s/nnn/"+zone;

	btg.config.DoubleClick["dartSite"] = 'logoonline.vt';
	btg.config.DoubleClick["siteName"] = 'newnownext';
	btg.config.DoubleClick["positionThreshold"] = '1';

	btg.config.DoubleClick["keyValues"] = strKeyvalues+ex_cats;
	btg.Controller.placeAd({
		size:""+strSize,
		zoneOverride:zoneStr,
		keyValues:""+strKeyvalues+ex_cats, sections:"nnn/"+secparams+"/"+strSections
	});
}

NNNPlaceAd728x90 = function(sections) {
	NNNPlaceAd("728x90",
		sections,
		'!category=video;!category=expandable;!category=pop;!category=float;dcopt=ist;'
	);
}

NNNPlaceAd300x250 = function(sections) {
	NNNPlaceAd("300x250",
		sections,
		'!category=vertical;!category=tripout;!category=video;'
	);
}

NNNPlaceAd100x50 = function(sections) {
	NNNPlaceAd("100x50",
		sections,
		'!category=vertical;!category=tripout;!category=video;'
	);
}

