
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",nationalPromoModuleId:"bocNationalPromo",newMembersModuleId:"newMembers",otherCitiesModuleId:"bocOtherCities",otherPollsModuleId:"bocOtherPolls",shareLinkId:"shareLink",currentClass:"current"},shareTimeoutId:null,defaults:{numOfCitiesShown:7,numOfPollsShown:10,popupWidth:200},init:function(){if(Citysearch.logging>=3){console.info("INFO: Citysearch.Boc.init");}
if($(this.id.heroModuleId)){this.hijaxShare();}
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();}},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'),{});});},hijaxShare:function(options){if(Citysearch.logging>=4){console.info("INFO: Citysearch.Boc.hijaxShare");}
if($(this.id.shareLinkId)){options=$merge(this.defaults,options);var shareLinkObj=$(this.id.shareLinkId);shareLinkObj.addEvent('click',function(e){e.preventDefault();$clear(this.shareTimeoutId);if(!Citysearch.Popup.isOpen){Citysearch.Popup.fireNewPopup(e.target,{'width':options.popupWidth,'collapse':false,'titleText':e.target.get("text")});}}.bind(this));shareLinkObj.addEvent('mouseenter',function(e){e.preventDefault();this.shareTimeoutId=(function(){if(!Citysearch.Popup.isOpen){Citysearch.Popup.fireNewPopup(this,{'width':options.popupWidth,'collapse':false,'titleText':this.get("text")});Citysearch.Analytics.trackEvent(Citysearch.pageType+"/coreMessages/shareHover");}}).delay(500,this);});shareLinkObj.addEvent('mouseleave',function(e){$clear(this.shareTimeoutId);}.bind(this));shareLinkObj.addClass('popupLink');}},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.PreDom.list.unshift(Citysearch.Boc.init.bind(Citysearch.Boc));
