
Citysearch.Text.Boc={nationalPromoLink:"view more cities",nationalPromoPopupTitle:"view more cities",newMembersModalTitle:"join now",otherCitiesLink:"view more cities",otherPollsLink:"view more",otherCitiesPopupTitle:"view more cities",otherPollsPopupTitle:"view more"};Citysearch.Boc={id:{findLocationId:"bocGeographies",changeStateId:"changeBocState",heroModuleId:"bocHero",moreUpdatesId:"viewMoreUpdates",olderWinnerModuleId:"bocOlderWinners",nationalPromoModuleId:"bocNationalPromo",newMembersModuleId:"newMembers",otherCitiesModuleId:"bocOtherCities",otherPollsModuleId:"bocOtherPolls",olderWinnerClass:"bocOlderWinner",currentClass:"current"},defaults:{numOfCitiesShown:7,numOfPollsShown:10},init:function(){if(Citysearch.logging>=3){console.info("INFO: Citysearch.Boc.init");}
if($(this.id.heroModuleId)){this.heroModule();}
if($(this.id.olderWinnerModuleId)){this.olderWinnerModule();}
if($(this.id.moreUpdatesId)){this.hijaxMoreUpdates();}
if($(this.id.findLocationId)){this.hijaxFindLocation();}
if($(this.id.nationalPromoModuleId)){this.nationalPromoModule();}
if($(this.id.newMembersModuleId)){this.newMembersModule();}
if($(this.id.otherCitiesModuleId)){this.otherCitiesModule();}
if($(this.id.otherPollsModuleId)){this.otherPollsModule();}},heroModule:function(options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.heroModule");}
if(Citysearch.TempConfig.Boc.HeroSlides.length>3){var bocSlideshow=new Citysearch.Slideshow.Boc(Citysearch.TempConfig.Boc.HeroSlides,{'slideWidth':50,'slidePaddings':13});bocSlideshow.addControl('next',$('bocHeroNext'));bocSlideshow.addControl('prev',$('bocHeroPrevious'));bocSlideshow.addAutoSlide({'delayTime':2500});var jspSlides=$('bocHeroSlideContainer').getElements('img');for(var i=0;i<jspSlides.length;i++){bocSlideshow.bocHeroSlideAddEvent(jspSlides[i],Citysearch.TempConfig.Boc.JspSlides[i]);}}},olderWinnerModule:function(options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.olderWinnerModule");}
var boc=this;options=$merge(this.defaults,options);var themes=$(this.id.olderWinnerModuleId).getElements('div.'+this.id.olderWinnerClass);if(themes.length>1){var olderWinnerNav=new Element('p',{'class':'olderWinnerNav'});this.olderWinnerList=[];for(var i=0;i<themes.length;i++){var themeYear=themes[i].getElement('span').getProperty('text');var linkClass=(i>0?'themeYear':'themeYear '+boc.id.currentClass);var navLink=new Element('a',{'href':'#','name':Citysearch.pageType+'/previous_winner/'+themeYear+'/nav','class':linkClass,'text':themeYear});navLink.addEvent('click',function(e){e.preventDefault();for(var i=0;i<boc.olderWinnerList.length;i++){if(this.getProperty('text')===boc.olderWinnerList[i].year){var target=$(boc.id.olderWinnerModuleId).getElement('div.'+boc.id.olderWinnerClass);Citysearch.AjaxInit.loading(target,{'disableCancel':true});boc.olderWinnerList[i].content.replaces(target);var doneLoading=function(){Citysearch.AjaxInit.doneLoading();};doneLoading.delay(250);break;}}
var allLinks=olderWinnerNav.getChildren();for(var i=0;i<allLinks.length;i++){if(allLinks[i].hasClass(boc.id.currentClass)){allLinks[i].removeClass(boc.id.currentClass);break;}}
this.addClass(boc.id.currentClass);});if(i>0){olderWinnerNav.appendText(' - ');}
olderWinnerNav.grab(navLink);this.olderWinnerList.push({'year':themeYear,'content':(i>0?themes[i].dispose():themes[0])});}
olderWinnerNav.inject($(this.id.olderWinnerModuleId).getElement('h2'),'after');}},hijaxMoreUpdates:function(){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.hijaxMoreUpdates");}
$(this.id.moreUpdatesId).addEvent('click',function(e){e.preventDefault();Citysearch.ModalWindow.fireNewModal(Citysearch.AjaxInit.hijaxHref(this.href),this.get('title'),{});});},nationalPromoModule:function(options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.nationalPromoModule");}
options=$merge(this.defaults,options);var citiesList=$(this.id.nationalPromoModuleId).getElement('ul');var cities=citiesList.getElements('li');if(cities.length>options.numOfCitiesShown){for(var i=0;i<options.numOfCitiesShown;i++){cities.shift();}
this.nationalPromoPopupList=new Element('ul');for(var i=0;i<cities.length;i++){this.nationalPromoPopupList.grab(cities[i].dispose());}
var viewMoreLink=new Element('a',{'href':'#','text':Citysearch.Text.Boc.nationalPromoLink,'class':'popupLink','name':Citysearch.pageType+'/secondary/nationalPromo/view_more'});var viewMoreParagraph=new Element('p',{'class':'more'});viewMoreParagraph.grab(viewMoreLink);viewMoreParagraph.inject(citiesList,'after');viewMoreLink.addEvent('click',function(e){e.preventDefault();Citysearch.Popup.open(viewMoreLink,Citysearch.Boc.nationalPromoPopupList.clone().setStyle('padding','10px'),{'titleText':Citysearch.Text.Boc.nationalPromoPopupTitle});});}},newMembersModule:function(options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.newMembersModule");}
if($('newMembersJoinNowLink')){$('newMembersJoinNowLink').addEvent('click',function(e){e.preventDefault();var ajaxLink=Citysearch.AjaxInit.hijaxHref(this.href);Citysearch.ModalWindow.fireNewModal(ajaxLink,Citysearch.Text.Boc.newMembersModalTitle);});}
if($('newMembersSignInLink')){$('newMembersSignInLink').addEvent('click',function(e){if($chk(Citysearch.Header)){e.preventDefault();Citysearch.ModalWindow.fireNewModal(Citysearch.Header.signInHref,Citysearch.Text.Main.signUpTitle);}});}},otherCitiesModule:function(options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.otherCitiesModule");}
options=$merge(this.defaults,options);var citiesList=$(this.id.otherCitiesModuleId).getElement('ul');var cities=citiesList.getElements('li');if(cities.length>options.numOfCitiesShown){for(var i=0;i<options.numOfCitiesShown;i++){cities.shift();}
this.otherCitiesPopupList=new Element('ul');for(var i=0;i<cities.length;i++){this.otherCitiesPopupList.grab(cities[i].dispose());}
var viewMoreLink=new Element('a',{'href':'#','text':Citysearch.Text.Boc.otherCitiesLink,'class':'popupLink','name':Citysearch.pageType+'/secondary/other_cities/view_more'});var viewMoreParagraph=new Element('p',{'class':'more'});viewMoreParagraph.grab(viewMoreLink);viewMoreParagraph.inject(citiesList,'after');viewMoreLink.addEvent('click',function(e){e.preventDefault();Citysearch.Popup.open(viewMoreLink,Citysearch.Boc.otherCitiesPopupList.clone().setStyle('padding','10px'),{'titleText':Citysearch.Text.Boc.otherCitiesPopupTitle});});}},otherPollsModule:function(options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.otherPollsModule");}
options=$merge(this.defaults,options);var pollsList=$(this.id.otherPollsModuleId).getElement('ul');var polls=pollsList.getElements('li');if(polls.length>options.numOfPollsShown){for(var i=0;i<options.numOfPollsShown;i++){polls.shift();}
this.otherPollsPopupList=new Element('ul');for(var i=0;i<polls.length;i++){this.otherPollsPopupList.grab(polls[i].dispose());}
var viewMoreLink=new Element('a',{'href':'#','text':Citysearch.Text.Boc.otherPollsLink,'class':'popupLink','name':Citysearch.pageType+'/secondary/other_polls/view_more'});var viewMoreParagraph=new Element('p',{'class':'more'});viewMoreParagraph.grab(viewMoreLink);viewMoreParagraph.inject(pollsList,'after');viewMoreLink.addEvent('click',function(e){e.preventDefault();Citysearch.Popup.open(viewMoreLink,Citysearch.Boc.otherPollsPopupList.clone().setStyle('padding','10px'),{'titleText':Citysearch.Text.Boc.otherPollsPopupTitle});});}},hijaxFindLocation:function(){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.hijaxFindLocation");}
this.findLocationDiv=$(this.id.findLocationId);var stateLinks=$(this.findLocationDiv).getElements('a.state');stateLinks.addEvent('click',function(e){e.preventDefault();Citysearch.AjaxInit.getViaAjax(this.href,Citysearch.Boc.findLocationDiv);});},changeState:function(){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.changeState");}
if($(this.id.changeStateId)){$(this.id.changeStateId).addEvent('click',function(e){e.preventDefault();Citysearch.AjaxInit.getViaAjax(this.href,Citysearch.Boc.findLocationDiv);});}}};Citysearch.Slideshow.Boc=new Class({Extends:Citysearch.Slideshow,initialize:function(source,options){if(Citysearch.logging>=3){console.info("INFO: Citysearch.Slideshow.Boc.initialize");}
this.id.viewportId="bocHeroViewPort";this.id.slideshowId="bocHeroSlideContainer";this.id.nextId="bocHeroNext";this.id.previousId="bocHeroPrevious";this.parent(source,options);},createSlide:function(object,options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Slideshow.Boc.createSlide");}
options=$merge(this.defaults,options);var slideshowObj=this;var content=new Element('a',{'href':object.href,'name':object.name,'title':object.alt});content.grab(new Asset.image(object.src,{'class':this.id.photoClass,'alt':object.alt,'width':options.slideWidth,'height':options.slideHeight}));this.bocHeroSlideAddEvent(content,object,options);return content;},bocHeroSlideAddEvent:function(target,object,options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Slideshow.Boc.bocHeroSlideAddEvent");}
target.addEvents({'mouseenter':function(e){if(object){$('slideshowLabel').setProperty('text',object.alt);$('heroTitleLink').setProperty('href',object.href);$('heroPollName').setProperty('text',object.bocPoll);$('heroBigImageLink').setProperties({'href':object.href,'title':object.alt});$('heroImageBig').setProperties({'src':object.bigHeroSrc,'name':object.bigHeroName,'alt':object.alt});$('teaserPollName').setProperty('text',object.bocPoll);$('heroTeaserLink').setProperty('href',object.href);}},'mouseleave':function(e){$('slideshowLabel').setProperty('text',object.defaultAlt);}});}});Citysearch.PreDom.list.unshift(Citysearch.Boc.init.bind(Citysearch.Boc));