//tealium universal tag - utag.80 ut4.0.201706151918, Copyright 2017 Tealium.com Inc. All Rights Reserved.
try{(function(id,loader){var u={"id":id};utag.o[loader].sender[id]=u;if(utag.ut===undefined){utag.ut={};}
var match=/ut\d\.(\d*)\..*/.exec(utag.cfg.v);if(utag.ut.loader===undefined||!match||parseInt(match[1])<35){u.loader=function(o){var b,c,l,a=document;if(o.type==="iframe"){b=a.createElement("iframe");o.attrs=o.attrs||{"height":"1","width":"1","style":"display:none"};for(l in utag.loader.GV(o.attrs)){b.setAttribute(l,o.attrs[l]);}b.setAttribute("src",o.src);}else if(o.type=="img"){utag.DB("Attach img: "+o.src);b=new Image();b.src=o.src;return;}else{b=a.createElement("script");b.language="javascript";b.type="text/javascript";b.async=1;b.charset="utf-8";for(l in utag.loader.GV(o.attrs)){b[l]=o.attrs[l];}b.src=o.src;}if(o.id){b.id=o.id};if(typeof o.cb=="function"){if(b.addEventListener){b.addEventListener("load",function(){o.cb()},false);}else{b.onreadystatechange=function(){if(this.readyState=='complete'||this.readyState=='loaded'){this.onreadystatechange=null;o.cb()}};}}l=o.loc||"head";c=a.getElementsByTagName(l)[0];if(c){utag.DB("Attach to "+l+": "+o.src);if(l=="script"){c.parentNode.insertBefore(b,c);}else{c.appendChild(b)}}}}else{u.loader=utag.ut.loader;}
if(utag.ut.typeOf===undefined){u.typeOf=function(e){return({}).toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase();};}else{u.typeOf=utag.ut.typeOf;}
u.ev={"view":1};u.initialized=false;u.scriptrequested=false;u.queue=[];u.isEmptyObject=function(o,a){for(a in o){if(utag.ut.hasOwn(o,a)){return false;}}
return true;}
u.map={};u.extend=[];u.send=function(a,b){if(u.ev[a]||u.ev.all!==undefined){utag.DB("send:80");utag.DB(b);var c,d,e,f;u.data={"qsp_delim":"&","kvp_delim":"=","base_url":"//ak.sail-horizon.com/horizon/v1.js","inject_metatag":"true","domain":"horizon.messaging.usnews.com","sailthru":{},"setup":{"useStoredTags":false},"concierge":{},"product_unit_price":[]};utag.DB("send:80:EXTENSIONS");utag.DB(b);c=[];for(d in utag.loader.GV(u.map)){if(b[d]!==undefined&&b[d]!==""){e=u.map[d].split(",");for(f=0;f<e.length;f++){if(e[f].indexOf('sailthru.')==0){u.data.sailthru[e[f].substring(9)]=b[d];}
else if(e[f].indexOf('setup.')==0){u.data.setup[e[f].substring(6)]=b[d];}
else if(e[f].indexOf('concierge.')==0){u.data.concierge[e[f].substring(10)]=b[d];}else{u.data[e[f]]=b[d];}}}}
utag.DB("send:80:MAPPINGS");utag.DB(u.data);if(u.data.product_unit_price.length===0&&b._cprice!==undefined){u.data.product_unit_price=b._cprice.slice(0);}
if(!u.data.domain){utag.DB(u.id+": Tag not fired: Required attribute not populated");return;}
if(u.typeOf(u.data.inject_metatag==="string")){u.data.inject_metatag=(u.data.inject_metatag==="true");}
if(u.data.inject_metatag){if(u.data.sailthru.price===undefined&&u.data.product_unit_price[0]!==undefined){u.data.sailthru.price=parseFloat(u.data.product_unit_price[0]);}
var header=document.getElementsByTagName('head')[0];if(header===undefined){utag.DB("ERROR: No HEAD tag found.");return;}
var currentMetaTags=document.getElementsByName("meta");for(var key in u.data.sailthru){var isUniqueMeta=true;var meta=document.createElement('meta');var metaName="sailthru."+key;var metaContent=u.data.sailthru[key];for(var i=0;i<currentMetaTags;i++){if(currentMetaTags[i].name===key){utag.DB("ERROR: Meta tag Name: "+key+"already exists on the page. Meta tag not injected.");isUniqueMeta=false;}}
if(isUniqueMeta){if(u.typeOf(metaContent)==="array"){metaContent=metaContent.join();}
meta.name=metaName;meta.content=metaContent;header.appendChild(meta);}}}
u.loader_cb=function(a,b,c){utag.DB("send:80:CALLBACK");u.data.setup.domain=u.data.domain;for(var param in u.data.setup){if(/spider|concierge|useStoredTags/.test(param)&&u.typeOf(u.data.setup[param])==="string"){u.data.setup[param]=(u.data.setup[param]==="true");}}
if(!u.isEmptyObject(u.data.concierge)){for(var param in u.data.concierge){if(/delay|offsetBottom|threshold/.test(param)&&u.typeOf(u.data.concierge[param])==="string"){u.data.concierge[param]=parseInt(u.data.concierge[param])||u.data.concierge[param];}}
u.data.setup.concierge=u.data.concierge;}
Sailthru.setup(u.data.setup);utag.DB("send:80:CALLBACK:COMPLETE");};u.callBack=function(){var data={};u.initialized=true;while(data=u.queue.shift()){u.data=data.data;u.loader_cb(data.a,data.b,data.c);}};if(u.initialized){u.loader_cb(a,b,c);}else{u.queue.push({"data":u.data,"a":a,"b":b,"c":c});if(!u.scriptrequested){u.scriptrequested=true;u.loader({"type":"script","src":u.data.base_url,"cb":u.callBack,"loc":"script","id":"utag_80","attrs":{}});}}
utag.DB("send:80:COMPLETE");}};utag.o[loader].loader.LOAD(id);}("80","usnews.main"));}catch(error){utag.DB(error);}
