wpniSite='roots';
wpniDomain='theroot.com';
tileThatGetsDcopt = 2;
var noPops;

wpniAds.templates.initRule('defaultTemplate');
wpniAds.templates.rules.defaultTemplate.what = new Array('!tiffanytile','!336x90','!88x31','!headerTile','!120x90');

wpniAds.templates.initRule('no_lb_on_homepage');
wpniAds.templates.rules.no_lb_on_homepage.what = new Array('!leaderboard');
wpniAds.templates.rules.no_lb_on_homepage.where = new Array('homepage');

wpniAds.templates.initRule('lb_on_homepage');
wpniAds.templates.rules.lb_on_homepage.what = new Array('leaderboard');
wpniAds.templates.rules.lb_on_homepage.where = new Array('homepage');
wpniAds.templates.rules.lb_on_homepage.when = new Array('200905270000/200912312359')

wpniAds.templates.initRule('mt');
wpniAds.templates.rules.mt.what = new Array('!flex_2');
wpniAds.templates.rules.mt.where = new Array('roots/mappingtool');

//11266-MM-RZ
wpniAds.templates.initRule('root100');
wpniAds.templates.rules.root100.what = new Array('!midarticleflex');
wpniAds.templates.rules.root100.where = new Array('views/root100');

wpniAds.templates.initRule('hbo');
wpniAds.templates.rules.hbo.what = new Array('45x45');
wpniAds.templates.rules.hbo.where = new Array('homepage');
wpniAds.templates.rules.hbo.hardcodes = '<a href="http://ad.doubleclick.net/clk;85873625;23900073;l?http://www.hbo.com"><img height="46" width="45" alt="HBO" src="http://www.theroot.com/media/71/HBO_45x45_Logo_Black.jpg" border="0"/></a>';
wpniAds.templates.rules.hbo.when = new Array('200901010000/200912312359');

wpniAds.templates.initRule('obama');
wpniAds.templates.rules.obama.what = new Array('180x88');
wpniAds.templates.rules.obama.where = new Array('homepage');
wpniAds.templates.rules.obama.hardcodes = '<a href="http://www.theroot.com/id/48731" target="_blank"><img src="http://www.theroot.com/media/25/obamarightside-1-edit1.JPG" alt="" style="width:180px;height:88px;border:0px"/></a>';
wpniAds.templates.rules.obama.when = new Array('200812010000/200912312359');

//11427-BP-218232796,218232813-rev#27
wpniAds.templates.initRule('root_tiff');
wpniAds.templates.rules.root_tiff.what = new Array('tiffanytile');
wpniAds.templates.rules.root_tiff.where = new Array('');
wpniAds.templates.rules.root_tiff.when = new Array('200910260000/200911082359');
//11427-BP-218232796,218232813-rev#27
wpniAds.templates.initRule('no_root_tiff');
wpniAds.templates.rules.no_root_tiff.what = new Array('!tiffanytile');
wpniAds.templates.rules.no_root_tiff.where = new Array('homepage','views/root100');
wpniAds.templates.rules.no_root_tiff.when = new Array('200910260000/200911082359');

//11507-BP-219288620
wpniAds.templates.initRule('root_hp_tiff');
wpniAds.templates.rules.root_hp_tiff.what = new Array('tiffanytile');
wpniAds.templates.rules.root_hp_tiff.where = new Array('homepage');
wpniAds.templates.rules.root_hp_tiff.when = new Array('200911020000/200911082359');

//11591-MB-218232782
if ((pageId() != 'pageId=roots-views-meet-root-100;') && (pageId() != 'pageId=roots-views-root-100;'))
{
	wpniAds.templates.initRule('root_tiff_no_homepage2');
	wpniAds.templates.rules.root_tiff_no_homepage2.what = new Array('tiffanytile');
	wpniAds.templates.rules.root_tiff_no_homepage2.where = new Array('');
	wpniAds.templates.rules.root_tiff_no_homepage2.when = new Array('200911090000/200911152359');
}

//11591-MB-218232782
wpniAds.templates.initRule('root_tiff_no_homepage1');
wpniAds.templates.rules.root_tiff_no_homepage1.what = new Array('!tiffanytile');
wpniAds.templates.rules.root_tiff_no_homepage1.where = new Array('homepage');
wpniAds.templates.rules.root_tiff_no_homepage1.when = new Array('200911090000/200911152359');



function root_front()
{
	if(location.href.match('theroot.com') && location.href.match('/'))
	{
		var page_loc_array = location.href.split('/');
		var page_loc = page_loc_array[page_loc_array.length-1];
		return (page_loc.match(/[a-zA-Z]*-+/gi)) ? true : false;
	}
}



function initAdType(what)
{
 var thisAdType = new AdInstance()
 thisAdType.testFlagArray = new Array('test_ads','test_' + what); 
 thisAdType.debugFlagArray = new Array('debugAdCode','debug' + what);
 
 switch(what)
 {
  case 'flex':
   thisAdType.size = "300x250,336x850,160x600";
   thisAdType.code = "ad=bb;ad=hp;ad=ss;"
  break;

  case '45x45':
   thisAdType.size = "45x45";
   thisAdType.code = "ad=45x45;"
  break;
  
  case 'bigbox':
   thisAdType.size = "300x250";
   thisAdType.code = "ad=bb;"
  break;
 
  case 'leaderboard':
   thisAdType.size = "728x90";
   thisAdType.code = "ad=lb;"
  break;

  case '234x60':
   thisAdType.size = "234x60";
   thisAdType.code = "ad=234x60;";
  break;
  
  case '336x90':
   thisAdType.size = "336x90";
   thisAdType.code = "ad=336x90;";
  break;

  case 'tiffanytile':
   thisAdType.size = "234x60,290x60,300x45";
   thisAdType.code = "ad=tiff;"
  break;
  
  case 'midarticleflex':
	thisAdType.size = "300x250,446x33"
	thisAdType.code = "ad=bb;"
  break;

  
    case 'headerTile':
   thisAdType.size = "234x60,290x60,300x45";
   thisAdType.code = "ad=tiff;"
  break;
  
  case '180x88':
   thisAdType.size = "180x88";
   thisAdType.code = "ad=180x88;"
  break;

  case '88x31':
   thisAdType.size = "88x31";
   thisAdType.code = "ad=88x31;";
  break;
  
    case '120x90':
   thisAdType.size = "120x90";
   thisAdType.code = "ad=120x90;";
  break;

 }
return thisAdType
}

function hackBin(_arg,currentLoc,what,delivery,onTheFly)
{
	var hackReturnValue=eval(_arg)
	switch(_arg)
	{
		case 'currentLoc':
			if( location.href.match('46125') || location.href.match('46132') ){
				hackReturnValue = 'view/womenstory';
				hackReturnValue = hackReturnValue.replace(/root[s]{0,1}\./gi,'');
			}
			if(currentLoc == 'homepage' && location.href.match('reload=true')){
				hackReturnValue = currentLoc + '/refresh';
			}
		break;
	}
	return hackReturnValue
}