\n \n Advertising Content:\n \n
\n \n \n \n\n
/* Script:Prototype%20for%20Newsday%20Homepage%20%26%20Lifestyle%20Desktop - ScriptInstance:156f2ed752fd4409950fbd136658c398 - CompiledAt:2017-05-12 15:40:59 */ (function(){var shortenSummary=function(summary,maxChar){if(summary.length>maxChar){summary=summary.substr(0,maxChar);summary=summary.substr(0,Math.min(summary.length,summary.lastIndexOf(" ")));summary+="..."}return summary};var adZone="";if(window.location.host.indexOf("www")>-1){adZone="/5819/cblvsn.nwsd"}else{adZone="/5819/stg.cblvsn.nwsd"}if(window.location.search.indexOf("mvbackfill")>0){adZone="/5819/test.cblvsn.nwsd";console.log("MV Backfill Test")}var insertBackFill=function(url,loc){var s=document.createElement("script");s.setAttribute("async","async");s.type="text/javascript";s.src=url;s.className="bt-script";jQuery(loc).prepend(s)};var homeTemplate="";var compiledTemplate1="";var categoryTemplate="";templates();window.NATIVEADS=window.NATIVEADS||{};window.NATIVEADS_QUEUE=window.NATIVEADS_QUEUE||[];var q=function(){return window.NATIVEADS_QUEUE};var insertCategoryPreview=function(pageName,adUnit,adLocation){window.NATIVEADS_QUEUE.push(["insertPreview",{label:"Newsday Desktop - "+pageName,unit:{server:"dfp",id:adZone+adUnit,size:"2x2",targets:{}},location:adLocation,template:categoryTemplate,onRender:function($element){$element.next().remove()},onFill:function(data){q().push(["injectCSS","a.mv-category { background-color: rgb(255,228,196);}","head"])},onError:function(error){}}])};var insertCarouselPreview=function(pageName,adUnit){q().push(["insertPreview",{label:"Newsday Desktop - "+pageName,unit:{server:"dfp",id:adZone+adUnit,size:"2x2",targets:{}},location:".carousel li[pane=1] ul li:eq(2)",template:compiledTemplate1,onRender:function($element){jQuery(".carousel li[pane=1] ul li:eq(3)").remove();var neighbourImage=jQuery(".carousel li[pane=1] ul li:eq(1) a:eq(0) img");var adImage=jQuery(".carousel li[pane=1] ul li:eq(2) a:eq(0) img");adImage.width(neighbourImage.width());adImage.height(neighbourImage.height());var title=jQuery(".carousel li[pane=1] ul li:eq(2) div a.lead");title.width(289);var parentDivWidth=jQuery(".carousel li[pane=1] ul li:eq(2) div a.lead").parent().width();var newWidth=parentDivWidth-20;jQuery(".carousel li[pane=1] ul li:eq(2) div a.lead").width(newWidth)},onFill:function(data){q().push(["injectCSS",".paidby { text-transform:uppercase; color:black; font-size:11px; position: relative; padding-left: 10px; } .titlediv{ } .mainaddiv { background-color: rgb(255,228,196); height: 340px; position: relative; } .sponsorlogo { width: 23%; position: absolute; right: 0px; bottom: 0px; margin: 6px; } ","head"])},onError:function(error){}}])};q().push(["setPropertyID","NA-NEWS-11237364"]);q().push(["setSecondaryPageURL","/sample/publisher/sponsored.html"]);if(location.pathname=="/"){q().push(["insertPreview",{label:"Newsday Desktop - home",unit:{server:"dfp",id:adZone+"/home",size:"2x2",targets:{}},location:"#live .list:nth-child(4) > ul > li:eq(0)",infoText:"",infoButtonText:"",template:homeTemplate,onRender:function($element){jQuery(".list:last ul li:eq(1)").remove()},onFill:function(data){q().push(["injectCSS",".sponsornote { font-size: 9px; text-transform:uppercase; position:relative; top:1px; }","head"]);data.summary=shortenSummary(data.summary,50)},onError:function(error){}}])}else{var category=location.pathname.split("/")[1];var categoryName="";var categoryAdUnit="";var categoryLocation="";switch(category){case"lifestyle":categoryName="lifestyle";categoryAdUnit="/lifestyle/home";insertCarouselPreview(categoryName,categoryAdUnit);break;case"sports":categoryName="sports";categoryAdUnit=".sports/home";categoryLocation="#downpage > .col.right > a:eq(0)";insertCategoryPreview(categoryName,categoryAdUnit,categoryLocation);break;case"business":categoryName="business";categoryAdUnit=".business/home";categoryLocation="#midpage > .col > a:eq(0)";insertCategoryPreview(categoryName,categoryAdUnit,categoryLocation);break;case"long-island":if(location.pathname.split("/")[2]=="nassau"){categoryName="nassau";categoryAdUnit=".li/nassau";categoryLocation="#midpage > .col.right > a:eq(0)";insertCategoryPreview(categoryName,categoryAdUnit,categoryLocation)}else if(location.pathname.split("/")[2]=="suffolk"){categoryName="suffolk";categoryAdUnit=".li/suffolk";categoryLocation="#midpage > .col.right > a:eq(0)";insertCategoryPreview(categoryName,categoryAdUnit,categoryLocation)}break;case"entertainment":if(location.pathname.split("/")[2]=="long-island"){categoryName="long island entertainment";categoryAdUnit=".entertainment/long_island";insertCarouselPreview(categoryName,categoryAdUnit)}break;case"news":if(location.pathname.split("/")[2]=="health"){categoryName="health";categoryAdUnit=".news/health";categoryLocation="#midpage > .col.right > a:eq(0)";insertCategoryPreview(categoryName,categoryAdUnit,categoryLocation)}break;default:break}}q().push(["configureSecondaryPage",{track:function(){if(jQuery(".polar").length>0){return"inbound"}}}]);function templates(){categoryTemplate=function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,stack2,options,functionType="function",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing;buffer+='\n \n Advertising Content: '+escapeExpression((stack1=(stack1=depth0.sponsor,stack1==null||stack1===false?stack1:stack1.name),typeof stack1===functionType?stack1.apply(depth0):stack1))+'\n ';if(stack2=helpers.title){stack2=stack2.call(depth0,{hash:{},data:data})}else{stack2=depth0.title;stack2=typeof stack2===functionType?stack2.apply(depth0):stack2}buffer+=escapeExpression(stack2)+'\n ';if(stack2=helpers.summary){stack2=stack2.call(depth0,{hash:{},data:data})}else{stack2=depth0.summary;stack2=typeof stack2===functionType?stack2.apply(depth0):stack2}buffer+=escapeExpression(stack2)+"\n";return buffer};homeTemplate=function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,functionType="function",escapeExpression=this.escapeExpression;buffer+='