Newsday.FeatureModule=function(){var m=false;var f={MODULE_ID:"#feature",CAROUSEL_VIEW_ID:"#featureCarousel",CAROUSEL_SELECTOR:"ul.carousel",NAV_CLASS:"nav",PAGER_CLASS:"pager",WRAPPER_CLASS:"wrapper",CONTENT_MAP_ID:"contentMap",QUICK_READ_ID_CLASS:"quickRead",SCRIM_CLASS:"scrim",CONTENT_CLASS:"content",NEXT_CLASS:"next",PREV_CLASS:"prev",DISABLED_CLASS:"disabled",COUNTER_CLASS:"counter",DRAG_HANDLE_CLASS:"dragHandle",DRAGGING_CLASS:"dragging",ANIMATING_CLASS:"animating",CONTENT_TARGET_CLASS:"contentTarget",HAS_SUB_CLASS:"hasSub",SCROLL_SPEED:700,QUICK_READ_SPEED:200,QUICK_READ_TEXT:"Quick Read",QUICK_READ_AD_CONFIG:{width:300,height:250},SCROLL_CONTAINER_CLASS:"jScrollPaneContainer",SLIDE_OFFSET:0};var y={html:$("html"),document:$(document),module:null,carouselView:null,carousel:null,pager:null,nav:null,contentMap:null,slices:[],dragHandle:null,quickRead:null,quickReadNav:null,quickReadNavNext:null,quickReadNavPrev:null,quickReadContent:null,quickReadClose:null,scrim:null};var p=f;var j=y;var c=null,w,n;var A=0;var I=false;var b=true;var P=function(){j.nav=j.module.find("."+p.NAV_CLASS);var C;j.nav.find(">ul>li").each(function(T){var R,X,U,W=$(this),V=this,S=W;this.$siblings=W.siblings();this.$link=W.find(">a");this.$subnav=W.find("ul.sub");R=this.$link.attr("rel");if(W.hasClass("default")){C=W}if(R){R=$(R);if(R.length){this.$content=R;$(Newsday.Global.C.FLYOUT_CLOSE_HTML).bind("click",function(Y){Y.preventDefault();if(/video/i.test(V.$content.attr("id"))){Newsday.LatestVideos.close()}M(C)}).prependTo(this.$content)}}if(this.$subnav.length){X=this.$subnav.get(0);X.h=this.$subnav.height();this.$subnav.css("position","relative");this.$subnavWrapper=$("
").css({position:"relative",overflow:"hidden","z-index":"10"}).insertBefore(this.$subnav).append(this.$subnav).hide();U=this.$subnav.find("li");this.$subnav.find("a[href!=#]").each(function(Y){if(!R){return}var aa=$(this),Z=this;this.$parentLis=U;this.$contentTarget=R.find("."+p.CONTENT_TARGET_CLASS);this.$contentTargetContainer=R.find(".jScrollPaneContainer");aa.bind("click",function(ac){ac.preventDefault();c.userInteractedWithCarousel();Z.$parentLis.removeClass(Newsday.Global.C.ACTIVE_CLASS);aa.parent().addClass(Newsday.Global.C.ACTIVE_CLASS);try{var ab=aa.attr("href");var ad="";if(ab.indexOf("entriq.net")>=0){ad="ws_results"}else{ab=ab+((ab.indexOf("?")>=0)?"&":"?")+"callback=featuredModuleDataCallback";ad="featuredModuleDataCallback"}$.jsonp({url:ab,callback:ad,cache:true,beforeSend:function(){Z.$contentTarget.empty();Z.$contentTargetContainer.addClass(Newsday.Global.C.LOADING_CLASS);j.document.trigger("emchange")},success:function(ae){Newsday.VideoJsonHandler.parse(ae).appendTo(Z.$contentTarget);Z.$contentTargetContainer.removeClass(Newsday.Global.C.LOADING_CLASS);Newsday.Global.ie6Hover("li",Z.$contentTarget);setTimeout(function(){j.document.trigger("emchange");j.document.trigger("section:dataLoaded")},0)},error:function(af,ae){Newsday.Debug.error("Error getting new content for feature module overlay: "+ae);Z.$contentTargetContainer.removeClass(Newsday.Global.C.LOADING_CLASS)}})}catch(ac){Newsday.Debug.error("Error getting new content for feature module overlay: "+ac.message);Z.$contentTargetContainer.removeClass(Newsday.Global.C.LOADING_CLASS)}})});this.$subnav.find("li>a").bind("click",function(Z){var Y=$(this);Y.parent().siblings().find(".subsub").slideUp();$(this).siblings(".subsub").slideDown();Z.preventDefault()})}this.$link.bind("click",function(Z){Z.preventDefault();var Y=$(this);if(!S.hasClass(Newsday.Global.C.ACTIVE_CLASS)){l(Y);M(S,b)}else{l(C);M(C,b)}})});if(!C){C=j.nav.find("li:first")}};var l=function(C){switch(C.attr("rel")){case"#featuredVideos":Newsday.LatestVideos.open();break;case"#featuredPhotos":Newsday.LatestVideos.cleanupPlayer();break;default:break}};var t=window.location.toString().match(/feature(\d+)/);if(t!==null){t=jQuery.jcarousel.intval(t[1])}else{t=1}var v=function(){j.carousel=j.module.find(p.CAROUSEL_SELECTOR);if(!j.carousel.length||!j.nav.length){return}j.carousel.jcarousel({pagerHTML:null,buttonPrevHTML:null,buttonNextHTML:null,autoDetectScroll:true,auto:0,initCallback:h,itemVisibleInCallback:{onBeforeAnimation:null,onAfterAnimation:F},buttonNextHTML:"",buttonPrevHTML:"",itemFirstInCallback:z,itemLastInCallback:e,classIR:"ir",classSlideTitleSuffix:"",firstSlideElement:"category",containsAds:false});j.carousel.find(".item a").live("click",function(R){var C=jQuery(this);c.userInteractedWithCarousel();if(C.hasClass("quickRead")){return}R.preventDefault();window.location.hash="#feature"+c.first;window.location.href=$(this).attr("href")});c.pager=$("#feature .nav .pager");c.jumpLink=c.pager.find(".jump a");c.buttonNext=c.pager.find("."+p.NEXT_CLASS).parent();c.buttonPrev=c.pager.find("."+p.PREV_CLASS).parent();c.buttonsBound=false;c.buttons()};var h=function(S){if(!$.isArray(Newsday.FeatureModule.unloadedSlideData)){return}c=S;j.carousel.find(">li").each(function(U){var V=$(this),T=V.find(".summary");J(V)});j.pager=j.nav.find("."+p.PAGER_CLASS);j.document.bind("load.activateFeatureOverlay",function(){var V=j.nav.find("li"),U=V.eq(0).find(">a:first"),T=false;V.each(function(){if($(this).hasClass(Newsday.Global.C.ACTIVE_CLASS)){T=true}});if(!T){U.trigger("click")}});w=c.size();if($.isArray(Newsday.FeatureModule.unloadedSlideData)){w+=Newsday.FeatureModule.unloadedSlideData.length}j.counter=$("li.counter");if(t>1){var C=Newsday.FeatureModule.unloadedSlideData.length;for(var R=1;R<=C;R++){e(S)}setTimeout(function(){c.scroll(t,false)},100)}};var e=function(S,T,R,V){if(!$.isArray(Newsday.FeatureModule.unloadedSlideData)||Newsday.FeatureModule.unloadedSlideData.length===0||c===null){return}var X=parseInt(c.options.scroll,10),W,U,C;for(C=0;C"},R=[],S=[],C,V,W=0,Y,U,Z,X=0;j.carousel.find(">li").each(function(aa){var ab=$(this);R.push({title:ab.find(".title").text(),width:((ab.hasClass("wide")||ab.hasClass("ad"))?"wide":""),displayAd:ab.hasClass("ad")})});$.each(Newsday.FeatureModule.unloadedSlideData,function(){R.push({title:this.title,width:((this.displayAd?"wide":false)||this.slideWidth||""),displayAd:this.displayAd||false})});j.contentMap=$(T.DIV).attr("id",p.CONTENT_MAP_ID).appendTo(j.carouselView);C=j.contentMap.width();V=C-(R.length*2);S=$.grep(R,function(aa){return aa.width==="wide"});Y=(S.length*2)+(R.length-S.length);Z=Math.round(V/Y);U=Math.round((V/Y)*2);$.each(R,function(aa){var ab=$(T.DIV).attr("carouselIndex",aa+1).css("width",(this.width==="wide"||this.displayAd)?U:Z).appendTo(j.contentMap);if(this.displayAd){ab.attr("title","advertisement")}else{if(this.title){ab.attr("title",this.title)}}W+=(this.width==="wide"||this.displayAd)?U:Z;j.slices.push(ab)});W+=(R.length*2);j.contentMap.css({width:W,marginLeft:(parseInt(j.contentMap.css("marginLeft"),10)-((W-C)/2))}).bind("click",function(ac){var ab=$(ac.target),aa=parseInt(ab.attr("carouselIndex"),10);if(isNaN(aa)){return}c.scroll(aa)})};var g=function(S,T,C){var R=C-1;if(typeof j.slices[R]==="undefined"||!j.slices[R].length){return}j.slices[R].addClass(Newsday.Global.C.ACTIVE_CLASS);if(!Newsday.Global.ie6){O()}};var G=function(S,T,C){var R=C-1;if(typeof j.slices[R]==="undefined"||!j.slices[R].length){return}j.slices[R].removeClass(Newsday.Global.C.ACTIVE_CLASS);if(!Newsday.Global.ie6){O()}};var F=function(R,S,C){if(!R||typeof R.renderAd!=="function"){return}R.renderAd(R,S,C)};var D=function(){j.dragHandle=$("
").addClass(p.DRAG_HANDLE_CLASS).bind("mousedown",u).appendTo(j.contentMap)};var O=function(){if(j.dragHandle===null){D()}var W=2,T=0,V,X,C,U=false,R;for(C=0;CS.offset.left&&C.pageX<(S.offset.left+S.iw)){c.scroll(R+1);return false}})};var B=function(){return false};var M=function(C,R){if(typeof C!=="object"||typeof C.jquery!=="string"||I){return}R=(typeof R==="boolean")?R:true;var T=C.get(0);try{T.$siblings.each(function(){var U=$(this);K(U,false);U.removeClass(Newsday.Global.C.ACTIVE_CLASS)});C.addClass(Newsday.Global.C.ACTIVE_CLASS);K(C,true,R);if(T.$subnav){if(!T.$subnav.find("li.active").length){T.$subnav.find("a[href!=#]:first").trigger("click")}}}catch(S){Newsday.Debug.error("Homepage feature nav not initialized correctly. Can't activate section: "+S.message)}};var K=function(X,T,R){var Y,U,C=X.get(0),W=j.module.get(0);R=(typeof R==="boolean")?R:true;W.oHeight=W.oHeight||parseInt((j.module.css("height")==="auto")?(j.module.outerHeight()-parseInt(j.module.css("padding-top"),10)-parseInt(j.module.css("padding-bottom"),10)):j.module.css("height"),10);W.vPad=W.vPad||j.module.outerHeight()-W.oHeight;try{if(typeof C.$content!=="undefined"&&C.$content.length){I=true;Y=C.$content.outerHeight();if(T){if(R){j.module.animate({height:Y-W.vPad},p.SCROLL_SPEED,"easeOutQuad");C.$content.css({top:Y-(Y*2),"z-index":40,visibility:"visible"}).animate({top:0},p.SCROLL_SPEED,"easeOutQuad",function(){j.document.trigger("section:openFinished");I=false});if(typeof C.$subnav!=="undefined"&&C.$subnav.length&&typeof C.$subnavWrapper!=="undefined"&&C.$subnavWrapper.length){var S=C.$subnav.get(0);S.h=S.h||C.$subnav.outerHeight(true);C.$subnav.css({top:S.h-(S.h*2)}).show().animate({top:0},p.SCROLL_SPEED,"easeOutQuad");C.$subnavWrapper.show().css({height:0}).animate({height:S.h},p.SCROLL_SPEED,"easeOutQuad",function(){if(Newsday.Global.ie6||Newsday.Global.ie7){$(this).css("overflow","visible").css("height","auto").css("zoom","1")}else{$(this).css("overflow","visible").css("height","auto")}});j.nav.animate({top:32},p.SCROLL_SPEED,"easeOutQuad")}}else{j.module.css({height:Y-W.vPad});C.$content.css({top:0,"z-index":40,visibility:"visible"});j.document.trigger("section:openFinished");if(typeof C.$subnav!=="undefined"&&C.$subnav.length&&typeof C.$subnavWrapper!=="undefined"&&C.$subnavWrapper.length){var S=C.$subnav.get(0);S.h=S.h||C.$subnav.outerHeight(true);C.$subnav.css({top:0}).show();C.$subnavWrapper.css({height:S.h}).show();j.nav.css({top:32})}I=false}}else{C.$content.css({"z-index":39}).animate({top:Y-(Y*2)},p.SCROLL_SPEED,"easeInQuad",function(){C.$content.css({visibility:"hidden"})});if(typeof C.$subnav!=="undefined"&&C.$subnav.length&&typeof C.$subnavWrapper!=="undefined"&&C.$subnavWrapper.length){var S=C.$subnav.get(0);S.h=S.h||C.$subnav.outerHeight(true);C.$subnav.animate({top:S.h-(S.h*2)},p.SCROLL_SPEED,"easeOutQuad");C.$subnavWrapper.animate({height:0},p.SCROLL_SPEED,"easeOutQuad",function(){C.$subnavWrapper.hide()});j.nav.animate({top:27},p.SCROLL_SPEED,"easeOutQuad")}}}else{if(T){$(document).trigger("section:close");j.module.animate({height:W.oHeight},p.SCROLL_SPEED,"easeInQuad",function(){I=false});j.nav.css({top:27})}}}catch(V){Newsday.Debug.error("Couldn't activate homepage feature overlay: "+V.message)}};var J=function(S){if(typeof S!=="object"||typeof S.jquery!=="string"){return}var R=S.data("slideData")||{title:S.find(".title").text(),category:{title:S.find(".category").text(),link:S.find(".category").attr("href")},time:S.find(".time").text(),quickReadImageURL:S.find("input[name=quickReadImageURL]").attr("value"),link:S.find(".title a").attr("href"),breakingNews:((S.find(".breaking").length)?true:false),commentCount:(parseInt(S.find(".comments").text(),10)),media:{photos:S.find(".typePhoto").attr("href"),video:S.find(".typeVideo").attr("href")},blurb:S.find(".summary").text()};if(typeof R.actions==="undefined"){R.actions={};S.find("input.action[type=hidden]").each(function(){var U=$(this);R.actions[U.attr("name")]=U.attr("value")})}S.data("slideData",R);var T;var C=S.find(".links a.quickRead");if(C.length>0){C.bind("click",function(U){U.preventDefault();N();A=parseInt(S.attr("carouselindex"),10);s(R)})}else{C=$("").attr("href","#").text(p.QUICK_READ_TEXT).bind("click",function(U){U.preventDefault();N();A=parseInt(S.attr("carouselindex"),10);s(R)});T=S.find("p.links");if(!T.length){$("

").addClass("links").append(C).insertAfter(S.find("h3"))}else{T.prepend(C)}}};var Q=function(){if(j.quickRead&&j.quickRead.length){return}var C={DIV:"
",SPAN:"",UL:"",LI:"
  • ",A:""};j.quickRead=$(C.DIV).attr("id",p.QUICK_READ_ID_CLASS);j.quickReadContent=$(C.DIV).addClass(p.CONTENT_CLASS).appendTo(j.quickRead);j.quickReadClose=$(Newsday.Global.C.FLYOUT_CLOSE_HTML).bind("click",d).appendTo(j.quickReadContent);j.quickReadNav=$(C.UL).addClass(p.PAGER_CLASS).appendTo(j.quickRead);j.quickReadPrev=$(C.LI).addClass(p.PREV_CLASS).append($(C.A).addClass(Newsday.Global.C.IR_CLASS).addClass(p.PREV_CLASS).text("\u2190").append(C.SPAN).bind("click",a)).appendTo(j.quickReadNav);j.quickReadNext=$(C.LI).addClass(p.NEXT_CLASS).append($(C.A).addClass(Newsday.Global.C.IR_CLASS).addClass(p.NEXT_CLASS).text("\u2192").append(C.SPAN).bind("click",E)).appendTo(j.quickReadNav);j.scrim=$(C.DIV).addClass(p.SCRIM_CLASS).css({opacity:0,height:j.module.outerHeight()}).appendTo(j.module);j.quickRead.appendTo(j.module)};var E=function(S){S.preventDefault();if(A===c.size()){return}var C=(A+1),R=c.list.find(">li[carouselindex="+C+"]");R.hasClass("ad")?x(R.data("tagParams")):s(R.data("slideData"));j.carousel.find("iframe").hide();c.scroll(C);A=C;q()};var a=function(S){S.preventDefault();if(A===1){return}var C=(A-1),R=c.list.find(">li[carouselindex="+C+"]");R.hasClass("ad")?x(R.data("tagParams")):s(R.data("slideData"));j.carousel.find("iframe").hide();c.scroll(C);A=C;q()};var q=function(){j.quickReadNext.removeClass(p.DISABLED_CLASS);j.quickReadPrev.removeClass(p.DISABLED_CLASS);if(A===1){j.quickReadPrev.addClass(p.DISABLED_CLASS)}else{if(A===c.size()){j.quickReadNext.addClass(p.DISABLED_CLASS)}else{j.quickReadNext.removeClass(p.DISABLED_CLASS);j.quickReadPrev.removeClass(p.DISABLED_CLASS)}}};var N=function(){if(!j.quickRead||!j.scrim){Q()}n=c.options.animation;c.options.animation=0;c.options.autoDetectScroll=false;c.options.scroll=1;j.scrim.show().animate({opacity:0.92},p.QUICK_READ_SPEED,"linear",function(){j.module.addClass(p.QUICK_READ_ID_CLASS)});j.quickRead.show().css({opacity:0}).animate({opacity:1},p.QUICK_READ_SPEED,"linear")};var d=function(){if(!j.quickRead||!j.scrim){return}j.carousel.find("iframe").show();c.options.animation=n;c.options.autoDetectScroll=true;j.scrim.animate({opacity:0},p.QUICK_READ_SPEED,"linear",function(){j.scrim.hide();j.module.removeClass(p.QUICK_READ_ID_CLASS)});j.quickRead.animate({opacity:0},p.QUICK_READ_SPEED,"linear",function(){j.quickRead.hide()})};var s=function(T){if(!T||typeof T!=="object"){return}var S={};k();q();S.textWrap=$("
    ").addClass(p.WRAPPER_CLASS);S.image=Newsday.Builder.image({url:T.quickReadImageURL,title:T.title,link:T.link});if(S.image){S.textWrap.hide();var C=function(W){var V=parseInt(j.quickReadContent.css("width"),10)-S.image.outerWidth(true);S.textWrap.css("width",V);if(S.textWrap.parent().hasClass(p.SCROLL_CONTAINER_CLASS)){S.textWrap.parent().css("width",V)}S.textWrap.show().jScrollPane()};var R=function(W){S.image.hide();var V=parseInt(j.quickReadContent.css("width"),10);S.textWrap.css("width",V);if(S.textWrap.parent().hasClass(p.SCROLL_CONTAINER_CLASS)){S.textWrap.parent().css("width",V)}S.textWrap.show().jScrollPane()};if(S.image.get(0).tagName.toLowerCase()!=="img"){S.image=S.image.find("img")}S.image.bind("load",C).bind("error",R);j.quickReadContent.append(S.image);if(Newsday.Global.ie){window.setTimeout(C,50)}}S.category=Newsday.Builder.categoryAndTime({category:{title:T.category.title,link:T.category.link},time:T.time});if(S.category){S.textWrap.append(S.category)}if(T.breakingNews){S.textWrap.append(Newsday.Builder.breakingNews())}S.title=Newsday.Builder.title({title:T.title,link:T.link,imageURL:T.imageURL});if(S.title){S.textWrap.append(S.title)}S.blurb=Newsday.Builder.blurb({txt:T.blurb});if(S.blurb){S.textWrap.append(S.blurb)}S.media=Newsday.Builder.mediaLinks(T.media);if(S.media){S.textWrap.append(S.media)}S.actions=$("").addClass("actions");S.comments=Newsday.Builder.comments({commentCount:T.commentCount,link:T.link},"
  • ");if(S.comments){S.actions.append(S.comments)}if(T.actions){$.each(T.actions,function(W,X){var V=Newsday.Builder.link({link:X,txt:W});if(V){S.actions.append($("
  • ").append(V))}})}if(Newsday.Global.ie6){S.actions.find(">li:first").addClass("first-child")}if(S.actions.children().length){S.textWrap.append(S.actions)}j.quickReadContent.append(S.textWrap);try{S.textWrap.jScrollPane()}catch(U){}};var x=function(C){k();Newsday.AdManager.render(j.quickReadContent,p.QUICK_READ_AD_CONFIG,C);j.quickReadContent.get(0).adRendered=false};var k=function(){j.quickReadContent.find(">*:not(p.close)").remove()};return{initialize:function(){if(m){return}j.module=$(p.MODULE_ID);if(!j.module.length){return}P();v();m=true}}}();$(document).bind("load.featureModule",Newsday.FeatureModule.initialize);Newsday.Global.queueCustomEvent("load.featureModule");Newsday.VideoJsonHandler=function(){var a="videoId_";var f={LI:"
  • ",MAIN:'
    ',IMG:"",LINK:'',CATEGORY:"

    ",CATEGORY_LINK:'',TIME:'',CAPTION:'

    ',META:'

    ',SUMMARY_LONG:'',TITLE:'',IMAGE_MAIN:'
    '};function d(j){if(j.time!=null&&j.time.indexOf(":")>0){j.time=j.time.substr(j.time.indexOf(":")+1)}var o=$(f.LI).attr("id",a+j.videoId);var h=$(f.MAIN);var k=$(f.LINK).append($(f.IMG).attr("src",j.imageURL));var g=$(f.CATEGORY).append($(f.CATEGORY_LINK).attr("href",j.category.link).html(j.category.title)," ",$(f.TIME).text(j.time));var p=$(f.CAPTION).html(j.caption);var n=$(f.META);var l=$(f.SUMMARY_LONG).text(j.summary);var m=$(f.TITLE).text(j.title);j.htmlId=o.attr("id");n.append(l,m);return o.append(h.append(k,g,p,n))}function e(m){var l=$(f.LI);var g=$(f.IMAGE_MAIN);var j=$(f.LINK).attr("href",m.link).append($(f.IMG).attr("src",m.imageURL));var k=$(f.CATEGORY).append($(f.CATEGORY_LINK).attr("href",m.category.link).html(m.category.title)," ",$(f.TIME).text(m.time));var h=$(f.CAPTION).html(m.title);return l.append(g.append(j,k,h))}function c(g){if(g.videoId){return d(g)}if(g.imageURL){return e(g)}return null}function b(g){g.append.apply(g,this)}return{parse:function(k){var h=[];for(var j=0,g=k.length;j",DURATION:'',TITLE:"

    ",SUMMARY:'

    ',ACTIONS:'
    ',EXPAND:'

    '};var W={autoPlay:false,showRelatedVideos:false};var A=$(document);var h;var o;var Y;var q;var D;var T;var m;var N;var F;var l;var z={};var aa;var P;var H;var p=false;var B=false;var K=false;var r=700;var G=null;var X=0;var Q=50;var O=30;var V={open:function(){e();Y.hide();g();b();Newsday.Debug.info("Newsday.LatestVideos.open()")},cleanupPlayer:function(){Newsday.Debug.info("Newsday.LatestVideos.cleanupPlayer()");t();if(G!==null){window.clearTimeout(G);G=null}if(aa){aa.destroy();aa=null}},close:function(){Newsday.Debug.info("Newsday.LatestVideos.close()");t();if(G!==null){window.clearTimeout(G);G=null}if(aa){aa.destroy();aa=null}B=false;K=false;ad();c()},test:function(){Z()},test2:function(){t()},test3:function(C){v(C)},test4:function(){y()},test5:function(C){a(C)},test6:function(){f()},test7:function(){var C={};C.type=Newsday.VideoPlayer.START_PREROLL;aa.delegateEvent(C)},test8:function(){var C={};C.type=Newsday.VideoPlayer.END_PREROLL;aa.delegateEvent(C)},test9:function(){var C={};C.type=Newsday.VideoPlayer.SHOW_HALF_LEADER;aa.delegateEvent(C)}};function e(){if(!p){ae();L();p=true}Y=h.find(u.PLAYER_CONTAINER_SELECTOR).hide()}function k(C){switch(C.type){case"section:dataLoaded":b();break;case"section:openFinished":A.trigger("emchange");K=true;break;default:break}if(B&&K&&!aa){d()}}function b(){q=$(u.VIDEOLIST_SELECTOR);q.live("click",n);if(q.length){Newsday.Debug.info("Attempting to show %o",q.eq(0));M(q.eq(0),false);B=true}}function ae(){h=$(u.CONTAINER_SELECTOR);o=$(u.COLUMN_ONE_SELECTOR);q=$(u.VIDEOLIST_SELECTOR);Y=h.find(u.PLAYER_CONTAINER_SELECTOR)}function L(){T=$(ab.DURATION);D=$(ab.CATEGORY);m=$(ab.TITLE);N=$(ab.SUMMARY);F=$(ab.ACTIONS);Y.parent().after(D,m,N,F)}function g(){A.bind("section:dataLoaded",k);A.bind("section:openFinished",k);A.bind("section:close",V.close)}function c(){A.unbind("section:dataLoaded",k);A.unbind("section:openFinished",k);A.unbind("section:close",V.close)}function J(C){if(!C.get(0)){return}var af=parseInt(C.attr("id").split("_")[1],10);if(!z[af]){z[af]={id:af,category:C.find(u.CATEGORY_SELECTOR),duration:C.find(u.DURATION_SELECTOR),title:C.find(u.TITLE_SELECTOR),summary:C.find(u.SUMMARY_SELECTOR)}}return z[af]}function d(){Y=h.find(u.PLAYER_CONTAINER_SELECTOR);var C=$.extend({},W);if(H){C.videoId=H.id}aa=Newsday.VideoPlayer.create(Y,C);aa.addCallback(Newsday.VideoPlayer.COMPLETE,S);aa.addCallback(Newsday.VideoPlayer.START_PREROLL,Z);aa.addCallback(Newsday.VideoPlayer.END_PREROLL,I);aa.addCallback(Newsday.VideoPlayer.RELATED_VIDEO_CLICK,s);Y.show();setTimeout(function(){A.trigger("emchange")},0)}function n(C){C.preventDefault();if(!$(C.target).is("a.category")){M($(this),true)}}function M(af,ag){ag=(typeof ag==="boolean")?ag:true;P=af;H=J(af);q.removeClass(u.ACTIVE_CLASS);af.addClass(u.ACTIVE_CLASS);E();var C=function(){if(aa&&aa.initialized&&typeof aa.vars==="object"){if(G!==null){window.clearTimeout(G);G=null}try{aa.setAutoPlay(ag)}catch(ah){}if(H.id!=aa.getCurrentVideoId()){aa.loadVideo(H.id)}else{if(ag){aa.play()}}}else{if(X>=(O*1000)){G=null;return}else{X+=Q;G=window.setTimeout(C,Q)}}};C()}function S(C){if(P.next("li")){M(P.next("li"),true)}}function E(){T.html(H.duration.html());D.html(H.category.html());m.html(H.title.html());N.html(H.summary.html());t("now");R();f();ad();$("ul.actions .share").unbind("click").bind("click",function(C){Newsday.LatestVideos.test3(C);C.preventDefault()});$("ul.actions .email").unbind("click").bind("click",function(C){Newsday.LatestVideos.test5(C);C.preventDefault()})}var w={collapsed:{widthOne:0,widthTwo:798,videoHeight:444},expanded:{widthOne:173,widthTwo:650,videoHeight:360}};var ac=false;function U(C){if(ac){x(w.collapsed,w.expanded,1000)}else{x(w.expanded,w.collapsed,1000)}ac=!ac;l.find("a").html(ac?"View Thumbnails":"Larger Video").toggleClass("expand").toggleClass("collapse");C.preventDefault()}function x(ah,C,ai){var al=jQuery.easing.easeInOutExpo;var ak={};for(var ag in ah){ak[ag]=C[ag]-ah[ag]}var aj=new Date().getTime();af();function af(){var am=new Date().getTime()-aj;if(am"+C+"")}t()}function v(C){if(typeof H==="undefined"||H==null||H.id==null){return}if(0==$("#featuredVideos .shareThing").length){$.jsonp({url:u.SHARE_DATA_URL+"?callback=ws_results&videoId="+H.id,callback:"ws_results",cache:true,beforeSend:function(){},success:function(af){$("#featuredVideos .videoPlayer").append("

    Share:

    X
      ");for(i=0;i"+af[i].service+"")}$("#featuredVideos .shareThing").animate({bottom:"0"},u.SHOW_SPEED)},error:function(ag,af){Newsday.Debug.error("Error getting new content for share module overlay: "+af)},complete:function(){}})}else{$("#featuredVideos .shareThing").animate({bottom:"0"},u.SHOW_SPEED)}}function y(){$("#featuredVideos .shareThing").animate({bottom:"-90px"},u.SHOW_SPEED)}function R(){$("#featuredVideos .shareThing").remove()}function a(C){if(0==$("#featuredVideos .sendEmail").length){$("#featuredVideos #mainVideo").append("

      Email This Video

      Xsend cancel
      ")}}function f(){$("#featuredVideos .sendEmail").remove()}function Z(){var C=aa.getCubeAd();if(C){$("#featuredVideos .columnOne").css("position","relative");$("#featuredVideos").append("
      ").addClass(g.MINI_SCOREBOARD_CLASS).addClass(g.LOADING_CLASS).appendTo(c.miniScoreboardWrapper);try{$.jsonp({url:g.MINI_SCOREBOARD_DATA_URL+((g.MINI_SCOREBOARD_DATA_URL.indexOf("?")>=0)?"&":"?")+"callback=scoreboardCallback",callback:"scoreboardCallback",cache:false,success:b,error:function(k,l,j){Newsday.Debug.error("Error getting data for mini scoreboard: "+l)}})}catch(i){Newsday.Debug.error("Error making XHR call for mini scoreboard data: "+i.message)}};var b=function(k){var l,j=0;c.leaguesNav=c.leaguesNav||$("
        ").addClass(g.LEAGUES_CLASS);c.leaguesNav.empty();$.each(k,function(n,o){if(j>=4){return}var i,m=$("
      • ").attr("id",g.LEAGUES_CLASS+n).text(n).bind("mouseover mouseout",function(){$(this).toggleClass(Newsday.Global.C.HOVER_CLASS)}).bind("click",function(){var p=$(this);f(p)});i=m.get(0);i.scoreData=o;c.leaguesNav.append(m);if(j===0){l=m}j++});c.miniScoreboard.removeClass(Newsday.Global.C.LOADING_CLASS).append(c.leaguesNav);c.msbCarouselWrapper=$("
        ").addClass(g.MINI_SCOREBOARD_CAROUSEL_WRAPPER_CLASS);c.msbCarousel=$("
          ").addClass(g.MINI_SCOREBOARD_CAROUSEL_CLASS);c.msbCarouselWrapper.append(c.msbCarousel).appendTo(c.miniScoreboard);c.msbCarousel.jcarousel({animation:250,autoDetectScroll:true,pagerHTML:null,buttonNextHTML:'

          »

          ',buttonPrevHTML:'

          «

          ',containsAds:false});f(l)};var f=function(n){if(typeof n!=="object"||typeof n.jquery!=="string"){return}var k,j=n.get(0),m=c.msbCarousel.get(0).jCarousel;if(typeof j.scoreData==="undefined"){return}try{m.reset()}catch(l){Newsday.Debug.error("Error emptying miniscoreboard carousel: "+l.message)}n.siblings("li").removeClass(Newsday.Global.C.ACTIVE_CLASS);n.addClass(Newsday.Global.C.ACTIVE_CLASS);$.each(j.scoreData,function(){var p=this,r=$("
          "),i=$("
            "),o=$("
          • ").addClass(g.TIME_CLASS).text(this.time);i.append(o);$.each(this.scores,function(s,t){var u=$("
          • ").addClass(g.TEAM_CLASS).append(""+s+" "+t);if(s===p.winner){u.addClass(g.WIN_CLASS)}i.append(u)});r.append(i);try{k=m.size()+1;m.add(k,r.html())}catch(q){Newsday.Debug.error("Error adding items to mini-scoreboard carousel: "+q.message)}});m.buttons()};return{initialize:function(){if(h){return}e();h=true}}}();$(document).ready(Newsday.Miniscoreboard.initialize);Newsday.Live=function(){var f=false;var h={FILTER_DATA_BASE_URL:"",DEAL_DATA_URL:"http://longisland.newsday.com/polopoly/JSON_feed.php",LIVE_CONTAINER_ID:"#liveFeed",HEADLINE_WRAPPER_CLASS:"nsLive",HEADLINE_LIST_CLASS:"liveFeedList",FILTER_CLASS:"filter",FILTER_HEADER:"Filter By:",LOCALE_SELECTION_TEXT:"Pick your town",LOCALE_CHANGE_TEXT:"Change",TIME_CLASS:"time",INFO_CLASS:"info",POP_CLASS_PREFIX:"pop",MEDIA_WRAPPER_CLASS:"mediaType",BREAKING_CLASS:"breaking",BREAKING_TEXT:"Breaking News",COMMENT_TEXT:"comment",POLL_TEXT:"Poll",VOTED_TEXT:"voted",REFRESH_CLASS:"refresh",HEADLINE_ID_PREFIX:"headline_",CHECK_INTERVAL:(60*1000),CHECK_THRESHOLD:(30*60*1000)};var j={document:$(document),liveContainer:null,sectionHeader:null,headlineWrapper:null,headlineList:null,filterList:null,activeFilter:null,locationName:null,locationSelector:null};var a=h;var b=j;var c=null;var i=new Date().getTime();var g=window.location.toString().match(/liveFilter(\d+)/);if(g!==null){g=jQuery.jcarousel.intval(g[1])}else{g=0}var n=window.location.toString().match(/liveFilterScroll(\d+)/);if(n!==null){n=jQuery.jcarousel.intval(n[1])}else{n=0}var p=function(){Newsday.Debug.info("Building Newsday Live Filter List");var r=/(\s*\(\d{5}\)\s*)/;b.headlineWrapper=b.liveContainer.find("."+a.HEADLINE_WRAPPER_CLASS);b.headlineList=b.liveContainer.find("."+a.HEADLINE_LIST_CLASS);if(!b.headlineWrapper.length||!b.headlineList.length){Newsday.Debug.error("Couldn't find the Newsday Live Headline list and wrapper element. Aborting Newsday Live setup.");return}Newsday.Live.$headlineWrapper=b.headlineWrapper;$("dl.filter").children("dd").each(function(u,s){var w=$(this);var t=w.attr("filterKey");w.attr("filterindex",u);w.data("filterKey",t);if(u===0){w.addClass(Newsday.Global.C.ACTIVE_CLASS);w.data("lastCheckTime",Newsday.Live.serverTime);b.activeFilter=w}w.bind("click",k).bind("mouseover",function(){$(this).addClass(Newsday.Global.C.HOVER_CLASS)}).bind("mouseout",function(){$(this).removeClass(Newsday.Global.C.HOVER_CLASS)});if(w.hasClass('local')){w.unbind("click",k).bind("click",function(v){v.preventDefault();if(Newsday.Live.LocationSearch.preference&&Newsday.Live.LocationSearch.preference.match(/\d{5}/)){k.call(this)}else{Newsday.Live.LocationSearch.open()}});Newsday.Live.LocationSearch.addCallback(function(){if(b.locationName===null){b.locationName=$("").text(Newsday.Live.LocationSearch.preference.replace(r,"")).insertBefore(b.locationSelector);b.locationSelector.text(a.LOCALE_CHANGE_TEXT)}else{b.locationName.text(Newsday.Live.LocationSearch.preference.replace(r,""))}k.call(w.get(0))},w.get(0));if(Newsday.Live.LocationSearch.preference&&Newsday.Live.LocationSearch.preference.match(/\d{5}/)){b.locationName=b.locationName=$(".filter .local span").text(Newsday.Live.LocationSearch.preference.replace(r,""))}b.locationSelector=w.children(".filter .local a").text((Newsday.Live.LocationSearch.preference&&Newsday.Live.LocationSearch.preference.match(/\d{5}/))?a.LOCALE_CHANGE_TEXT:a.LOCALE_SELECTION_TEXT).bind("click",function(v){v.stopPropagation();Newsday.Live.LocationSearch.open()}).bind("mouseover",function(v){v.stopPropagation()})}u++});$("dl.filter dd[filterindex="+g+"]").attr("scroll",n).click();$("ul.liveFeedList a").live("click",function(s){s.preventDefault();window.location.hash="#liveFilter"+b.activeFilter.attr("filterindex")+"/liveFilterScroll"+Math.round(Math.abs($("ul.liveFeedList").position().top));window.location.href=$(this).attr("href")});if(!autoCheckThreshold()){c=window.setInterval(d,a.CHECK_INTERVAL)}};var e=function(){var r=$("#liveFeed .refresh").addClass(Newsday.Global.C.IR_CLASS);r.bind("click",function(){o();d()});if(Newsday.Global.ie6){r.children("span").bind("mouseover mouseout",function(){$(this).toggleClass(Newsday.Global.C.HOVER_CLASS)})}};var d=function(){if(!b.activeFilter.length){return}var v=b.activeFilter.data("lastCheckTime")||"0";var t=(b.activeFilter.hasClass('local'))?Newsday.Live.LocationSearch.preference.match(/\d{5}/).toString():null;var s=(b.activeFilter.data("filterKey")==="deals")?a.DEAL_DATA_URL:a.FILTER_DATA_BASE_URL+b.activeFilter.data("filterKey");var r=(s.indexOf("://")>-1)?"jsonp":"json";var u="";if(b.activeFilter.data("filterKey")!=="deals"){s+=(t?""+t:"")+("×tamp="+v)}else{u+=("lastCheck=0")}try{$.ajax({url:s,dataType:r,data:u,success:function(x){b.headlineList.removeClass("loading");m(x)},error:function(y,x){Newsday.Debug.error("Error getting updated content for Newsday Live: "+x)}})}catch(w){Newsday.Debug.error("Error getting updated content for Newsday Live: "+w.message)}if(autoCheckThreshold()){window.clearInterval(c)}};var m=function(u){if(typeof u!=="object"){return}var v=b.activeFilter.get(0),s=new Date().getTime(),t=u.headlines||u.deals,w;if(!$.isArray(t)){return}w="prepend";b.headlineList.empty();t.reverse();$.each(t,function(){var y=a.HEADLINE_ID_PREFIX+Math.floor(Math.random()*s),x=$("
          • ").html(l(this)).attr("id",y);b.headlineList[w](x)});b.document.trigger("emchange");var r=parseInt(b.activeFilter.attr("scroll"));if(r>0){$(".nsLive .scrollable")[0].scrollTo(r);b.activeFilter.attr("scroll","")}b.activeFilter.data("lastCheckTime",u.serverTime)};var l=function(B){if(typeof B!=="object"){return}var u={P:"

            ",H3:"

            ",A:"",SPAN:"",STRONG:"",EM:""};var x=$("
            "),t,s,z,r;if(B.time&&B.time!==""){t=$(u.P).addClass(a.TIME_CLASS).text(B.time);x.append(t)}if(B.breakingNews||B.category||(B.commentCount&&B.commentCount!=="")||(B.poll&&B.poll!=="")){s=$(u.P).addClass(a.INFO_CLASS);if(B.breakingNews){s.addClass(a.BREAKING_CLASS).append($(u.STRONG).text(a.BREAKING_TEXT))}else{if(B.commentCount&&B.commentCount!==""){s.text(B.commentCount+" "+a.COMMENT_TEXT+(parseInt(B.commentCount,10)===1?"":"s"))}else{if(B.poll&&B.poll!==""){s.text(a.POLL_TEXT+" ").append($(u.EM).text(B.poll+" "+a.VOTED_TEXT))}else{if(B.category){s.text(B.category)}}}}x.append(s)}var y=B.title||B.description;var w=B.href||B.link;if(y&&y!==""){z=$(u.H3);if(typeof B.popularity!=="undefined"){var r=parseInt(B.popularity,10);if(r>=1&&r<=4){z.addClass(a.POP_CLASS_PREFIX+r)}}if(w&&w!==""){z.append($(u.A).attr("href",w).text(y))}else{z.text(y)}x.append(z)}if(B.media){var v=null,A;$.each(B.media,function(C,E){if(E===""){return}var D="type"+(C.substring(0,1).toUpperCase()+C.substring(1,C.length)).replace(/s$/i,"");if(v===null){v=$(u.P).addClass(a.MEDIA_WRAPPER_CLASS)}A=$("").attr("href",E).addClass(Newsday.Global.C.IR_CLASS).addClass(D).text(C).append(u.SPAN);v.append(A)});if(v!==null){x.append(v)}}return x.html()};var q=function(r){r.preventDefault();r.stopPropagation()};var k=function(s){if(s){s.preventDefault()}var r=$(this);if(r.hasClass('local')&&r.data("lastLocation")!==Newsday.Live.LocationSearch.preference){r.data("lastCheckTime",0).data("lastLocation",Newsday.Live.LocationSearch.preference)}else{if(r.hasClass(Newsday.Global.C.ACTIVE_CLASS)){return}Newsday.Live.LocationSearch.close()}this.$siblings=this.$siblings||r.siblings();this.$siblings.removeClass(Newsday.Global.C.ACTIVE_CLASS);r.addClass(Newsday.Global.C.ACTIVE_CLASS);b.activeFilter=r;b.headlineList.empty();b.headlineList.addClass("loading");b.document.trigger("emchange");d();o()};var o=function(){window.clearInterval(c);if(!autoCheckThreshold()){c=window.setInterval(d,a.CHECK_INTERVAL)}};autoCheckThreshold=function(){if(typeof i!=="number"||typeof a.CHECK_THRESHOLD!=="number"){Newsday.Debug.error("Error checking the Newsay Live auto-refresh timeout. Disabling auto-refresh");return true}var r=new Date().getTime();return((r-i)>a.CHECK_THRESHOLD)};return{initialize:function(){b.liveContainer=b.liveContainer||$(a.LIVE_CONTAINER_ID);if(f||!b.liveContainer.length){return}p();e();f=true},serverTime:this.serverTime||0}}();Newsday.Live.LocationSearch=function(){var f={LOCATION_LOOKUP_DATA:new Array("Albertson (11507)","Amagansett (11930)","Amityville (11701)","Aquebogue (11931)","Atlantic Beach (11509)","Babylon (11702)","Baldwin (11510)","Bay Shore (11706)","Bayport (11705)","Bayville (11709)","Bellmore (11710)","Bellport (11713)","Bethpage (11714)","Blue Point (11715)","Bohemia (11716)","Brentwood (11717)","Bridgehampton (11932)","Brightwaters (11718)","Brookhaven (11719)","Brookville (11545)","Calverton (11933)","Carle Place (11514)","Cedarhurst (11516)","Center Moriches (11934)","Centereach (11720)","Centerport (11721)","Central Islip (11722)","Centre Island (11771)","Cold Spring Harbor (11724)","Commack (11725)","Copiague (11726)","Coram (11727)","Cutchogue (11935)","Deer Park (11729)","Dix Hills (11746)","East Hampton (11937)","East Islip (11730)","East Marion (11939)","East Meadow (11554)","East Moriches (11940)","East Northport (11731)","East Norwich (11732)","East Quogue (11942)","East Rockaway (11518)","East Setauket (11733)","Eastport (11941)","Elmont (11003)","Farmingdale (11735)","Farmingville (11738)","Floral Park (11001)","Fort Salonga (11768)","Franklin Square (11010)","Freeport (11520)","Garden City (11530)","Glen Cove (11542)","Glen Head (11545)","Glenwood Landing (11547)","Great Neck (11020)","Great Neck (11021)","Great Neck (11023)","Greenlawn (11740)","Greenport (11944)","Greenvale (11548)","Hampton Bays (11946)","Hauppauge (11788)","Hempstead (11550)","Hewlett (11557)","Hicksville (11801)","Holbrook (11741)","Holtsville (11742)","Huntington (11743)","Huntington Station (11746)","Inwood (11096)","Island Park (11558)","Islandia (11749)","Islip (11751)","Islip Terrace (11752)","Jamesport (11947)","Jericho (11753)","Kings Park (11754)","Kings Point (11024)","Lake Grove (11755)","Laurel (11948)","Lawrence (11559)","Levittown (11756)","Lido Beach (11561)","Lindenhurst (11757)","Locust Valley (11560)","Long Beach (11561)","Lynbrook (11563)","Malverne (11565)","Manhasset (11030)","Manorville (11949)","Massapequa (11758)","Massapequa Park (11762)","Mastic (11950)","Mastic Beach (11951)","Mattituck (11952)","Medford (11763)","Melville (11747)","Merrick (11566)","Middle Island (11953)","Mill Neck (11765)","Miller Place (11764)","Mineola (11501)","Montauk (11954)","Moriches (11955)","Mount Sinai (11766)","Muttontown (11791)","Nesconset (11767)","New Hyde Park (11040)","New Hyde Park (11042)","North Babylon (11703)","North Bellmore (11710)","Northport (11768)","Oakdale (11769)","Ocean Beach (11770)","Oceanside (11572)","Old Bethpage (11804)","Old Westbury (11568)","Orient (11957)","Oyster Bay (11771)","Patchogue (11772)","Peconic (11958)","Plainview (11803)","Point Lookout (11569)","Port Jefferson (11777)","Port Jefferson Station (11776)","Port Washington (11050)","Quogue (11959)","Remsenburg (11960)","Ridge (11961)","Riverhead (11901)","Rockville Centre (11570)","Rocky Point (11778)","Ronkonkoma (11779)","Roosevelt (11575)","Roslyn (11576)","Roslyn Heights (11577)","Sag Harbor (11963)","Sagaponack (11962)","Sayville (11782)","Sea Cliff (11579)","Seaford (11783)","Selden (11784)","Setauket (11733)","Shelter Island (11964)","Shelter Island Heights (11965)","Shirley (11967)","Shoreham (11786)","Smithtown (11787)","Sound Beach (11789)","South Jamesport (11970)","Southampton (11968)","Southold (11971)","Speonk (11972)","St. James (11780)","Stony Brook (11790)","Stony Brook (11794)","Syosset (11791)","Uniondale (11553)","Valley Stream (11580)","Valley Stream (11581)","Wading River (11792)","Wainscott (11975)","Wantagh (11793)","Water Mill (11976)","West Babylon (11704)","West Hempstead (11552)","West Islip (11795)","West Sayville (11796)","Westbury (11590)","Westhampton (11977)","Westhampton Beach (11978)","Wheatley Heights (11798)","Williston Park (11596)","Woodbury (11797)","Woodmere (11598)","Wyandanch (11798)","Yaphank (11980)"),FLYOUT_ID:"locationSearch",RESULTS_LIST_ID:"locationSearchResults",INPUT_DEFAULT_VALUE:"Enter town or zip code...",SAVE_TEXT:"Save",CANCEL_TEXT:"Cancel",LOCALE_COOKIE:"NDLiveLocale",COOKIE_LIFE:365};var g={flyout:null,resultsList:null,searchInput:null};var a=f;var b=g;var h=null;var j=null;var e=function(){var l={DIV:"
            ",SPAN:"",FORM:"
            ",FIELDSET:"
            ",INPUT:"",BUTTON:"",UL:"
              ",LI:"
            • ",A:""};b.flyout=$(l.DIV).attr("id",a.FLYOUT_ID);b.resultsList=$(l.UL).attr("id",a.RESULTS_LIST_ID);b.searchInput=$(l.INPUT).attr("type","text").attr("name","q").attr("value",$.cookie(a.LOCALE_COOKIE)||a.INPUT_DEFAULT_VALUE).addClass("text");b.searchInput.bind("focus",function(){if(this.value===a.INPUT_DEFAULT_VALUE){this.value=""}}).bind("blur",function(){if(this.value===""){this.value=a.INPUT_DEFAULT_VALUE;b.resultsList.empty();$(document).trigger("emchange")}});b.searchInput.autocomplete(a.LOCATION_LOOKUP_DATA,{delay:150,resultTarget:b.resultsList,matchContains:true,scroll:false,autofill:true}).result(function(m,o,n){Newsday.Live.LocationSearch.preference=n});try{b.flyout.append($(Newsday.Global.C.FLYOUT_CLOSE_HTML).bind("click",i)).append($(l.FORM).addClass(Newsday.Global.C.SEARCH_FORM_CLASS).attr("method","get").attr("accept-charset","utf-8").append($(l.FIELDSET).append(b.searchInput).append($(l.BUTTON).addClass("submit").text("GO"))).bind("submit",function(m){m.preventDefault();c()})).append(b.resultsList).append($(l.UL).addClass("actions").append($(l.LI).addClass("first-child").append($(l.A).attr("href","#").text(a.SAVE_TEXT).bind("click",c))).append($(l.LI).append($(l.A).attr("href","#").text(a.CANCEL_TEXT).bind("click",i))))}catch(k){Newsday.Debug.error("Couldn't build the Location Search flyout: "+k.message)}};var c=function(k){if(k){k.preventDefault()}$.cookie(a.LOCALE_COOKIE,Newsday.Live.LocationSearch.preference,{expires:a.COOKIE_LIFE});i();if(typeof h==="function"){if(j){h.call(j)}else{h()}}};var d=function(k){if(k&&typeof k.preventDefault==="function"){k.preventDefault()}if(!b.flyout||!b.flyout.length){if(typeof Newsday.Live.$headlineWrapper!=="object"||!Newsday.Live.$headlineWrapper.length){Newsday.Debug.error("Whoops, dont have someplace to attach the location search flyout.");return}e();b.flyout.appendTo(Newsday.Live.$headlineWrapper);b.resultsList.jScrollPane({scrollbarMargin:0,maintainPosition:false})}b.flyout.show()};var i=function(k){if(k&&typeof k.preventDefault==="function"){k.preventDefault()}if(!b.flyout||!b.flyout.length){return}b.flyout.hide()};return{preference:$.cookie(a.LOCALE_COOKIE),addCallback:function(k,l){if(typeof k==="function"&&h===null){h=k;j=l||this}},open:d,close:i}}();$(document).ready(Newsday.Live.initialize);Newsday.Explore=(function(){var d=false;var f={EXPLORE_MODULE_ID:"#explore",CAROUSEL_SELECTOR:"ul.carousel",HEADER_SELECTOR:"h2.hr:first",NAV_CLASS:"nav",AD_CLASS:"ad",AD_NAV_TEXT:"Sponsors"};var h={module:null,carousel:null,nav:null,navElements:[]};var a=f;var b=h;var k;var c=function(){b.carousel=b.module.find(a.CAROUSEL_SELECTOR);b.header=b.module.find(a.HEADER_SELECTOR);if(!b.carousel.length){return}b.carousel.jcarousel({adSubselector:".adWrapper",scroll:3,initCallback:function(l){k=l;k.initCallback=null;i()},itemVisibleInCallback:{onBeforeAnimation:e,onAfterAnimation:j},itemVisibleOutCallback:{onBeforeAnimation:g,onAfterAnimation:null},containsAds:false,adConfig:{width:300,height:250}})};var i=function(){b.nav=$("
                ").addClass(a.NAV_CLASS);b.carousel.find(">li").each(function(l){var m=$(this),n=$("
              • ").attr("carouselIndex",l+1).text(m.hasClass(a.AD_CLASS)?a.AD_NAV_TEXT:m.find("h3:first").text()).appendTo(b.nav);b.navElements.push(n)});b.nav.bind("click",function(n){var m=$(n.target),l=parseInt(m.attr("carouselIndex"),10);if(isNaN(l)){return}k.scroll(l)});b.header.after(b.nav)};var e=function(n,o,l){var m=l-1;if(typeof b.navElements[m]==="undefined"||!b.navElements[m].length){return}b.navElements[m].addClass(Newsday.Global.C.ACTIVE_CLASS)};var g=function(n,o,l){var m=l-1;if(typeof b.navElements[m]==="undefined"||!b.navElements[m].length){return}b.navElements[m].removeClass(Newsday.Global.C.ACTIVE_CLASS)};var j=function(m,n,l){if(!m||typeof m.renderAd!=="function"){return}m.renderAd(m,n,l)};return{initialize:function(){b.module=b.module||$(a.EXPLORE_MODULE_ID);if(d||!b.module.length){return}c();d=true}}}());$(document).bind("load.exploreCarousel",Newsday.Explore.initialize);Newsday.Global.queueCustomEvent("load.exploreCarousel");