wpniSite='roots';
wpniDomain='theroot.com';
tileThatGetsDcopt = 1;
var noPops;

wpniAds.templates.initRule('defaultTemplate');
wpniAds.templates.rules.defaultTemplate.what = new Array('!336x90','!88x31','!headerTile','!120x90','!leaderboard_2','!rightbigbox','!sponsor');

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('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');

//18408-AR-251855146, 251855086
wpniAds.templates.initRule('homepageATT');
wpniAds.templates.rules.homepageATT = {
  what : ['leaderboard'],
  where : ['homepage'],
  when : ['201202010000/201202082359']
  
}

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 'rightbigbox':
   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 '336x60':
   thisAdType.size = "336x60";
   thisAdType.code = "ad=336x60;";
  break;  
 
  case '336x60_homepage':
   thisAdType.size = "336x60";
   thisAdType.code = "ad=336x60_homepage;";
  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;
  
  case 'sponsor':
   thisAdType.size = "1x1";
   thisAdType.code = "";
  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';
      }
      //tileThatGetsDcopt = (currentLoc=='homepage')?1:2;
      
    break;
    
    case 'delivery':
      if(delivery=='AJAX' && what=='leaderboard') { 
        ord_override = true;
      }
    break;
  }
  return hackReturnValue
}






