XLI.FeatureModule=function(){var m=false;var f={MODULE_ID:"#feature",CAROUSEL_VIEW_ID:"#featureCarousel",CALENDAR_MODULE_ID:"featuredCalendar",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_CONTAINER_CLASS:"jScrollPaneContainer",SCROLL_SPEED:700,QUICK_READ_SPEED:200,QUICK_READ_TEXT:"Quick Read",QUICK_READ_AD_CONFIG:{width:300,height:250},SLIDE_OFFSET:0};var y={html:$("html"),document:$(document),module:null,scrollables:null,carouselView:null,carousel:null,pager:null,nav:null,navList: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.scrollables=j.module.find("."+XLI.Global.C.SCROLLABLE_CLASS);j.carouselView=$(p.CAROUSEL_VIEW_ID);j.nav=j.module.find("."+p.NAV_CLASS);j.navList=j.nav.find(">ul");var C;j.navList.find(">li").each(function(T){var R,W,U,V=$(this),S=V;this.$siblings=V.siblings();this.$link=V.find(">a");this.$subnav=V.find("ul.sub");R=this.$link.attr("rel");if(V.hasClass("default")){C=V}if(R){R=$(R);if(R.length){this.$content=R;$(XLI.Global.C.FLYOUT_CLOSE_HTML).bind("click",function(X){X.preventDefault();M(C)}).prependTo(this.$content)}}if(this.$link.attr("href")===p.CAROUSEL_VIEW_ID){this.carousel=true}if(this.$subnav.length){W=this.$subnav.get(0);W.h=this.$subnav.height();this.$subnav.css("position","relative");this.$subnavWrapper=$("<div></div>").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(X){if(!R){return}var Z=$(this),Y=this;this.$parentLis=U;this.$contentTarget=R.find("."+p.CONTENT_TARGET_CLASS);this.$scrollWrapper=R.find("."+XLI.Global.C.SCROLLABLE_CLASS);this.$contentTargetContainer=R.find("."+p.SCROLL_CONTAINER_CLASS);Z.bind("click",function(ab){ab.preventDefault();c.userInteractedWithCarousel();Y.$parentLis.removeClass(XLI.Global.C.ACTIVE_CLASS);Z.parent().addClass(XLI.Global.C.ACTIVE_CLASS);try{var aa=Z.attr("href");var ac="";if(aa.indexOf("entriq.net")>=0){ac="ws_results"}else{aa=aa+((aa.indexOf("?")>=0)?"&":"?")+"callback=featuredModuleDataCallback";ac="featuredModuleDataCallback"}$.jsonp({url:aa,callback:ac,cache:true,beforeSend:function(){Y.$contentTarget.empty();Y.$contentTargetContainer.addClass(XLI.Global.C.LOADING_CLASS);Y.$scrollWrapper.jScrollPane()},success:function(ad){XLI.VideoJsonHandler.parse(ad).appendTo(Y.$contentTarget);Y.$contentTargetContainer.removeClass(XLI.Global.C.LOADING_CLASS);XLI.Global.ie6Hover("li",Y.$contentTarget);setTimeout(function(){Y.$scrollWrapper.jScrollPane();j.document.trigger("section:dataLoaded")},50)},error:function(ae,ad){XLI.Debug.error("Error getting new content for feature module overlay: "+ad);Y.$contentTargetContainer.removeClass(XLI.Global.C.LOADING_CLASS)}})}catch(ab){XLI.Debug.error("Error getting new content for feature module overlay: "+ab.message);Y.$contentTargetContainer.removeClass(XLI.Global.C.LOADING_CLASS)}})});this.$subnav.children("li").children("a").bind("click",function(Y){var X=$(this);X.parent().siblings().find(".subsub").slideUp();$(this).siblings(".subsub").slideDown();Y.preventDefault()})}this.$link.bind("click",function(Y){Y.preventDefault();var X=$(this);if(!S.hasClass(XLI.Global.C.ACTIVE_CLASS)){l(X);M(S,b)}else{l(C);M(C,b)}})});if(!C){C=j.navList.find(">li:first")}};var l=function(C){switch(C.attr("rel")){case"#featuredVideos":XLI.LatestVideos.open();break;case"#featuredPhotos":XLI.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.carouselView.find(p.CAROUSEL_SELECTOR);if(!j.carousel.length||!j.nav.length){return}j.carousel.jcarousel({pagerTarget:j.nav,pagerHTML:"",addJumpLink:true,auto:0,autoDetectScroll:true,initCallback:h,itemVisibleInCallback:{onBeforeAnimation:null,onAfterAnimation:F},buttonNextHTML:"<span></span>",buttonPrevHTML:"<span></span>",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){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.navList.find("li"),U=V.eq(0).find(">a:first"),T=false;V.each(function(){if($(this).hasClass(XLI.Global.C.ACTIVE_CLASS)){T=true}});if(!T){U.trigger("click")}});w=c.size();if($.isArray(XLI.FeatureModule.unloadedSlideData)){w+=XLI.FeatureModule.unloadedSlideData.length}j.counter=$("li.counter");if(t>1){var C=XLI.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(XLI.FeatureModule.unloadedSlideData)||XLI.FeatureModule.unloadedSlideData.length===0||c===null){return}var X=parseInt(c.options.scroll,10),W,U,C;for(C=0;C<X;C++){U=XLI.FeatureModule.unloadedSlideData.shift();if(typeof U==="undefined"){return}if(U.displayAd){c.appendAdvertisement(U)}else{W=c.appendSlide(U);W.data("slideData",U);J(W)}}};var z=function(){j.counter.text(c.first+" of "+(w-parseInt(p.SLIDE_OFFSET,10)))};var r=function(){if(!$.isArray(XLI.FeatureModule.unloadedSlideData)||c===null){return}j.module.unbind("mouseover",r);c.initCallback=null;$.each(XLI.FeatureModule.unloadedSlideData,function(){var C;if(this.displayAd){c.appendAdvertisement()}else{C=c.appendSlide(this);C.data("slideData",this);J(C)}})};var L=function(){if(!j.carouselView.length){return}var T={DIV:"<div></div>"},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(XLI.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(XLI.Global.C.ACTIVE_CLASS);if(!XLI.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(XLI.Global.C.ACTIVE_CLASS);if(!XLI.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=$("<div></div>").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;C<j.slices.length;C++){R=j.slices[C];if(R.hasClass(XLI.Global.C.ACTIVE_CLASS)){var S=R.get(0);S.pos=S.pos||R.position();S.offset=S.offset||R.offset();S.ow=S.ow||R.outerWidth(true);S.iw=S.iw||R.outerWidth();T+=S.ow}}V=j.slices[c.first-1].get(0);j.dragHandle.css({width:T+W,left:V.pos.left-(V.ow-V.iw)-W})};var u=function(){j.html.addClass(p.DRAGGING_CLASS).bind("mouseup",H).bind("mousemove",o);if($.browser.msie){j.html.bind("dragstart",B).bind("selectstart",B)}c.originalAnimation=c.originalAnimation||c.options.animation;c.options.animation=0;return false};var H=function(){j.html.removeClass(p.DRAGGING_CLASS).unbind("mouseup",H).unbind("mousemove",o);if($.browser.msie){j.html.unbind("dragstart",B).unbind("selectstart",B)}c.options.animation=c.originalAnimation};var o=function(C){$.each(j.slices,function(R){var S=this.get(0);S.offset=S.offset||this.offset();S.ow=S.ow||this.outerWidth(true);S.iw=S.iw||this.outerWidth();if(C.pageX>S.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(XLI.Global.C.ACTIVE_CLASS)});C.addClass(XLI.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){XLI.Debug.error("Homepage feature nav not initialized correctly. Can't activate section: "+S.message)}};var K=function(Z,U,S){var ab,V,Y=j.nav.get(0),aa=j.navList.get(0),C=Z.get(0),X=j.module.get(0),R;S=(typeof S==="boolean")?S:true;X.oHeight=X.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);X.vPad=X.vPad||j.module.outerHeight()-X.oHeight;Y.top=Y.top||parseInt(j.nav.css("top"),10);Y.padTop=Y.padTop||parseInt(j.nav.css("padding-top"),10);Y.padBot=Y.padBot||parseInt(j.nav.css("padding-bottom"),10);Y.w=Y.w||j.nav.outerWidth();Y.oHeight=Y.oHeight||j.nav.height();try{if((typeof C.$content!=="undefined"&&C.$content.length)||C.carousel){if(typeof C.$content!=="undefined"&&C.$content.length){R=C.$content.get(0);R.padTop=R.padTop||parseInt(C.$content.css("padding-top"),10);R.padBot=R.padBot||parseInt(C.$content.css("padding-bottom"),10)}I=true;ab=(C.carousel)?X.oHeight:C.$content.outerHeight();if(U){j.module.animate({height:(C.carousel)?ab:ab-X.vPad},p.SCROLL_SPEED,"easeOutQuad");if(C.carousel){j.carouselView.show().css({"z-index":40}).animate({opacity:1},(p.SCROLL_SPEED/3),"linear",function(){I=false})}else{C.$content.show().css({top:ab-(ab*2),visibility:"visible","z-index":40,opacity:1});C.$content.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 T=C.$subnav.get(0);T.h=T.h||C.$subnav.outerHeight(true);C.$subnav.css({top:T.h-(T.h*2)}).show().animate({top:0},p.SCROLL_SPEED,"easeOutQuad");C.$subnavWrapper.show().css({height:0}).animate({height:T.h},p.SCROLL_SPEED,"easeOutQuad",function(){if(XLI.Global.ie6||XLI.Global.ie7){$(this).css("overflow","visible").css("height","auto").css("zoom","1")}else{$(this).css("overflow","visible").css("height","auto")}})}j.nav.animate({height:(C.carousel)?Y.oHeight:ab-R.padTop-R.padBot-Y.padTop-Y.padBot,top:(C.carousel||(C.$content&&C.$content.attr("id")===p.CALENDAR_MODULE_ID))?Y.top:R.padTop,left:(C.$content&&C.$content.attr("id")===p.CALENDAR_MODULE_ID)?(Y.w-(Y.w*2)):0},p.SCROLL_SPEED,"easeOutQuad")}else{if(C.carousel){j.carouselView.css({"z-index":39}).animate({opacity:0},(p.SCROLL_SPEED/3),"linear",function(){j.carouselView.hide()})}else{if(C.$content.attr("id")==="featuredVideos"){j.document.trigger("section:close")}C.$content.css({"z-index":39}).animate({opacity:0},(p.SCROLL_SPEED/3),"linear",function(){C.$content.hide()})}if(typeof C.$subnav!=="undefined"&&C.$subnav.length&&typeof C.$subnavWrapper!=="undefined"&&C.$subnavWrapper.length){var T=C.$subnav.get(0);T.h=T.h||C.$subnav.outerHeight(true);C.$subnav.animate({top:T.h-(T.h*2)},p.SCROLL_SPEED,"easeOutQuad");C.$subnavWrapper.animate({height:0},p.SCROLL_SPEED,"easeOutQuad",function(){C.$subnavWrapper.hide()})}}}else{if(U){j.module.animate({height:X.oHeight},p.SCROLL_SPEED,"easeInQuad",function(){I=false})}}}catch(W){XLI.Debug.error("Couldn't activate homepage feature overlay: "+W.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");if(C.length>0){C.bind("click",function(U){U.preventDefault();N();A=parseInt(S.attr("carouselindex"),10);s(R)})}else{C=$("<a></a>").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){$("<p></p>").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:"<div></div>",SPAN:"<span></span>",UL:"<ul></ul>",LI:"<li></li>",A:"<a></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=$(XLI.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(XLI.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(XLI.Global.C.IR_CLASS).addClass(p.NEXT_CLASS).text("\u2192").append(C.SPAN).bind("click",E)).appendTo(j.quickReadNav);XLI.Global.ie6Hover(j.quickReadClose);XLI.Global.ie6Hover(j.quickReadPrev.find("span"));XLI.Global.ie6Hover(j.quickReadNext.find("span"));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}c.options.animation=n;c.options.autoDetectScroll=true;j.carousel.find("iframe").show();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=$("<div></div>").addClass(p.WRAPPER_CLASS);S.image=XLI.Builder.image({url:T.quickReadImageURL,title:T.title,link:T.link});if(S.image){S.textWrap.hide();var C=function(){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(){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(XLI.Global.ie){window.setTimeout(C,50)}}S.category=XLI.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(XLI.Builder.breakingNews())}S.title=XLI.Builder.title({title:T.title,link:T.link,imageURL:T.imageURL});if(S.title){S.textWrap.append(S.title)}S.blurb=XLI.Builder.blurb({txt:T.blurb});if(S.blurb){S.textWrap.append(S.blurb)}S.media=XLI.Builder.mediaLinks(T.media,"ir");if(S.media){S.textWrap.append(S.media)}S.actions=$("<ul></ul>").addClass("actions");if(T.actions){$.each(T.actions,function(W,X){var V=XLI.Builder.link({link:X,txt:W});if(V){S.actions.append($("<li></li>").append(V))}})}if(XLI.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();XLI.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",XLI.FeatureModule.initialize);XLI.Global.queueCustomEvent("load.featureModule");XLI.FeatureModule.Calendar=function(){var e=false;var k={xliPick:"ExploreLI Picks",artsEnt:"Arts & Entertainment",kidsFamily:"Kids & Family",nightlife:"Nightlife",sportsOutdoors:"Sports & Outdoors"};var g={MODULE_ID:"#featuredCalendar",MONTHLY_ID:"#monthlyFeature",DAILY_ID:"#dailyListing",DATA_URL_SELECTOR:"input[name=dataUrl]",MONTH_SELECTOR_CLASS:"monthSelector",DAILY_CLASS:"daily",PREV_CLASS:"prev",NEXT_CLASS:"next",DISABLED_CLASS:"disabled",FEATURE_CLASS:"feature",MORE_CLASS:"more",OTHER_EVENTS_ID:"#otherEvents",FILTER_CLASS:"filters",FILTER_LABEL_TEXT:"Show",VIEW_ALL_TEXT:"View All",DAILY_CAROUSEL_SELECTOR:"ul.carousel",DATE_CLASS:"date",DAYS:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};var j={module:null,monthly:null,monthlyDataUrlInput:null,monthlyFeature:null,monthlyOther:null,monthHeader:null,daily:null,dailyDataUrlInput:null,dailyWrapper:null,dailyCalendar:null,dailyFilters:null};var a=g;var b=j;var c=function(){b.monthly=$(a.MONTHLY_ID,b.module);if(!b.monthly.length){return}b.monthlyDataUrlInput=b.monthly.find(a.DATA_URL_SELECTOR);b.monthlyFeature=b.monthly.find("."+a.FEATURE_CLASS);b.monthlyOther=b.monthly.find(a.OTHER_EVENTS_ID+" ul");b.monthHeader=b.monthly.find("h3");if(!b.monthlyDataUrlInput.length){return}var q=$("<ul></ul>").addClass(a.MONTH_SELECTOR_CLASS);b.monthPrev=$("<li></li>").addClass(a.PREV_CLASS).addClass(a.DISABLED_CLASS+a.PREV_CLASS).text(a.PREV_CLASS).bind("click",p).appendTo(q);b.monthNext=$("<li></li>").addClass(a.NEXT_CLASS).text(a.NEXT_CLASS).bind("click",p).appendTo(q);q.insertAfter(b.monthHeader)};var h;var p=function(){var r=$(this);this.blur();if(r.attr("class").indexOf(a.DISABLED_CLASS)>-1){return}h=parseInt(b.monthHeader.attr("class").replace(/^month_/,""),10)+(r.hasClass("next")?1:-1);if(h>12){h=h-12}if(h<1){h=h+12}try{$.ajax({url:b.monthlyDataUrlInput.val()+h,dataType:"json",success:f,error:function(t,s){XLI.Debug.error("Request Error requesting new month data : "+s)}})}catch(q){XLI.Debug.error("XHR Error requesting new month data : "+q.message)}};var f=function(r){if(!r.name||!r.featured||!r.other){return}var q={};b.monthlyFeature.empty();b.monthHeader.text(r.name).attr("class",b.monthHeader.attr("class").replace(/\d+/,h));q.image=XLI.Builder.image({url:r.featured.imageUrl,title:r.featured.title,link:r.featured.link});q.featuredDate=$("<h4></h4>").text(r.featured.date);q.title=XLI.Builder.title({title:r.featured.title,link:r.featured.link},"<h2></h2>");q.button=XLI.Builder.button({txt:"Read More",link:r.featured.link});$.each(q,function(s,t){if(t){b.monthlyFeature.append(t)}});b.monthlyOther.empty();$.each(r.other,function(){if(!this.title){return}var t=$("<li></li>"),s=(this.link)?$("<a></a>").attr("href",this.link).text(this.title):false;(s)?t.append(s):t.text(this.title);b.monthlyOther.append(t)});b.monthPrev[r.prev?"removeClass":"addClass"](a.DISABLED_CLASS+a.PREV_CLASS);b.monthNext[r.next?"removeClass":"addClass"](a.DISABLED_CLASS+a.NEXT_CLASS)};var o=null;var n=function(){b.daily=$(a.DAILY_ID,b.module);if(!b.daily.length){return}b.dailyWrapper=b.daily.find("."+a.DAILY_CLASS);b.dailyCalendar=b.daily.find(a.DAILY_CAROUSEL_SELECTOR);b.dailyDataUrlInput=b.daily.find(a.DATA_URL_SELECTOR);if(!b.dailyDataUrlInput.length||!b.dailyWrapper.length||!b.dailyCalendar.length){return}d();try{b.dailyCalendar.jcarousel({scroll:5,containsAds:false,pagerTarget:b.daily,initCallback:function(r){o=r;r.options.initCallback=null},additionalContentBaseURL:b.dailyDataUrlInput.val(),additionalContentCallback:l})}catch(q){XLI.Debug.error("Error initializing Daily calendar carousel :"+q.message)}};var d=function(){var q={DIV:"<div></div>",H5:"<h5></h5>",LABEL:"<label></label>",INPUT:"<input />"};$wrap=$(q.DIV).addClass(a.FILTER_CLASS).append($(q.H5).text(a.FILTER_LABEL_TEXT+":"));$.each(k,function(s,t){var r=$(q.LABEL),u=$('<input type="checkbox" checked="checked" value="'+s+'"></input>').bind("change",m);r.append(u," "+t).appendTo($wrap)});b.dailyFilters=$wrap.find("input");$wrap.insertBefore(b.dailyWrapper)};var m=function(){if(!b.dailyFilters.length){return}var s=[],q={on:"",off:""};b.dailyFilters.each(function(){q[(this.checked)?"on":"off"]+=("dd."+this.value+", ");if(this.checked){s.push(this.value)}});q.on=q.on.replace(/,\s+$/,"");q.off=q.off.replace(/,\s*$/,"");try{if(q.off!==""){$(q.off,b.dailyWrapper).each(function(){var u=$(this);for(var t in s){if(u.hasClass(s[t])){return}}u.hide()})}if(q.on!==""){$(q.on,b.dailyWrapper).show()}}catch(r){XLI.Debug.error("Error filtering Daily calendar :"+r.message)}};var l=function(q){if(typeof q!=="object"||!$.isArray(q.upcoming)){return}var r={},s={DIV:"<div></div>",SPAN:"<span></span>",DL:"<dl></dl>",DT:"<dt></dt>",DD:"<dd></dd>",IMG:"<img />",A:"<a></a>"};$.each(q.upcoming,function(x,t){r.temp=$(s.DIV);r.dl=$(s.DL);r.dt=$(s.DT);var w=parseInt(o.size(),10)+1,v=new Date(t.date);r.dt.text(a.DAYS[v.getDay()]+" ").append($(s.SPAN).addClass(a.DATE_CLASS).text(v.getDate())).appendTo(r.dl);var u=function(y){r.dd=$(s.DD);if($.isArray(y.categories)){$.each(y.categories,function(){r.dd.addClass(this)})}if(typeof y.imageUrl==="string"&&y.imageUrl!==""){r.dd.addClass(a.FEATURE_CLASS);r.image=XLI.Builder.image({url:y.imageUrl,title:y.title,link:y.link});if(r.image){r.image.appendTo(r.dd)}}r.title=XLI.Builder.link({txt:y.title,link:y.link});if(r.title){r.title.appendTo(r.dd)}r.dl.append(r.dd)};if($.isArray(t.events)){$.each(t.events,function(y,z){if(typeof z.imageUrl==="string"&&z.imageUrl!==""){u(z);return false}});$.each(t.events,function(y,z){if(typeof z.imageUrl!=="string"||z.imageUrl===""){u(z)}})}if(t.more&&t.more.count&&t.more.link){r.dd=$(s.DD).addClass(a.MORE_CLASS).text(t.more.count+" more events ");r.moreLink=XLI.Builder.link({txt:a.VIEW_ALL_TEXT,link:t.more.link});if(r.moreLink){r.moreLink.appendTo(r.dd)}r.dl.append(r.dd)}r.temp.append(r.dl);o.add(w,r.temp.html())});m()};return{initialize:function(){if(e){return}b.module=$(a.MODULE_ID);if(!b.module.length){return}c();n();e=true}}}();$(document).ready(XLI.FeatureModule.Calendar.initialize);XLI.VideoJsonHandler=function(){var a="videoId_";var f={LI:"<li></li>",MAIN:'<div class="videoItem"></div>',IMG:"<img />",LINK:'<a href="#"></a>',CATEGORY:'<p class="info"></p>',CATEGORY_LINK:'<a class="category"></a>',TIME:'<em class="time"></em>',CAPTION:"<h4></h4>",META:'<p class="meta"></p>',SUMMARY_LONG:'<span class="summary-long"></span>',TITLE:'<span class="title"></span>',IMAGE_MAIN:'<div class="photoItem"></div>'};function d(j){var p=$(f.LI).attr("id",a+j.videoId);var h=$(f.MAIN);var k=$(f.LINK).append($(f.IMG).attr("src",j.imageURL));var n=$(f.CATEGORY_LINK).attr("href",j.category.link).html(j.category.title);var g=$(f.CATEGORY).append(n," ",$(f.TIME).text(j.time));var q=$(f.CAPTION).html(j.caption);var o=$(f.META);var l=$(f.SUMMARY_LONG).text(j.summary);var m=$(f.TITLE).text(j.title);o.append(l,m);return p.append(h.append(k,g,q,o))}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(k,j,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<g;j++){var m=c(k[j]);if(m==null){continue}h.push(m)}h.appendTo=b;return h}}}();XLI.LatestVideos=function(){var k={CONTAINER_SELECTOR:"#mainVideo",PLAYER_CONTAINER_SELECTOR:".flash",VIDEOLIST_SELECTOR:"#videoList li",TITLE_SELECTOR:".title",CATEGORY_SELECTOR:".category",DURATION_SELECTOR:".time",SUMMARY_SELECTOR:".summary-long",COLUMN_ONE_SELECTOR:"#featuredVideos .columnOne",ACTIVE_CLASS:"active",CLOSE_BTN_SELECTOR:"#featuredVideos .close",SHARE_DATA_URL:""};var u=k;var ac={META:'<div class="videoMeta"></div>',INFO:'<p class="info"></p>',CATEGORY:"<a></a>",DURATION:'<em class="time"></em>',TITLE:"<h2></h2>",SUMMARY:'<p class="summary"></p>',ACTIONS:'<ul class="actions"></ul>',EXPAND:'<p class="expander"></p>'};var X={autoPlay:false,showRelatedVideos:false};var B=$(document);var j;var p;var Z;var r;var ah;var E;var U;var n;var O;var G;var m;var A={};var ab;var Q;var I;var q=false;var D=false;var L=false;var x=false;var ad=false;var H=null;var Y=0;var R=50;var P=30;var W={open:function(){f();h();c()},cleanupPlayer:function(){XLI.Debug.info("XLI.LatestVideos.cleanupPlayer()");t();if(H!==null){window.clearTimeout(H);H=null}if(ab){ab.destroy();ab=null}},close:function(){t();if(H!==null){window.clearTimeout(H);H=null}if(ab){ab.destroy();ab=null}D=false;L=false;b()},test:function(){aa()},test2:function(){t()},test3:function(C){v(C)},test4:function(){z()},test5:function(C){a(C)},test6:function(){g()},test7:function(){var C={};C.type=XLI.VideoPlayer.START_PREROLL;ab.delegateEvent(C)},test8:function(){var C={};C.type=XLI.VideoPlayer.END_PREROLL;ab.delegateEvent(C)},test9:function(){var C={};C.type=XLI.VideoPlayer.SHOW_HALF_LEADER;ab.delegateEvent(C)}};function f(){if(!q){ag();M();q=true}Z=j.find(u.PLAYER_CONTAINER_SELECTOR);Z.hide()}function l(C){switch(C.type){case"section:dataLoaded":c();break;case"section:openFinished":L=true;break;default:break}if(D&&L&&!ab){e()}}function c(){r=$(u.VIDEOLIST_SELECTOR);if(r.length){N(r.eq(0),false);D=true}}function ag(){j=$(u.CONTAINER_SELECTOR);p=$(u.COLUMN_ONE_SELECTOR);r=$(u.VIDEOLIST_SELECTOR);Z=j.find(u.PLAYER_CONTAINER_SELECTOR);ah=$(u.CLOSE_BTN_SELECTOR);XLI.Global.ie6Hover(ah)}function M(){var aj=$(ac.META);var ai=$(ac.INFO);U=$(ac.DURATION);E=$(ac.CATEGORY);n=$(ac.TITLE);O=$(ac.SUMMARY);G=$(ac.ACTIONS);XLI.Global.ie6Hover(E);ai.append(E," ",U);aj.append(ai,n,O,G);Z.parent().after(aj);var C=aj.siblings(".sponsor");if(C.length){aj.append(C)}}function h(){B.bind("section:dataLoaded",l);B.bind("section:openFinished",l);B.bind("section:close",W.close)}function b(){r.die("click",o);B.unbind("section:dataLoaded",l);B.unbind("section:openFinished",l);B.unbind("section:close",W.close)}function K(C){if(!C.get(0)){return}var ai=parseInt(C.attr("id").split("_")[1],10);if(!A[ai]){A[ai]={id:ai,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 A[ai]}function e(){Z=j.find(u.PLAYER_CONTAINER_SELECTOR);var C=$.extend({},X);if(I){C.videoId=I.id}ab=XLI.VideoPlayer.create(Z,C);ab.addCallback(XLI.VideoPlayer.INITIALIZE,d);ab.addCallback(XLI.VideoPlayer.COMPLETE,T);ab.addCallback(XLI.VideoPlayer.START_PREROLL,aa);ab.addCallback(XLI.VideoPlayer.END_PREROLL,J);ab.addCallback(XLI.VideoPlayer.RELATED_VIDEO_CLICK,s);Z.show()}function d(){r.live("click",o)}function o(C){if(!$(C.target).is(".info a")){C.preventDefault();N($(this))}}function N(ai,aj){aj=(typeof aj==="boolean")?aj:true;Q=ai;I=K(ai);r.removeClass(u.ACTIVE_CLASS);ai.addClass(u.ACTIVE_CLASS);F();var C=function(){if(ab&&ab.initialized&&typeof ab.vars==="object"){if(H!==null){window.clearTimeout(H);H=null}try{ab.setAutoPlay(aj)}catch(ak){}if(I.id!=ab.getCurrentVideoId()){ab.loadVideo(I.id)}else{if(aj){ab.play()}}}else{if(Y>=(P*1000)){H=null;return}else{Y+=R;H=window.setTimeout(C,R)}}};C()}function T(C){if(Q.next("li")){N(Q.next("li"))}}function F(){U.html(I.duration.html());E.html(I.category.html());n.html(I.title.html());O.html(I.summary.html());if(x){t("now")}S();g();af();$("ul.actions .fave").unbind("click").bind("click",function(C){XLI.LatestVideos.test3(C);C.preventDefault()});$("ul.actions .friend").unbind("click").bind("click",function(C){XLI.LatestVideos.test5(C);C.preventDefault()})}var w={collapsed:{widthOne:0,widthTwo:798,videoHeight:444},expanded:{widthOne:173,widthTwo:650,videoHeight:360}};var ae=false;function V(C){if(ae){y(w.collapsed,w.expanded,1000)}else{y(w.expanded,w.collapsed,1000)}ae=!ae;m.find("a").html(ae?"View Thumbnails":"Larger Video").toggleClass("expand").toggleClass("collapse");C.preventDefault()}function y(ak,C,al){var ao=jQuery.easing.easeInOutExpo;var an={};for(var aj in ak){an[aj]=C[aj]-ak[aj]}var am=new Date().getTime();ai();function ai(){var ap=new Date().getTime()-am;if(ap<al){j.css("width",ao(null,ap,ak.widthTwo,an.widthTwo,al));p.css("width",ao(null,ap,ak.widthOne,an.widthOne,al));ab.$container.css("height",ao(null,ap,ak.videoHeight,an.videoHeight,al));setTimeout(ai,0)}else{j.css("width",C.widthTwo);p.css("width",C.widthOne);ab.$container.css("height",C.videoHeight)}}}function J(){var C=ab.getHalfLeaderAd();if(C){$("#featuredVideos #mainVideo .halfBanner").html("");$("#featuredVideos #mainVideo .halfBanner").append("<iframe class='halfBannerIframe' style='width:234px;height:60px;border:0' height='60' width='234' scrolling='no' border='0' src='"+C+"'><a href='"+C+"'>"+C+"</a></iframe>")}t()}function v(C){if(0==$("#featuredVideos .shareThing").length){$.jsonp({url:u.SHARE_DATA_URL+"?callback=ws_results&videoId="+I.id,callback:"ws_results",cache:true,beforeSend:function(){},success:function(ai){$("#featuredVideos .videoPlayer").append("<div class='shareThing'><h4>Share:</h4> <a href='#' class='close gl' onclick='XLI.LatestVideos.test4();return false;'>X<span></span></a><ul></ul></div>");for(i=0;i<ai.length;i++){$("#featuredVideos .shareThing ul").append("<li class='"+ai[i].service+"'><a href='"+ai[i].url+"'>"+ai[i].service+"</a></li>")}$("#featuredVideos .shareThing").animate({bottom:"0"},u.SHOW_SPEED)},error:function(aj,ai){XLI.Debug.error("Error getting new content for share module overlay: "+ai)},complete:function(){}})}else{$("#featuredVideos .shareThing").animate({bottom:"0"},u.SHOW_SPEED)}}function z(){$("#featuredVideos .shareThing").animate({bottom:"-90px"},u.SHOW_SPEED)}function S(){$("#featuredVideos .shareThing").remove()}function a(C){if(0==$("#featuredVideos .sendEmail").length){$("#featuredVideos #mainVideo").append("<div class='sendEmail'><form action='#TBD' method='post'><fieldset><h4>Email This Video</h4><a href='#' class='close gl' onclick='XLI.LatestVideos.test6();return false;'>X<span></span></a><label for='mail_email'>email address</label><input type='text' id='mail_email' /><label for='mail_message'>message</label><textarea cols='10' rows='4' id='mail_message'></textarea><a href='' onclick='XLI.LatestVideos.test6();return false;'>send</a> <a href='' class='cancel' onclick='XLI.LatestVideos.test6();return false;'>cancel</a></fieldset></form></div>")}}function g(){$("#featuredVideos .sendEmail").remove()}function aa(){var C=ab.getCubeAd();if(C){if(!x&&!ad){x=true;ad=true;$("#featuredVideos .columnOne").css("position","relative");$("#featuredVideos").append("<div class='adwrapen'style='position:absolute;left:10px;top:0;width:304px;height:400px;overflow:hidden'><iframe class='adboxen' style='width:300px;height:250px;position:absolute;left:310px;top:83px;border:0' height='250' width='300' scrolling='no' border='0' src='"+C+"'><a href='"+C+"'>"+C+"</a></iframe></div");$("#featuredVideos .columnOne:first, #feature .main:first, #feature .nav:first").animate({left:"-305px"},1400,function(){XLI.Debug.log("showCube: nav animation done")});$("#featuredVideos .adboxen:first").animate({left:"0"},1400,function(){XLI.Debug.log("showCube: cube animation done");ad=false})}else{XLI.Debug.error("XLI.LatestVideos.showCube(): animation failed, cube already open;")}}}function t(C){XLI.Debug.log("hideCube() called");if(x&&!(ad)){x=false;ad=true;if("now"==C){$("#featuredVideos .adboxen:first").parent().remove();$("#featuredVideos .columnOne:first, #feature .main:first, #feature .nav:first").css("left","0");ad=false}else{$("#featuredVideos .columnOne:first, #feature .main:first, #feature .nav:first").animate({left:"1"},1400,function(){XLI.Debug.log("hideCube: description animation done")});$("#featuredVideos .adboxen:first").animate({left:"305px"},1400,function(){XLI.Debug.log("hideCube: cube animation done");$(this).parent().remove();ad=false})}}else{XLI.Debug.error("XLI.LatestVideos.hideCube(): animation failed, cube already hidden;")}}function af(){$("#featuredVideos #mainVideo .halfBanner").html("")}function s(){var C=ab.getClickedVideoID();if(C){XLI.VideoGalleryOverlay.load(null,C)}}return $.extend(W,k)}();XLI.Global.queueCustomEvent("load.activateFeatureOverlay");XLI.DealOfTheDay=function(){var f=false;var i={dining:"Dining Deals",beauty:"Beauty Deals"};var h={DATA_URL:"http://longisland.newsday.com/polopoly/JSON_feed.php",ADD_TO_FAVES_URL:"/favorites/add/",MODULE_ID:"#dealOfTheDay",HEAD_CLASS:"head",BODY_CLASS:"body",FILTER_RADIO_NAME:"category",BUTTON_CLASS:"button",MORE_CLASS:"more",LOADING_CLASS:"loading",SHOW_LABEL_TEXT:"Show: ",ALL_LABEL_TEXT:" All Deals",BUTTON_CLOSED_TEXT:"Explore Deals",BUTTON_OPEN_TEXT:"Hide Deals",SAVE_TO_FAVES_TEXT:"Save to Favorites",SCROLL_SPEED:500};var j={document:null,module:null,moduleHead:null,moduleBody:null,bodyWrapper:null,filters:null,scrollable:null,dealList:null,toggleButton:null};var a=h;var c=j;initDOD=function(){var m={DIV:"<div></div>",UL:"<ul></ul>",P:"<p></p>",A:"<a></a>",FIELDSET:"<fieldset></fieldset>",LABEL:"<label></label>",INPUT:"<input />"};c.document=$(document);c.moduleHead=c.module.find("."+a.HEAD_CLASS);c.moduleBody=$(m.DIV).addClass(a.BODY_CLASS).css({position:"relative",top:"-1000px"});c.bodyWrapper=$(m.DIV).css({position:"relative",overflow:"hidden",height:0}).append(c.moduleBody).appendTo(c.module);c.filters=$(m.FIELDSET).append($(m.P).text(a.SHOW_LABEL_TEXT),$(m.LABEL).append($('<input type="radio" value="" name="'+a.FILTER_RADIO_NAME+'" />').bind("click",g),a.ALL_LABEL_TEXT));$.each(i,function(o,n){c.filters.append($(m.LABEL).append($('<input type="radio" value="'+o+'" name="'+a.FILTER_RADIO_NAME+'" />').bind("click",g),n))});c.filters.appendTo(c.moduleBody);c.dealList=$(m.UL);c.scrollable=$(m.DIV).addClass(XLI.Global.C.SCROLLABLE_CLASS).append(c.dealList).appendTo(c.moduleBody).jScrollPane();c.toggleButton=$(m.A).bind("click",e).text(a.BUTTON_CLOSED_TEXT).addClass(a.BUTTON_CLASS);$(m.P).addClass(a.MORE_CLASS).append(c.toggleButton).appendTo(c.moduleHead)};var b="closed";var l=false;var d=false;var e=function(n){n.preventDefault();if(l){return}l=true;var m=c.moduleBody.outerHeight(true);if(b==="closed"){c.moduleBody.css({top:0-m}).animate({top:0},a.SCROLL_SPEED,"easeOutQuad",function(){b="open";l=false;c.toggleButton.text(a.BUTTON_OPEN_TEXT)});c.bodyWrapper.animate({height:m},a.SCROLL_SPEED,"easeOutQuad");if(!d){c.filters.find("input[type=radio]:first").trigger("click").trigger("change")}}else{c.moduleBody.css({top:0}).animate({top:0-m},a.SCROLL_SPEED,"easeOutQuad",function(){b="closed";l=false;c.toggleButton.text(a.BUTTON_CLOSED_TEXT)});c.bodyWrapper.animate({height:0},a.SCROLL_SPEED,"easeOutQuad")}};var g=function(){var n=$(this);try{c.dealList.empty();c.scrollable.addClass(a.LOADING_CLASS).jScrollPane();$.ajax({url:a.DATA_URL,dataType:"jsonp",data:(n.attr("name")+"="+n.val()),error:function(p,o){c.scrollable.removeClass(a.LOADING_CLASS);XLI.Debug.error("Response Error requesting Deal of the day Data :"+o)},success:function(o){c.scrollable.removeClass(a.LOADING_CLASS);k(o)}})}catch(m){c.scrollable.removeClass(a.LOADING_CLASS);XLI.Debug.error("Ajax Error requesting Deal of the day Data :"+m.message)}};var k=function(m){if(!$.isArray(m.deals)){return}$.each(m.deals,function(){$("<li></li>").append($("<a></a>").addClass(XLI.Global.C.IR_CLASS).addClass("iframe").attr("title",a.SAVE_TO_FAVES_TEXT).attr("href",a.ADD_TO_FAVES_URL+this.href.substring(this.href.indexOf("?"),this.href.length)).append($("<span></span>"),a.SAVE_TO_FAVES_TEXT).fancybox({zoomOpacity:true,zoomSpeedIn:300,zoomSpeedOut:300,easingIn:"linear",easingOut:"linear",hideOnContentClick:false,frameWidth:300,frameHeight:200}),$("<a></a>").attr("href",this.href).text(this.description)).appendTo(c.dealList)});c.scrollable.jScrollPane()};return{initialize:function(){if(f){return}c.module=$(a.MODULE_ID);if(!c.module.length){return}initDOD();f=true}}}();$(document).ready(XLI.DealOfTheDay.initialize);XLI.FeaturedGuides=function(){var f=false;var d={MODULE_ID:"#featuredGuides",NAV_ID:"#featuredGuidesNav",CAROUSEL_CLASS:"carousel",CONTENT_MAP_ID:"featuredViewScrollbar",CONTENT_MAP_WRAPPER_ID:"featuredViewScrollbarWrapper",DRAG_HANDLE_CLASS:"dragHandle",DRAGGING_CLASS:"dragging"};var o={html:$("html"),module:null,nav:null,carousel:null,contentMap:null,dragHandle:null,slices:[]};var h=d;var c=o;var l=null;var n=function(){c.nav=c.module.find(h.NAV_ID);c.carousel=c.module.find("."+h.CAROUSEL_CLASS);if(!c.carousel.length||!c.nav.length){return}c.contentMapWrapper=$("<div></div>").attr("id",h.CONTENT_MAP_WRAPPER_ID).appendTo(c.module);c.carousel.jcarousel({pagerTarget:c.contentMapWrapper,scroll:3,initCallback:function(v){l=v;g();l.options.initCallback=null},itemVisibleInCallback:{onBeforeAnimation:r,onAfterAnimation:null},itemVisibleOutCallback:{onBeforeAnimation:k,onAfterAnimation:null},classIR:"ir",classSlideTitleSuffix:"",containsAds:false,animation:400});if($.isArray(XLI.FeaturedGuides.guides)){var u=c.nav.find("li"),s=u.get(0);s.$content=c.carousel.find(">li");u.bind("click",e);XLI.Global.ie6Hover(u);$.each(XLI.FeaturedGuides.guides,function(){var x=$("<li></li>").text(this.name).bind("click",e).appendTo(c.nav);var v=x.get(0);v.dataUrl=this.dataUrl;XLI.Global.ie6Hover(x)});u.eq(0).trigger("click")}if(XLI.Global.ie6||XLI.Global.ie7){var t=function(){var A=$(this),v=A.scrollTop(),x=A.height(),z=c.nav.offset(),y=c.nav.height();if(v+x>=z.top+y){c.nav.css("display","none").css("display","block")}};$(window).bind("scroll",t)}};var e=function(){var u=$(this),s=this;if(u.hasClass(XLI.Global.C.ACTIVE_CLASS)){return}this.$siblings=this.$siblings||u.siblings();l.reset();m();if(this.$content&&this.$content.length){this.$content.each(function(v){l.add((v+1),$(this).html())});g();l.setup()}else{if(this.dataUrl){try{l.container.addClass(XLI.Global.C.LOADING_CLASS);$.ajax({url:this.dataUrl,dataType:"json",cache:false,beforeSend:function(){l.lock()},success:function(v){l.container.removeClass(XLI.Global.C.LOADING_CLASS);if($.isArray(v.slides)){$.each(v.slides,function(){l.appendSlide(this)})}g();l.unlock();l.setup();s.$content=c.carousel.find(">li")},error:function(x,y,v){l.container.removeClass(XLI.Global.C.LOADING_CLASS);l.unlock();XLI.Debug.error("Error getting new featured guide carousel content: "+y)}})}catch(t){l.container.removeClass(XLI.Global.C.LOADING_CLASS);XLI.Debug.error("Error getting new featured guide carousel content: "+t.message)}}}this.$siblings.removeClass(XLI.Global.C.ACTIVE_CLASS);u.addClass(XLI.Global.C.ACTIVE_CLASS)};var g=function(){var x={DIV:"<div></div>"},t=[],v=[],u,s,z,A=0,C,y,D,B=0;if(c.contentMap!==null){m()}else{c.contentMap=$(x.DIV).attr("id",h.CONTENT_MAP_ID).appendTo(c.contentMapWrapper)}u=c.contentMap.get(0);u.oWidth=u.oWidth||c.contentMap.width();c.carousel.find(">li").each(function(E){var F=$(this);t.push({title:F.find(".title").text(),width:((F.hasClass("wide")||F.hasClass("ad"))?"wide":""),displayAd:F.hasClass("ad")})});s=c.contentMap.width();z=s-t.length;C=t.length;w=Math.round(z/C);$.each(t,function(E){var F=$(x.DIV).attr("carouselIndex",E+1).css("width",w).appendTo(c.contentMap);if(this.title){F.attr("title",this.title)}A+=w;c.slices.push(F)});c.contentMapWrapper.css("width",A);c.contentMap.css("width",A).bind("click",function(G){var F=$(G.target),E=parseInt(F.attr("carouselIndex"),10);if(isNaN(E)){return}l.scroll(E)})};var m=function(){var s=c.contentMap.get(0);c.contentMap.empty().css("width",s.oWidth);while(c.slices.length){c.slices.pop()}if(c.dragHandle!==null){c.dragHandle.remove();c.dragHandle=null}};var r=function(u,v,s){var t=s-1;if(typeof c.slices[t]==="undefined"||!c.slices[t].length){return}c.slices[t].addClass(XLI.Global.C.ACTIVE_CLASS);p()};var k=function(u,v,s){var t=s-1;if(typeof c.slices[t]==="undefined"||!c.slices[t].length){return}c.slices[t].removeClass(XLI.Global.C.ACTIVE_CLASS);p()};var q=function(){c.dragHandle=$("<div></div>").addClass(h.DRAG_HANDLE_CLASS).bind("mousedown",b).appendTo(c.contentMap);if(XLI.Global.moz){c.dragHandle.css("cursor","-moz-grab").bind("mouseup",function(){c.dragHandle.css("cursor","-moz-grab")}).bind("mousedown",function(){c.dragHandle.css("cursor","-moz-grabbing")})}};var p=function(){if(c.dragHandle===null){q()}var A=2,s=0,u,z,y,B,v=false,C;for(B=0;B<c.slices.length;B++){C=c.slices[B];C.removeClass("first").removeClass("last");if(C.hasClass(XLI.Global.C.ACTIVE_CLASS)){var t=C.get(0);t.pos=t.pos||C.position();t.offset=t.offset||C.offset();t.ow=t.ow||C.outerWidth(true);t.iw=t.iw||C.outerWidth();s+=t.ow;if(!v){C.addClass("first");u=C.get(0)}if(B===c.slices.length-1){C.addClass("last");z=C}v=C}else{if(v&&v.length){v.addClass("last");z=v}}}c.dragHandle.css({width:s+A,left:u.pos.left-(u.ow-u.iw)-A})};var b=function(){c.html.bind("mouseup",j).bind("mousemove",a);if($.browser.msie){c.html.bind("dragstart",i).bind("selectstart",i)}if(!XLI.Global.moz){c.html.addClass(h.DRAGGING_CLASS)}l.originalAnimation=l.originalAnimation||l.options.animation;l.options.animation=100;return false};var j=function(){c.html.unbind("mouseup",j).unbind("mousemove",a);if($.browser.msie){c.html.unbind("dragstart",i).unbind("selectstart",i)}if(!XLI.Global.moz){c.html.removeClass(h.DRAGGING_CLASS)}l.options.animation=l.originalAnimation};var a=function(s){$.each(c.slices,function(t){var u=this.get(0);u.offset=u.offset||this.offset();u.ow=u.ow||this.outerWidth(true);u.iw=u.iw||this.outerWidth();if(s.pageX>u.offset.left&&s.pageX<(u.offset.left+u.iw)){l.scroll(t+1);return false}})};var i=function(){return false};return{initialize:function(){if(f){return}c.module=$(h.MODULE_ID);if(!c.module.length){return}n();f=true}}}();$(document).ready(XLI.FeaturedGuides.initialize);