adServeLoad(destinationsMonsterAd); function adServeLoad(monsterJSON){ /* START HERE WHEN COMMENTING OUT*/ var monsterObj = JSON.parse(monsterJSON); adToDisplay = Math.floor(Math.random() * (monsterObj.ads.length)); //Debug //console.log("ad to display:" + adToDisplay); //console.log(monsterObj) //console.log(monsterJSON) var viewport = screen.width; //var deviceType = navigator.userAgent.toLowerCase(); var creativeID = monsterObj.ads[adToDisplay].id; //unique cookie id var fullAd = false; var adSize = 1; //Desktop = 3, Tablet = 2, Mobile = 1 var imgSrc = ''; var adLink = monsterObj.ads[adToDisplay].adLink; var correctHeight = 0; var correctWidth = 0; var i = document.createElement('img'); var a = document.createElement('a'); var frequencyCap = 1; //in Days //Show the entire ad if the cookie has not been set, otherwise show the smaller version cookieExists = readCookie(creativeID) fullAd = (cookieExists) ? false : true; if(cookieExists != true) createCookie(creativeID,creativeID,frequencyCap); if(viewport >= 1200){ adSize = 3; }else if(viewport > 767 && viewport < 1200){ adSize = 2; } else { adSize = 1; } switch(adSize){ case 1: if(fullAd){ imgSrc = monsterObj.ads[adToDisplay].smallAdFull; correctHeight = monsterObj.ads[adToDisplay].smallAdFullHeight; correctWidth = monsterObj.ads[adToDisplay].smallAdFullWidth; }else{ imgSrc = monsterObj.ads[adToDisplay].smallAdCondensed; correctHeight = monsterObj.ads[adToDisplay].smallAdCondensedHeight; correctWidth = monsterObj.ads[adToDisplay].smallAdCondensedWidth; } break; case 2: if(fullAd){ imgSrc = monsterObj.ads[adToDisplay].mediumAdFull; correctHeight = monsterObj.ads[adToDisplay].mediumAdFullHeight; correctWidth = monsterObj.ads[adToDisplay].mediumAdFullWidth; }else{ imgSrc = monsterObj.ads[adToDisplay].mediumAdCondensed; correctHeight = monsterObj.ads[adToDisplay].mediumAdCondensedHeight; correctWidth = monsterObj.ads[adToDisplay].mediumAdCondensedWidth; } break; case 3: default: if(fullAd){ imgSrc = monsterObj.ads[adToDisplay].largeAdFull; correctHeight = monsterObj.ads[adToDisplay].largeAdFullHeight; correctWidth = monsterObj.ads[adToDisplay].largeAdFullWidth; }else{ imgSrc = monsterObj.ads[adToDisplay].largeAdCondensed; correctHeight = monsterObj.ads[adToDisplay].largeAdCondensedHeight; correctWidth = monsterObj.ads[adToDisplay].largeAdCondensedWidth; } break; } //a.setAttribute('href',adLink); trackImpression(adLink,'EIN-Monster-'+creativeID); //track the impression a.addEventListener('click', function() { trackOutboundLink(adLink,'EIN-Monster-Click'); return false; }) i.src = imgSrc; document.getElementById("i").appendChild(a).appendChild(i); i.style.height = correctHeight; i.style.width = correctWidth; /*END HERE*/ } /* Menu Click Serving */ //Local $('#menu-item-141681 ul').on('click', function(){ window.location.href = 'http://www.eastidahocu.org/'; }) /* // US/World $('#menu-item-141684 ul').on('click', function(){ window.location.href = ''; }) */ //Live Better $('#menu-item-141691 ul').on('click', function(){ window.location.href = 'http://abseevisioncare.com/'; }) //Money $('#menu-item-141701 ul').on('click', function(){ window.location.href = 'http://www.taylorchev.com/'; }) //Cool Stuff /* $('#menu-item-202844 ul').on('click', function(){ window.location.href = ''; }) */ });
team-jp

SURVEY: TELL US HOW WE’RE DOING AND WIN FREE ICE CREAM

0 By: EastIdahoNews.com staff November 27, 2016 at 5:05 pm
nrf

US to build $1.6B east Idaho facility for warships’ nuclear waste

0 By: Shelbie Harris, Idaho State Journal December 7, 2016 at 4:29 pm
nes-classic

NES Classic giveaway

0 By: EastIdahoNews.com staff December 7, 2016 at 2:19 pm
nes-classic-edition

Nintendo NES Classic Edition contest rules

0 By: EastIdahoNews.com staff December 7, 2016 at 2:02 pm
dapl03

Fight against pipeline not over, say local protestors

0 By: Debbie Bryce, EastIdahoNews.com December 7, 2016 at 1:30 pm
drone LDS church

Chief: LDS Church fire does not appear suspicious

0 By: Nate Eaton & Stephan Rockefeller, EastIdahoNews.com December 7, 2016 at 11:05 am
Annette Lott crying

Secret Santa provides a touching gift for this mother’s deceased daughter

0 By: Nate Eaton, EastIdahoNews.com December 7, 2016 at 10:30 am
Blaney

Witnesses testify in Pocatello murder case

0 By: Debbie Bryce, EastIdahoNews.com December 7, 2016 at 9:58 am
natewoolf_3

Man with terminal brain tumor meets players of NY Giants team

1 By: Natalia Hepworth, EastIdahoNews.com December 7, 2016 at 8:05 am
Stephan Rockeffel | EastIdahoNews.com

VIDEO/PHOTOS: Fire rips through Swan Valley LDS Church

0 By: Nate Eaton & Stephan Rockefeller, EastIdahoNews.com December 6, 2016 at 6:35 pm
3k0a2291-2

UPDATE: Massive fire destroys Swan Valley LDS Church

2 By: Nate Sunderland, EastIdahoNews.com December 6, 2016 at 3:29 pm
Matthew-Burgett

Blackfoot man pleads guilty to possession of homemade bombs

0 By: EastIdahoNews.com staff December 6, 2016 at 1:47 pm
udot-camjp

Idaho Falls man hit by SUV, killed in Salt Lake City

0 By: EastIdahoNews.com staff December 6, 2016 at 1:41 pm