wpniSite='nwswk';
wpniDomain='newsweek.com';
show_doubleclick_ad = true;
rssString = "from=rss";
tileThatGetsDcopt = 1;

wpniAds.templates.initRule('defaultTemplate');
wpniAds.templates.rules.defaultTemplate.what = new Array('!bigboxAJAX','!88x31','!leaderboard_2','!88x31_2', '!234x60' );

/*wpniAds.templates.initRule('noBottomLB');
wpniAds.templates.rules.noBottomLB.what =  new Array('!leaderboard_2');
wpniAds.templates.rules.noBottomLB.where = new Array('health/healthforlife');*/

wpniAds.templates.initRule('volvo');
wpniAds.templates.rules.volvo.what = new Array('leaderboard|2');
wpniAds.templates.rules.volvo.where = new Array('microsites/volvo');
wpniAds.templates.rules.volvo.when = new Array('200910250000/200912312359');

wpniAds.templates.initRule('joaquin');
wpniAds.templates.rules.joaquin.what = new Array('!articleFlex');
wpniAds.templates.rules.joaquin.where = new Array('news/nation/joaquin');
wpniAds.templates.rules.joaquin.when = new Array('200908310000/200912312359');

wpniAds.templates.initRule('smartquiz');
wpniAds.templates.rules.smartquiz.what = new Array('!bigbox');
wpniAds.templates.rules.smartquiz.where = new Array('culture/wyntk');
wpniAds.templates.rules.smartquiz.when = new Array('200908310000/201003312359');

wpniAds.templates.initRule('meacham');
wpniAds.templates.rules.meacham.what = new Array('!bigbox');
wpniAds.templates.rules.meacham.where = new Array('voices/editor');
wpniAds.templates.rules.meacham.when = new Array('201001010000/201012312359');

//8130--AP--modules
wpniAds.templates.initRule('amway');
wpniAds.templates.rules.amway.what = new Array('88x31|3');
wpniAds.templates.rules.amway.where = new Array('techbiz/greenrankings');
wpniAds.templates.rules.amway.when = new Array('200909200000/200909232359');

function initAdType(what)
{
	thisAdType = new AdInstance()
	thisAdType.testFlagArray = new Array('test_ads','test_' + what);	
	thisAdType.debugFlagArray = new Array('debugAdCode','debugAdCode_' + what);
	thisAdType.dcCode += atoz() + comment();

	switch(what)
	{
		case '468x60':
			thisAdType.size = '468x60';
			thisAdType.code = 'ad=468x60;';
		break
		
		case '120x60':
			thisAdType.size = '120x60';
			thisAdType.code = 'ad=120x60;';
		break
		
		case 'leaderboard':
			thisAdType.size = "728x90";
			thisAdType.code = "ad=lb;";
		break
		
		case '88x31':
			thisAdType.size = "88x31";
			thisAdType.code = "ad=88x31;";
		
		break;
		
		case '234x60':
			thisAdType.size = "234x60";
			thisAdType.code = "ad=234x60;";
		break;
		
		case '170x113':
			thisAdType.size = "170x113";
			thisAdType.code = "ad=170x113;";
		break;

		case '170x90':
			thisAdType.size = "170x113";
			thisAdType.code = "ad=170x113;";
		break;
		
		case '278x100':
			thisAdType.size = "278x100";
			thisAdType.code = "ad=278x100;";
		break;
		
		case '300x100':
			thisAdType.size = "300x100";
			thisAdType.code = "ad=300x100;";
		break;
		
		case 'bigbox':
			thisAdType.size = "300x250"
			thisAdType.code = "ad=bb;"
		break
		
		case 'articleFlex':
			thisAdType.size = "300x250,336x850,160x600,300x600"
			thisAdType.code = "ad=bb;ad=hp;ad=ss;"
		break
		
		case 'homepageFlex':
			thisAdType.size = "300x250,336x850"
			thisAdType.code = "ad=bb;ad=hp;"
		break

		case 'bigboxHPFlex':
			thisAdType.size = "300x250,336x850"
			thisAdType.code = "ad=bb;ad=hp;"
		break

		case 'headerDrawer':
			thisAdType.size = "998x38";
			thisAdType.code = "ad=998x38;";
		break

		case 'rightSidePromo':
			thisAdType.size = "133x294";
			thisAdType.code = "133x294;";
		break

		case 'magsub_intl':
			thisAdType.size = "262x44";
			thisAdType.code = "262x44;";
		break

		case 'magsub_us':
			thisAdType.size = "262x44";
			thisAdType.code = "262x44;";
		break

		case 'multimedia_header':
			thisAdType.size = "81x20";
			thisAdType.code = "81x20;";
		break

		case 'multimedia_header_right':
			thisAdType.size = "124x90";
			thisAdType.code = "124x90;";
		break

		case 'below_story':
			thisAdType.size = "614x66";
			thisAdType.code = "614x66;";
		break

		case 'speed_bump':
			thisAdType.size = "638x24";
			thisAdType.code = "638x24;";
		break
		
		case 'video':
			
			thisAdType.adServer = 'http://ad.doubleclick.net/pfadx/'
			thisAdType.code = "ad=video"
			thisAdType.adExecute = function (currentLoc,varDcCount,what,flexBoolean)
			{
				if(typeof config == 'undefined')
				{
					config = new Array();
				}
				
				config['adServerURL'] = this.adServer + siteZoneDir(currentLoc) + this.code + ";" + thisAdType.testAction(thisAdType.testFlagArray)
				config['additionalAdTargetingParams'] = ';' + this.dcCode
				adopsDebug("config['adServerURL']=" + config['adServerURL'] + "<br>");
				adopsDebug("config['additionalAdTargetingParams']=" + config['additionalAdTargetingParams'] + "<br>");
			}
			

		break

	}
	
	if (thisAdType.isThisManaged = true)
	{
	thisAdType.managerListLength = getHighestValue(thisAdType.when.length,thisAdType.where.length);
	}
	
	
return thisAdType
}

function front()
{
	if ( ( typeof ad_content_type != 'undefined' && ad_content_type  == 'front' ) || commercialNode && commercialNode == 'homepage')
	{
		return 'front=y;';
	}
	else
	{
		return 'front=n;'
	}
};

function comment()
{
	if ( typeof ad_content_type != 'undefined' && ad_content_type == 'comments' )
	{
		return 'com=y;';
	}
	else
	{
		return '';
	}
}

function atoz()
{
	
	if(typeof conditionID != 'undefined' && (commercialNode.match('atoz') || commercialNode.match('cam')))
	{
		var a = '=' + conditionID + ';'
		if(commercialNode.match('/atoz'))
		{
			return 'atoz' + a;
		}
		if(commercialNode.match('/cam'))
		{
			return 'cam'  + a;
		}
	}
	return '';
}


function hackBin(_arg,currentLoc,what,delivery,onTheFly)
{
	var hackReturnValue=eval(_arg)
	switch(_arg)
	{
		case 'currentLoc':
			hackReturnValue += (commercialNode == 'intl/turningpoints' && (currentLoc == 'printthis' || currentLoc == 'module/quickread'))?'/intl/turningpoints':'';
		break;

	}
	return hackReturnValue
}