//instantiate restriction manager
var adRestrictionManager = new AdRestrictionManager();

//restrict leaderboards in page position 1 on player-detail pages
var restrictionOne = new AdRestriction();
restrictionOne.addParameter("Type", "PLAYER_DETAIL");
restrictionOne.addParameter("adtype", "LEADERBOARD");
restrictionOne.addParameter("PagePos", "1");
restrictionOne.isActive = false;
restrictionOne.isIframe = false;
adRestrictionManager.restriction.push(restrictionOne);

// unused
var restrictionTwo = new AdRestriction();
restrictionTwo.addParameter("UniqueId", "DIY-SECTION-33154-1");
restrictionTwo.addParameter("adtype", "SPONSORSHIP");
restrictionTwo.addParameter("PagePos", "4");
restrictionTwo.isActive = false;
restrictionTwo.isIframe = false;
//adRestrictionManager.restriction.push(restrictionTwo);

// unused
var restrictionThree = new AdRestriction();
restrictionThree.addParameter("UniqueId", "DIY-SECTION-33154-1");
restrictionThree.addParameter("adtype", "SPONSORSHIP");
restrictionThree.addParameter("PagePos", "5");
restrictionThree.isActive = false;
restrictionThree.isIframe = false;
//adRestrictionManager.restriction.push(restrictionThree);

//unused - not needed due to section default
//restrict leaderboards on the home page regardless of page position
var restrictionFour = new AdRestriction();
restrictionFour.addParameter("SctnDspName", "HOME");
restrictionFour.addParameter("adtype", "LEADERBOARD");
restrictionFour.isActive = false;
restrictionFour.isIframe = false;
//adRestrictionManager.restriction.push(restrictionFour);

//restrict leaderboards in page position 1 on TOPIC pages 
var restrictionFive = new AdRestriction();
restrictionFive.addParameter("Type", "TOPIC");
restrictionFive.addParameter("adtype", "LEADERBOARD");
restrictionFive.addParameter("PagePos", "1");
restrictionFive.isActive = false;
restrictionFive.isIframe = false;
adRestrictionManager.restriction.push(restrictionFive);

//restrict leaderboards in page position 1 on packages
var restrictionSix = new AdRestriction();
restrictionSix.addParameter("Role", "PACKAGE");
restrictionSix.addParameter("adtype", "LEADERBOARD");
restrictionSix.addParameter("PagePos", "1");
restrictionSix.isActive = false;
restrictionSix.isIframe = false;
adRestrictionManager.restriction.push(restrictionSix);

// DEFAULT RULE //
// turn off all leaderboards in position 1 on sectionfronts
var default2 = new AdDefault();
default2.addParameter("adtype", "LEADERBOARD");
default2.addParameter("Type", "SECTION");
default2.addParameter("PagePos", "1");
default2.display=false;
adRestrictionManager.adDefaults.push(default2);

// turn off leaderboard page  in page position 2 on all section fronts
var restrictionEight = new AdRestriction();
restrictionEight.addParameter("Type", "SECTION");
restrictionEight.addParameter("adtype", "LEADERBOARD");
restrictionEight.addParameter("PagePos", "2");
restrictionEight.isActive = false;
restrictionEight.isIframe = false;
//adRestrictionManager.restriction.push(restrictionEight);

// turn off leaderboard page on search pages
var restrictionNine = new AdRestriction();
restrictionNine.addParameter("SctnDspName", "SEARCH");
restrictionNine.addParameter("adtype", "LEADERBOARD");
restrictionNine.addParameter("PagePos", "1"); //this will allow pagePos 2 leaderboards on search
restrictionNine.isActive = false;
restrictionNine.isIframe = false;
adRestrictionManager.restriction.push(restrictionNine);

// turn off leaderboard page on episode search pages
var restrictionTen = new AdRestriction();
restrictionTen.addParameter("SctnDspName", "EPISODE_SEARCH");
restrictionTen.addParameter("adtype", "LEADERBOARD");
restrictionTen.addParameter("Type", "EPISODE_SEARCH");
restrictionTen.isActive = false;
restrictionTen.isIframe = false;
adRestrictionManager.restriction.push(restrictionTen);

//restrict leaderboards in page position 1 on player pages
var restrictionEleven = new AdRestriction();
restrictionEleven.addParameter("Type", "PLAYER");
restrictionEleven.addParameter("adtype", "LEADERBOARD");
restrictionEleven.addParameter("PagePos", "1");
restrictionEleven.isActive = false;
restrictionEleven.isIframe = false;
adRestrictionManager.restriction.push(restrictionEleven);

// turn off all calls to the glidden ad (DEFAULT RULE)
var default1 = new AdDefault();
default1.addParameter("adtype", "SPONSORSHIP_CONTENT");
default1.addParameter("keyword", "GLIDDEN");
default1.display=false;
adRestrictionManager.adDefaults.push(default1);

// turn on calls to the glidden ad from the homepage
var restrictionTwelve = new AdRestriction();
restrictionTwelve.addParameter("adtype", "SPONSORSHIP_CONTENT");
restrictionTwelve.addParameter("keyword", "GLIDDEN");
restrictionTwelve.addParameter("Classification", "HOME,DIY");
restrictionTwelve.addParameter("UniqueId", "DIY-SECTION-33154-1");
restrictionTwelve.isActive = false;
restrictionTwelve.isIframe = false;
adRestrictionManager.restriction.push(restrictionTwelve);


// turn off pushdown on search pages
var restrictionThirteen = new AdRestriction();
restrictionThirteen.addParameter("SctnDspName", "SEARCH");
restrictionThirteen.addParameter("adtype", "PUSHDOWN");
restrictionThirteen.addParameter("PagePos", "1"); 
restrictionThirteen.isActive = false;
restrictionThirteen.isIframe = false;
adRestrictionManager.restriction.push(restrictionThirteen);


// turn on leaderboard in Marketplace section fronts
var restrictionFourteen = new AdRestriction();
restrictionFourteen.addParameter("adtype", "LEADERBOARD");
restrictionFourteen.addParameter("Type", "SECTION"); 
restrictionFourteen.addParameter("CategoryDspName", "MARKETPLACE");
restrictionFourteen.isActive = false;
restrictionFourteen.isIframe = false;
adRestrictionManager.restriction.push(restrictionFourteen);