namespace("BD");Meetup.BD.templates={error:'<div class="ERR {{type}}"><div class="ERR_body">{{message}}</div></div>',confirm_this:'		<div class="D_boxhead">			<h2>{{{question}}}</h2>		</div>		<div class="D_boxsection">			<p>{{{explain}}}</p>			<div class="choiceBox">				{{#hasYesFunc}}					<span class="go_lite">{{yes}}</span>				{{/hasYesFunc}}				{{^hasYesFunc}}					<a href="{{yesLocation}}" class="go_lite">{{yes}}</a>				{{/hasYesFunc}}				<span class="meh_lite">{{no}}</span>			</div>		</div>',copy_event_confirm:(function(){var CopyBD=Meetup.Copy.BD;return'			<form id="copy-event-confirm" action="{{path}}" method="post">				<div class="copy clearfix">					<h2>Create a New Meetup</h2>					<p>'+CopyBD.confirmEventCopy+'</p>				</div>				<div class="field clearfix">					<label for="copy-event-short-descr">'+CopyBD.event.eventName+'</label>					<input id="copy-event-short-descr" type="text" name="alt_short_descr" maxlength="80" value="{{alt_short_descr}}"/>				</div>				<div class="field clearfix">					<label for="copy-event-descr">'+CopyBD.event.eventDetails+'</label>					<textarea class="hasMaxLen maxChars10000" data-max-len="10000" name="alt_descr" rows="10" cols="30">{{alt_descr}}</textarea>				</div>				<div class="buttons clearfix">					<input class="go" type="submit" value="'+CopyBD.save+'"/>					<a class="meh" href="#">'+CopyBD.cancel+"</a>				</div>			</form>"}()),rsvp:{im_going:(function(){var CopyBD=Meetup.Copy.BD;return'				<span class="going">'+CopyBD.rsvp.imGoing+'</span>				<a class="secondaryAction no" 					href="{{chapterUrl}}{{eventId}}/?op=remove_attendee" 					data-eventid="{{eventId}}" 					data-chapterid="{{chapterId}}">'+CopyBD.cancel+"</a>"}()),not_going:(function(){var RsvpCopy=Meetup.Copy.BD.rsvp;return'				<span class="notGoing">'+RsvpCopy.notGoing+'</span>				<a class="secondaryAction yes" 					href="{{chapterUrl}}{{eventId}}/?op=rsvp" 					data-eventid="{{eventId}}" 					data-chapterid="{{chapterId}}">'+RsvpCopy.changeYourMind+"</a>"}()),member_profile_img:'			<li class="{{className}}" 				style="background: transparent url({{image}}) no-repeat center center;" 				title="{{name}}" />		',following:(function(){var CopyBD=Meetup.Copy.BD;return"				<span>"+CopyBD.community.youreFollowing+'</span>				<a href="{{chapterUrl}}?op=unfollow" class="icon delete">'+CopyBD.rsvp.cancelUpdates+"</a>"}()),email_share:'			<div class="D_boxhead">				<h2>{{header}}</h2>			</div>			<div class="D_boxsection" style="padding-top: 0; border: none;">				<div class="block_form">					<div class="element">{{explanation}}</div>					<div class="element">						<div id="shareThisEmail_change">							{{email}} <span class="contingency">{{shareEmailEdit}}</span>						</div>						<div id="shareThisEmail_input" style="display: none;">							<div class="textwrap" style="margin-right: 20px;">								<input type="text" id="shareThisEmail" class="text" value="{{email}}" />							</div>						</div>					</div>				</div>				<div class="choiceBox">					<span class="go_lite">{{yes}}</span> <span class="meh_lite">{{no}}</span>				</div>			</div>'},lma:{lma_when:{edit:'				<p class="lma-question edit"><span class="">When:</span></p>				<div class="collapsable wrap input">					<input type="hidden" value="" name="event.day" class="day" id="ideaDay">					<input type="hidden" value="" name="event.month" class="month" id="ideaMonth">					<input type="hidden" value="" name="event.year" class="year" id="ideaYear">					<input type="text" value="" name="eventDate" id="eventDatePicker" title="Optional Date" readonly="true" class="ghost">					<strong>at</strong>					<select class="hour hideMe" name="event.hour12" id="eventhour">						<option selected="selected" value="">--</option>{{#hours}}<option value="{{value}}">{{label}}</option>{{/hours}}					</select>:					<select class="minute hideMe" name="event.minute" id="eventminute">						<option selected="selected" value="">--</option>{{#minutes}}<option value="{{value}}">{{label}}</option>{{/minutes}}					</select>					<select class="ampm hideMe" name="event.ampm" id="eventampm">						<option value="0">AM</option><option value="1">PM</option>					</select>					<a href="#" id="cancel-date" class="cancel-field" data-elm="lma_when" style="display: block; ">Cancel</a>				</div>',current:null},lma_where:{edit:'				<p class="unit size3of5 lma-question"><span class=""><trn:message key="group.event.whereColon">Where:</trn:message></span></p>				<div class="collapsable wrap input">					<a href="#" id="cancel-where" class="cancel-field" data-elm="lma_where" style="display: block; "><trn:message key="birddog.common.cancel">Cancel</trn:message></a>					<div id="venueInputWrap">						<div class="inputs">							<input type="text" id="venueName" name="venueName" title="Venue name" value="" />							<input type="text" id="venueAddress" name="venueAddress" title="Address" value="" autocomplete="off" />						</div>					</div>				</div>',current:null},lma_plan:{edit:'				<span class="label">What\'s the plan? <span class="optional">(optional)</span></span>				<div class="collapsable wrap input">					<a class="cancel" href="#">						Cancel					</a>					<div id="longDescrWrap" class="textwrap">						<textarea id="longDescr" class="hasMaxLen maxChars10000 maxLenPlacement_longDescrWrap" name="description"></textarea>					</div>				</div>',current:null}},inlineEdit:{idea:{edit:(function(){var CopyBD=Meetup.Copy.BD,apiURl=Meetup.Data.secureApiUrl;return'					<form class="inline-edit-idea inline-edit wrap" action="'+apiURl+'" method="post">						<input type="hidden" name="method" value="updateBirddogEvent" />						<input type="hidden" name="arg_member" value="{{memberId}}" />						<input type="hidden" name="arg_birddogEventId" value="{{eventId}}" />						<input type="hidden" name="arg_key" value="short_descr" />						<input type="hidden" name="arg_fromFB" value="{{isfb}}" />						<div class="fields">							<input type="text" class="text hasMaxLen maxChars80" data-max-len="80" name="arg_value" value="{{copy}}" />						</div>						<div class="actions">							<input type="submit" value="'+CopyBD.save+'" class="go" />							<a class="inline-edit-cancel" href="#">'+CopyBD.cancel+"</a>						</div>					</form>"}()),original:null},where:{edit:(function(){var CopyBD=Meetup.Copy.BD,CopyInline=CopyBD.event.inline_editing,apiURl=Meetup.Data.secureApiUrl;return'					<form class="inline-edit-where inline-edit wrap" action="'+apiURl+'" method="post">						<input type="hidden" name="method" value="updateBirddogVenue" />						<input type="hidden" name="arg_member" value="{{memberId}}" />						<input type="hidden" name="arg_birddogEventId" value="{{eventId}}" />						<input type="hidden" id="venue-country" name="arg_country" value="{{country}}" />						<input type="hidden" id="venue-city" name="arg_city" value="{{city}}" />						<input type="hidden" id="venue-street" name="arg_address1" value="{{address}}" />						<input type="hidden" id="venue-zip" name="arg_zip" value="{{zip}}" />						<input type="hidden" id="venue-state" name="arg_theState" value="{{state}}"/>						<input type="hidden" id="venue-lat" name="arg_lat" value="{{lat}}"/>						<input type="hidden" id="venue-lon" name="arg_lon" value="{{lon}}"/>						<input type="hidden" id="venue-fromfb" name="arg_fromFB" value="{{isfb}}" />						<p class="headline">'+CopyInline.suggestPlace+'</p>						<div class="fields">							<input type="text" id="venue-name" class="text" name="arg_name" title="'+CopyInline.venueName+'" value="{{name}}" />							<input type="text" id="venue-address" class="text" name="arg_originalLocation" title="'+CopyBD.address+'" value="{{location}}" autocomplete="off" />						</div>						<div class="actions">							<input type="submit" value="'+CopyBD.save+'" class="go" />							<a class="inline-edit-cancel" href="#">'+CopyBD.cancel+"</a>						</div>					</form>"})(),original:null},when:{edit:(function(){var CopyBD=Meetup.Copy.BD,apiURl=Meetup.Data.secureApiUrl;return'					<form class="inline-edit-when inline-edit wrap" action="'+apiURl+'" method="POST">						<input type="hidden" name="method" value="updateBirddogEvent" />						<input type="hidden" name="arg_member" value="{{memberId}}" />						<input type="hidden" name="arg_birddogEventId" value="{{eventId}}" />						<input type="hidden" name="arg_key" value="date" />						<input type="hidden" class="value" name="arg_value" value="" />						<input type="hidden" name="arg_fromFB" value="{{isfb}}" />						<p class="headline">'+CopyBD.event.inline_editing.suggestDateTime+'</p>						<div class="fields">							<input type="text" class="date" readonly="true" value="{{date}}" />							<select class="hour">								{{#hours}}<option value="{{option}}" {{#selected}}selected="selected"{{/selected}}>{{formatted}}</option>{{/hours}}							</select>							<span class="colon">:</span>							<select class="minute">								{{#minutes}}<option value="{{option}}" {{#selected}}selected="selected"{{/selected}}>{{formatted}}</option>{{/minutes}}							</select>							<select class="ampm">								<option value="0" {{^pm}}selected="selected"{{/pm}}>AM</option>								<option value="1" {{#pm}}selected="selected"{{/pm}}>PM</option>							</select>						</div>						<div class="actions">							<input type="submit" value="'+CopyBD.save+'" class="go" />							<a class="inline-edit-cancel" href="#">'+CopyBD.cancel+"</a>						</div>					</form>"})(),original:null},desc:{edit:(function(){var CopyBD=Meetup.Copy.BD,apiURl=Meetup.Data.secureApiUrl;return'					<form class="inline-edit-descr inline-edit wrap" action="'+apiURl+'" method="POST">						<input type="hidden" name="method" value="updateBirddogEvent" />						<input type="hidden" name="arg_member" value="{{memberId}}" />						<input type="hidden" name="arg_birddogEventId" value="{{eventId}}" />						<input type="hidden" name="arg_key" value="descr" />						<input type="hidden" name="arg_fromFB" value="{{isfb}}" />						<div class="fields">							<textarea name="arg_value" class="valueText hasMaxLen maxChars10000" data-max-len="10000">{{copy}}</textarea>						</div>						<div class="actions">							<input type="submit" value="'+CopyBD.save+'" class="go" />							<a class="inline-edit-cancel" href="#">'+CopyBD.cancel+"</a>						</div>					</form>"}()),original:null}},seeded_meetups:{preview:(function(){var CopyBD=Meetup.Copy.BD,CopySeed=CopyBD.seed;return'				<dl class="contents">					<dt class="name">'+CopySeed.whatShouldWeDo+'</dt>					<dd class="name">{{name}}</dd>					<dt class="when">'+CopySeed.knowWhen+'</dt>					<dd class="when">						<span class="date">{{month}}/{{day}}/{{year}}</span>						'+CopyBD.at+'						<span class="time">{{hour}}:{{minute}} {{ampm}}</span>					</dd>					<dt class="details">'+CopySeed.whatsThePlan+'</dt>					<dd class="details {{^tag}}last{{/tag}}">{{{details}}}</dd>					{{#tag}}						<dt class="hashtag">'+CopySeed.haveAHashTag+'</dt>						<dd class="hashtag">{{tag}}</dd>					{{/tag}}				</dl>'}()),edit_seed:{form:(function(){var CopyBD=Meetup.Copy.BD;return'					<form class="edit-seed-form clearfix" data-seed-id="{{seed_id}}" method="POST" action="{{form_action}}">						<input type="hidden" name="op" value="edit_idea" />						<input type="hidden" name="birddog_event_id" value="{{seed_id}}" />						<input type="hidden" name="__fragment" value="seedEdit{{seed_id}}" />						<div class="info">							<div class="editor-date editor-wrap clearfix">								<input class="day" type="hidden" name="idea.day" value="{{day}}" />								<input class="month" type="hidden" name="idea.month" value="{{month}}" />								<input class="year" type="hidden" name="idea.year" value="{{year}}" />								<input class="date" type="text" readonly="true" value="{{month}}/{{day}}/{{year}}" data-original-value="{{month}}/{{day}}/{{year}}" />								<strong>'+CopyBD.at+'</strong>								<select class="hour" name="idea.hour12" data-original-value="{{selected_hour}}">									{{#hours}}<option value="{{option}}" {{#selected}}selected="selected"{{/selected}}>{{formatted}}</option>{{/hours}}								</select>								<span class="colon">:</span>								<select class="minute" name="idea.minute" data-original-value="{{selected_minute}}">									{{#minutes}}<option value="{{option}}" {{#selected}}selected="selected"{{/selected}}>{{formatted}}</option>{{/minutes}}								</select>								<select class="ampm" name="idea.ampm" data-original-value="{{^pm}}0{{/pm}}{{#pm}}1{{/pm}}">									<option value="0" {{^pm}}selected="selected"{{/pm}}>AM</option>									<option value="1" {{#pm}}selected="selected"{{/pm}}>PM</option>								</select>							</div>							<div class="editor-short-descr editor-wrap clearfix">								<input class="editor hasMaxLen maxChars80" data-max-chars="80" type="text" name="short_descr" value="{{short_descr}}" />							</div>							<div class="editor-long-descr editor-wrap clearfix">								<textarea class="editor hasMaxLen maxChars10000" data-max-chars="10000" rows="10" cols="30" name="long_descr">{{descr}}</textarea>							</div>							<div class="editor-buttons editor-wrap buttons clearfix">								<input class="go" type="submit" value="'+CopyBD.save+'" />								<a class="cancel seed-edit-cancel" href="#">'+CopyBD.cancel+'</a>							</div>						</div>						<div class="media">							<div id="tag-{{seed_id}}" class="editor-tag editor-wrap clearfix">								<div class="textwrap">									<span class="fake">#</span><input type="text" class="tag hasMaxLen maxChars25 maxLenPlacement_tag-{{seed_id}} text" data-max-chars="25" name="tag" value="{{tag}}" autocomplete="off" maxlength="25" />								</div>							</div>						</div>					</form>'}()),original:null}},facebook_app:{venue_box:(function(){return'				<div class="venue setContent">					{{venueName}}					<a id="inline-venue-edit" href="?ed=venue" class="forceLogin fb-icon edit">						Edit					</a>				</div>'}())},widgets_page:{city_list:'<iframe src="http://www.meetup.com/everywhere/widget3/{{urlkey}}?width={{width}}&amp;bg={{style}}" width="{{width}}" height="475" frameborder="0" border="0" allowtransparency="true" scrolling="no"></iframe>',communities_map:'<iframe src="http://www.meetup.com/{{urlkey}}/embeds/map_and_stats?css={{css}}&amp;w={{width}}&amp;bg={{style}}" width="{{width}}" height="275" frameborder="0" border="0" allowtransparency="true" scrolling="no"></iframe>',your_best_meetup:'<iframe src="http://www.meetup.com/{{urlkey}}/embeds/your_best_meetup?css={{css}}&amp;w={{width}}&amp;bg={{style}}" width="{{width}}" height="{{height}}" frameborder="0" border="0" allowtransparency="true" scrolling="no"></iframe>',closest_event_list:'<iframe src="http://www.meetup.com/{{urlkey}}/embeds/closest_event_list?css={{css}}&amp;w={{width}}&amp;bg={{style}}" width="{{width}}" height="{{height}}" frameborder="0" border="0" allowtransparency="true" scrolling="no"></iframe>',largest_event_list:'<iframe src="http://www.meetup.com/{{urlkey}}/embeds/largest_event_list?css={{css}}&amp;w={{width}}&amp;bg={{style}}" width="{{width}}" height="{{height}}" frameborder="0" border="0" allowtransparency="true" scrolling="no"></iframe>',soonest_event_list:'<iframe src="http://www.meetup.com/{{urlkey}}/embeds/soonest_event_list?css={{css}}&amp;w={{width}}&amp;bg={{style}}" width="{{width}}" height="{{height}}" frameborder="0" border="0" allowtransparency="true" scrolling="no"></iframe>'},friendList:'<ul class="resetList clearfix friend-list">					{{#friends}}					<li><div class="{{class}}">						<img src="{{photo}}" />					    <p>{{name}}</p>						{{^invited}}						<a href="#" class="fb-blue-button" data-id="{{id}}">Invite</a>						{{/invited}}						{{#invited}}						<span class="invited-friend">Invited!</span>						{{/invited}}					</div></li>					{{/friends}}				</ul>',friendListHeader:'<div class="D_boxhead"><h2>{{wmdname}} wants people to Meetup in cities everywhere!</h2><p>Invite 5 or more friends and help make it happen.</p><p class="post-invite">Post to your friends wall by clicking "Invite"</p></div>'};function MarkerClusterer(map,opt_markers,opt_options){this.extend(MarkerClusterer,google.maps.OverlayView);this.map_=map;this.markers_=[];this.clusters_=[];this.sizes=[38,42,42,46,50];this.styles_=[];this.ready_=false;var options=opt_options||{};this.gridSize_=options.gridSize||60;this.maxZoom_=options.maxZoom||null;this.styles_=options.styles||[];this.imagePath_=options.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=options.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=true;if(options.zoomOnClick!=undefined){this.zoomOnClick_=options.zoomOnClick}this.averageCenter_=false;if(options.averageCenter!=undefined){this.averageCenter_=options.averageCenter}this.setupStyles_();this.setMap(map);this.prevZoom_=this.map_.getZoom();var that=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var maxZoom=that.map_.mapTypes[that.map_.getMapTypeId()].maxZoom;var zoom=that.map_.getZoom();if(zoom<0||zoom>maxZoom){return}if(that.prevZoom_!=zoom){that.prevZoom_=that.map_.getZoom();that.resetViewport()}});google.maps.event.addListener(this.map_,"idle",function(){that.redraw()});if(opt_markers&&opt_markers.length){this.addMarkers(opt_markers,false)}}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m";MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png";MarkerClusterer.prototype.extend=function(obj1,obj2){return(function(object){for(var property in object.prototype){this.prototype[property]=object.prototype[property]}return this}).apply(obj1,[obj2])};MarkerClusterer.prototype.onAdd=function(){this.setReady_(true)};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(this.styles_.length){return}for(var i=0,size;size=this.sizes[i];i++){this.styles_.push({url:this.imagePath_+(i+1)+"."+this.imageExtension_,height:size,width:size})}};MarkerClusterer.prototype.setStyles=function(styles){this.styles_=styles};MarkerClusterer.prototype.getStyles=function(){return this.styles_};MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_};MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_};MarkerClusterer.prototype.getMarkers=function(){return this.markers_};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length};MarkerClusterer.prototype.setMaxZoom=function(maxZoom){this.maxZoom_=maxZoom};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_||this.map_.mapTypes[this.map_.getMapTypeId()].maxZoom};MarkerClusterer.prototype.calculator_=function(markers,numStyles){var index=0;var count=markers.length;var dv=count;while(dv!==0){dv=parseInt(dv/10,10);index++}index=Math.min(index,numStyles);return{text:count,index:index}};MarkerClusterer.prototype.setCalculator=function(calculator){this.calculator_=calculator};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_};MarkerClusterer.prototype.addMarkers=function(markers,opt_nodraw){for(var i=0,marker;marker=markers[i];i++){this.pushMarkerTo_(marker)}if(!opt_nodraw){this.redraw()}};MarkerClusterer.prototype.pushMarkerTo_=function(marker){marker.setVisible(false);marker.setMap(null);marker.isAdded=false;if(marker.draggable){var that=this;google.maps.event.addListener(marker,"dragend",function(){marker.isAdded=false;that.resetViewport();that.redraw()})}this.markers_.push(marker)};MarkerClusterer.prototype.addMarker=function(marker,opt_nodraw){this.pushMarkerTo_(marker);if(!opt_nodraw){this.redraw()}};MarkerClusterer.prototype.removeMarker_=function(marker){var index=-1;if(this.markers_.indexOf){index=this.markers_.indexOf(marker)}else{for(var i=0,m;m=this.markers_[i];i++){if(m==marker){index=i;break}}}if(index==-1){return false}this.markers_.splice(index,1);marker.setVisible(false);marker.setMap(null);return true};MarkerClusterer.prototype.removeMarker=function(marker,opt_nodraw){var removed=this.removeMarker_(marker);if(!opt_nodraw&&removed){this.resetViewport();this.redraw();return true}else{return false}};MarkerClusterer.prototype.removeMarkers=function(markers,opt_nodraw){var removed=false;for(var i=0,marker;marker=markers[i];i++){var r=this.removeMarker_(marker);removed=removed||r}if(!opt_nodraw&&removed){this.resetViewport();this.redraw();return true}};MarkerClusterer.prototype.setReady_=function(ready){if(!this.ready_){this.ready_=ready;this.createClusters_()}};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};MarkerClusterer.prototype.getMap=function(){return this.map_};MarkerClusterer.prototype.setMap=function(map){this.map_=map};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_};MarkerClusterer.prototype.setGridSize=function(size){this.gridSize_=size};MarkerClusterer.prototype.getExtendedBounds=function(bounds){var projection=this.getProjection();var tr=new google.maps.LatLng(bounds.getNorthEast().lat(),bounds.getNorthEast().lng());var bl=new google.maps.LatLng(bounds.getSouthWest().lat(),bounds.getSouthWest().lng());var trPix=projection.fromLatLngToDivPixel(tr);trPix.x+=this.gridSize_;trPix.y-=this.gridSize_;var blPix=projection.fromLatLngToDivPixel(bl);blPix.x-=this.gridSize_;blPix.y+=this.gridSize_;var ne=projection.fromDivPixelToLatLng(trPix);var sw=projection.fromDivPixelToLatLng(blPix);bounds.extend(ne);bounds.extend(sw);return bounds};MarkerClusterer.prototype.isMarkerInBounds_=function(marker,bounds){return bounds.contains(marker.getPosition())};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport();this.markers_=[]};MarkerClusterer.prototype.resetViewport=function(){for(var i=0,cluster;cluster=this.clusters_[i];i++){cluster.remove()}for(var i=0,marker;marker=this.markers_[i];i++){marker.isAdded=false;marker.setMap(null);marker.setVisible(false)}this.clusters_=[]};MarkerClusterer.prototype.redraw=function(){this.createClusters_()};MarkerClusterer.prototype.distanceBetweenPoints_=function(p1,p2){if(!p1||!p2){return 0}var R=6371;var dLat=(p2.lat()-p1.lat())*Math.PI/180;var dLon=(p2.lng()-p1.lng())*Math.PI/180;var a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(p1.lat()*Math.PI/180)*Math.cos(p2.lat()*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2);var c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));var d=R*c;return d};MarkerClusterer.prototype.addToClosestCluster_=function(marker){var distance=40000;var clusterToAddTo=null;var pos=marker.getPosition();for(var i=0,cluster;cluster=this.clusters_[i];i++){var center=cluster.getCenter();if(center){var d=this.distanceBetweenPoints_(center,marker.getPosition());if(d<distance){distance=d;clusterToAddTo=cluster}}}if(clusterToAddTo&&clusterToAddTo.isMarkerInClusterBounds(marker)){clusterToAddTo.addMarker(marker)}else{var cluster=new Cluster(this);cluster.addMarker(marker);this.clusters_.push(cluster)}};MarkerClusterer.prototype.createClusters_=function(){if(!this.ready_){return}var mapBounds=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast());var bounds=this.getExtendedBounds(mapBounds);for(var i=0,marker;marker=this.markers_[i];i++){if(!marker.isAdded&&this.isMarkerInBounds_(marker,bounds)){this.addToClosestCluster_(marker)}}};function Cluster(markerClusterer){this.markerClusterer_=markerClusterer;this.map_=markerClusterer.getMap();this.gridSize_=markerClusterer.getGridSize();this.averageCenter_=markerClusterer.isAverageCenter();this.center_=null;this.markers_=[];this.bounds_=null;this.clusterIcon_=new ClusterIcon(this,markerClusterer.getStyles(),markerClusterer.getGridSize())}Cluster.prototype.isMarkerAlreadyAdded=function(marker){if(this.markers_.indexOf){return this.markers_.indexOf(marker)!=-1}else{for(var i=0,m;m=this.markers_[i];i++){if(m==marker){return true}}}return false};Cluster.prototype.addMarker=function(marker){if(this.isMarkerAlreadyAdded(marker)){return false}if(!this.center_){this.center_=marker.getPosition();this.calculateBounds_()}else{if(this.averageCenter_){var l=this.markers_.length+1;var lat=(this.center_.lat()*(l-1)+marker.getPosition().lat())/l;var lng=(this.center_.lng()*(l-1)+marker.getPosition().lng())/l;this.center_=new google.maps.LatLng(lat,lng);this.calculateBounds_()}}if(this.markers_.length==0){marker.setMap(this.map_);marker.setVisible(true)}else{if(this.markers_.length==1){this.markers_[0].setMap(null);this.markers_[0].setVisible(false)}}marker.isAdded=true;this.markers_.push(marker);this.updateIcon();return true};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_};Cluster.prototype.getBounds=function(){var bounds=new google.maps.LatLngBounds(this.center_,this.center_);var markers=this.getMarkers();for(var i=0,marker;marker=markers[i];i++){bounds.extend(marker.getPosition())}return bounds};Cluster.prototype.remove=function(){this.clusterIcon_.remove();this.markers_.length=0;delete this.markers_};Cluster.prototype.getSize=function(){return this.markers_.length};Cluster.prototype.getMarkers=function(){return this.markers_};Cluster.prototype.getCenter=function(){return this.center_};Cluster.prototype.calculateBounds_=function(){var bounds=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(bounds)};Cluster.prototype.isMarkerInClusterBounds=function(marker){return this.bounds_.contains(marker.getPosition())};Cluster.prototype.getMap=function(){return this.map_};Cluster.prototype.updateIcon=function(){var zoom=this.map_.getZoom();var mz=this.markerClusterer_.getMaxZoom();if(zoom>mz){for(var i=0,marker;marker=this.markers_[i];i++){marker.setMap(this.map_);marker.setVisible(true)}return}if(this.markers_.length<2){this.clusterIcon_.hide();return}var numStyles=this.markerClusterer_.getStyles().length;var sums=this.markerClusterer_.getCalculator()(this.markers_,numStyles);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.setSums(sums);this.clusterIcon_.show()};function ClusterIcon(cluster,styles,opt_padding){cluster.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.styles_=styles;this.padding_=opt_padding||0;this.cluster_=cluster;this.center_=null;this.map_=cluster.getMap();this.div_=null;this.sums_=null;this.visible_=false;this.setMap(this.map_)}ClusterIcon.prototype.triggerClusterClick=function(){var markerClusterer=this.cluster_.getMarkerClusterer();google.maps.event.trigger(markerClusterer,"clusterclick",this.cluster_);if(markerClusterer.isZoomOnClick()){this.map_.fitBounds(this.cluster_.getBounds())}};ClusterIcon.prototype.onAdd=function(){this.div_=document.createElement("DIV");if(this.visible_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(pos);this.div_.innerHTML=this.sums_.text}var panes=this.getPanes();panes.overlayImage.appendChild(this.div_);var that=this;google.maps.event.addDomListener(this.div_,"click",function(){that.triggerClusterClick()})};ClusterIcon.prototype.getPosFromLatLng_=function(latlng){var pos=this.getProjection().fromLatLngToDivPixel(latlng);pos.x-=parseInt(this.width_/2,10);pos.y-=parseInt(this.height_/2,10);return pos};ClusterIcon.prototype.draw=function(){if(this.visible_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.top=pos.y+"px";this.div_.style.left=pos.x+"px"}};ClusterIcon.prototype.hide=function(){if(this.div_){this.div_.style.display="none"}this.visible_=false};ClusterIcon.prototype.show=function(){if(this.div_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(pos);this.div_.style.display=""}this.visible_=true};ClusterIcon.prototype.remove=function(){this.setMap(null)};ClusterIcon.prototype.onRemove=function(){if(this.div_&&this.div_.parentNode){this.hide();this.div_.parentNode.removeChild(this.div_);this.div_=null}};ClusterIcon.prototype.setSums=function(sums){this.sums_=sums;this.text_=sums.text;this.index_=sums.index;if(this.div_){this.div_.innerHTML=sums.text}this.useStyle()};ClusterIcon.prototype.useStyle=function(){var index=Math.max(0,this.sums_.index-1);index=Math.min(this.styles_.length-1,index);var style=this.styles_[index];this.url_=style.url;this.height_=style.height;this.width_=style.width;this.textColor_=style.textColor;this.anchor_=style.anchor;this.textSize_=style.textSize;this.backgroundPosition_=style.backgroundPosition};ClusterIcon.prototype.setCenter=function(center){this.center_=center};ClusterIcon.prototype.createCss=function(pos){var style=[];if(document.all){style.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+this.url_+'");')}else{style.push("background-image:url("+this.url_+");");var backgroundPosition=this.backgroundPosition_?this.backgroundPosition_:"0 0";style.push("background-position:"+backgroundPosition+";")}if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){style.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;")}else{style.push("height:"+this.height_+"px; line-height:"+this.height_+"px;")}if(typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){style.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;")}else{style.push("width:"+this.width_+"px; text-align:center;")}}else{style.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;")}var txtColor=this.textColor_?this.textColor_:"black";var txtSize=this.textSize_?this.textSize_:11;style.push("cursor:pointer; top:"+pos.y+"px; left:"+pos.x+"px; color:"+txtColor+"; position:absolute; font-size:"+txtSize+"px; font-family:Arial,sans-serif; font-weight:bold");return style.join("")};namespace("Bing");Meetup.Bing.Cluster=(function(){var map,mapPoints,clickHandler;function createClusteredPin(cluster,latlong){var pin=new Microsoft.Maps.Pushpin(latlong,{text:String(cluster.length),textOffset:{x:0,y:13},typeName:"clusterPin",icon:"http://img1.meetupstatic.com/img/69515466932346196/birddog/map/cluster1.png",width:38,height:38});return pin}function createPin(data){var pin=new Microsoft.Maps.Pushpin(data._LatLong,{icon:"http://img1.meetupstatic.com/img/70187794614470680781301/birddog/map/marker.png",visible:true,width:28,height:26});pin.birddog=data;Microsoft.Maps.Events.addHandler(pin,"click",clickHandler);return pin}function customModuleLoaded(){var cluster=new ClusteredEntityCollection(map,{singlePinCallback:createPin,clusteredPinCallback:createClusteredPin},{gridSize:40});map.getRootElement().setAttribute("data-clustered","true");cluster.SetData(mapPoints)}function init(clusterMap,clusterMapPoints,clusterClickHandler){map=clusterMap;mapPoints=clusterMapPoints;clickHandler=clusterClickHandler;Microsoft.Maps.registerModule("clusterModule","http://www.bingmapsportal.com/Scripts/V7ClientSideClustering.js");Microsoft.Maps.loadModule("clusterModule",{callback:customModuleLoaded})}return{init:init}})();Meetup.BD.Maps=(function(){var initialized,mapDefaults,clusterDefaults,markerDefaults,customInfoBox,latitudeDefault=40,longitudeDefault=-50,thresholdDefault=25;function isArray(value){return Object.prototype.toString.call(value)==="[object Array]"}function copyObject(obj){if(obj==null||typeof(obj)!="object"){return obj}var temp=new obj.constructor();for(var key in obj){temp[key]=copyObject(obj[key])}return temp}function extend(defaults,custom){var copy=copyObject(defaults);for(name in custom){if(custom.hasOwnProperty(name)){copy[name]=custom[name]}}return copy}function isArray(value){return Object.prototype.toString.call(value)==="[object Array]"}function init(){var lat=Meetup.BD.userLat||latitudeDefault,lon=Meetup.BD.userLon||longitudeDefault;mapDefaults={width:622,height:275,center:new Microsoft.Maps.Location(lat,lon),mapTypeId:Microsoft.Maps.MapTypeId.road,mapTypeControl:false,credentials:"AsYNOPvRkJM1Ir7YOf55PqiqH_F1T9poye_YgjNZOw0tUe-yvDgi2ONhO2o3H57J",enableSearchLogo:false,disableKeyboardInput:true,showCopyright:false,showMapTypeSelector:false};markerDefaults={icon:"http://img1.meetupstatic.com/img/70187794614470680781301/birddog/map/marker.png",visible:true,width:28,height:26};initialized=true}function buildInfoBoxContent(bd){var i,max,chapter,alt,content=['<div class="infoWindow">','<div class="header wrap">',"<h4>",bd.title,"</h4>","</div>",'<div class="list"><table><tbody>'];for(i=0,max=bd.chapters.length;i<max;i++){chapter=bd.chapters[i];alt=i%2!==0?"alt":"";content.push(['<tr class="',alt,'">','<td class="chapter">','<a href="',chapter.url,'" target="_top">',chapter.name,"</a>","</td>",'<td class="people">',chapter.people,"</td>","</tr>"].join(""))}content.push("</tbody></table></div></div>");return content.join("")}function markerClick(e){if(e.targetType!="pushpin"){return}var pin=e.target,markerData=this.target.birddog,instance=markerData.instance,map=instance.map;for(var i=map.entities.getLength()-1;i>=0;i--){var pushpin=map.entities.get(i);if(pushpin.toString()=="[Infobox]"){map.entities.removeAt(i)}}customInfoBox.show(pin,buildInfoBoxContent(markerData))}function Maps(map,custom){!initialized&&init();if(initialized){this.plotThreshold=thresholdDefault;this.infoBox={};this.clickHandler=markerClick;this.mapOptions=extend(mapDefaults,custom);this.mapCanvas=typeof map==="string"?document.getElementById(map):map;this.map=new Microsoft.Maps.Map(this.mapCanvas,this.mapOptions);var that=this;Microsoft.Maps.registerModule("MeetupInfoBoxModule","/script/Meetup/Bing/InfoBox.js");Microsoft.Maps.loadModule("MeetupInfoBoxModule",{callback:function(){customInfoBox=new Meetup.Bing.InfoBox(that.map,markerDefaults)}})}}Maps.prototype={setLoader:function(loader){this.loader=typeof loader==="string"?document.getElementById(loader):loader},plot:function(raw){if(isArray(raw)){if(raw.length>this.plotThreshold){this.plotCluster(raw)}else{this.plotNormal(raw)}}},plotNormal:function(raw){if(isArray(raw)){this.translateMarkers(raw,true);this.renderMap()}},plotCluster:function(raw){if(isArray(raw)){var markers=(typeof Meetup.Bing.Cluster=="object")?this.translateMarkers(raw,false):false;if(markers&&markers.length>=this.plotThreshold){Meetup.Bing.Cluster.init(this.map,markers,this.clickHandler);this.renderMap()}else{this.plotNormal(raw)}}},renderMap:function(){this.mapCanvas.style.display="block";if(this.loader){this.loader.style.display="none"}},translateMarkers:function(raw,plot){var i,max,point,markerOptions,marker,handler,markers=[];var raw=isArray(raw)?raw:[raw];for(i=0,max=raw.length;i<max;i++){point=raw[i];markerOptions=extend(markerDefaults,{title:point.label});var marker=plot?new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(point.latitude,point.longitude),markerOptions):{};marker.birddog={instance:this,url:point.url,title:point.label,locale:point.country==="us"?point.city+", "+point.state:point.city,Latitude:point.latitude,Longitude:point.longitude,chapters:this.formatChapterData(point.chapters)};if(typeof this.clickHandler==="function"){Microsoft.Maps.Events.addHandler(marker,"click",this.clickHandler)}if(plot===true){this.map.entities.push(marker)}else{markers.push(marker.birddog)}}return markers},formatChapterData:function(chapters){var i,max,chapter,peopleCount,people,person,newChapters=[];try{people=Meetup.Copy.BD.people;person=Meetup.Copy.BD.person}catch(e){people="people";person="person"}for(i=0,max=chapters.length;i<max;i++){chapter=chapters[i];peopleCount=chapter.peopleCount||0;newChapters.push({url:chapter.url,name:chapter.name,people:peopleCount!==1?peopleCount+" "+people:peopleCount+" "+person})}return newChapters}};return Maps})();(function($){$.fn.collapsable=function(triggers){return this.each(function(){var self=$(this);self.bind("activate.collapsable",function(){self.removeClass("inactive")}).bind("deactivate.collapsable",function(){self.addClass("inactive")})})}})(jQuery);(function($){var $window=$(window);$.fn.lazyImg=function(options){var didScroll=false,elements=this,loadQueue=[],queueActive=false;var options=$.extend({threshold:100,effect:"show",effectspeed:0,scrollElm:$window,throttleQueue:null},options||{});var loadFromQueue=function(){if(loadQueue.length==0){queueActive=false;return}queueActive=true;var chunk=loadQueue.splice(0,options.throttleQueue),lastImg=chunk[chunk.length-1];lastImg.bind("complete",loadFromQueue);$.each(chunk,function(){if(this){$(this).trigger("appear")}})};var handleScroll=function(){elements.each(function(){var self=$(this);if(!isBelowFold(self,options)){if(options.throttleQueue&&!self.data("queued")){loadQueue.push(self);self.data("queued",true)}else{self.trigger("appear")}}});if(!queueActive&&options.throttleQueue){loadFromQueue()}};var handler_scroll=null;options.scrollElm.bind("scroll",function(){didScroll=true;if(handler_scroll){clearTimeout(handler_scroll)}handler_scroll=setTimeout(function(){handler_scroll=null;didScroll=false},333)});setInterval(function(){if(didScroll){didScroll=false;handleScroll()}},400);var queue=[];var queue_max=8;var queue_running=0;var handler_queueticking=null;var prime_tickqueue=13;var prime_finishqueue=647;var pushQueue=function(f){if(typeof(f)!=="function"){return false}queue[queue.length]=f;tickQueue()};var tickQueue=function(){if(handler_queueticking){clearTimeout(handler_queueticking);handler_queueticking=null}if(queue.length>0&&queue_running<queue_max){doQueue();setTimeout(tickQueue,prime_tickqueue)}};var doQueue=function(){++queue_running;(queue.splice(0,1))[0]()};var finishQueue=function(){if(queue_running>0){--queue_running}handler_queueticking=setTimeout(tickQueue,prime_finishqueue)};var genOnImgAppear=function(self){var $self=$(self),src=$self.data("src"),myfunc=function(){$("<img />").bind("load",function(){if(options.background){$self.hide().css("background-image",["url(",src,")"].join(""))[options.effect](options.effectspeed)}else{$self.hide().attr("src",src)[options.effect](options.effectspeed)}$self.data("loaded",true);$.grep(elements,function(item){return !$(item).data("loaded")});$self.trigger("complete");finishQueue()}).attr("src",src)};return function(){pushQueue(myfunc)}};return elements.each(function(){var self=$(this);self.one("appear",genOnImgAppear(this));if(!isBelowFold(self,options)){self.trigger("appear")}else{self.data("loaded",false)}})};var isBelowFold=function(element,options){var fold=options.scrollElm.scrollTop()+options.scrollElm.height(),imgPos=element.offset().top;return imgPos>=(fold+options.threshold)||false}})(jQuery);(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings)};$scrollTo.defaults={axis:"xy",scrollWhen:"always",duration:parseFloat($.fn.jquery)>=1.3?0:1};$scrollTo.window=function(scope){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var elem=this,isWin=!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!isWin){return elem}var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem;return $.browser.safari||doc.compatMode=="BackCompat"?doc.body:doc.documentElement})};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=="object"){settings=duration;duration=0}if(typeof settings=="function"){settings={onAfter:settings}}if(target=="max"){target=9000000000}settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue){duration/=2}settings.offset=both(settings.offset);settings.over=both(settings.over);return this._scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is("html,body");switch(typeof targ){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);case"object":if(targ.is||targ.style){toff=(targ=$(targ)).offset()}}$.each(settings.axis.split(""),function(i,axis){var Pos=axis=="x"?"Left":"Top",pos=Pos.toLowerCase(),key="scroll"+Pos,old=elem[key],max=$scrollTo.max(elem,axis);if(toff){if(settings.scrollWhen=="above"){if(toff.top<$elem.scrollTop()){return}}else{if(settings.scrollWhen=="below"){if(toff.top>$elem.scrollTop()){return}}}attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css("margin"+Pos))||0;attr[key]-=parseInt(targ.css("border"+Pos+"Width"))||0}attr[key]+=settings.offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis=="x"?"width":"height"]()*settings.over[pos]}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)=="%"?parseFloat(val)/100*max:val}if(/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max)}if(!i&&settings.queue){if(old!=attr[key]){animate(settings.onAfterFirst)}delete attr[key]}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings)})}}).end()};$scrollTo.max=function(elem,axis){var Dim=axis=="x"?"Width":"Height",scroll="scroll"+Dim;if(!$(elem).is("html,body")){return elem[scroll]-$(elem)[Dim.toLowerCase()]()}var size="client"+Dim,html=elem.ownerDocument.documentElement,body=elem.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size])};function both(val){return typeof val=="object"?val:{top:val,left:val}}})(jQuery);(function($){Meetup.BD.steppedDialog=function(steps,headline){this.init(steps,headline)};Meetup.BD.steppedDialog.prototype={init:function(steps,headline){var headline=headline||window.Meetup.Copy.BD.aFewThings,stepTitle;if($("#steppedDialog").is(":data(dialog)")){return false}this.currentStep=0;this.steps=$.isArray(steps)?steps:[steps];$("#steppedDialog").remove();this.dialog=$('<div class="dialogContent" id="steppedDialog"/>').dialog({autoOpen:true,resizable:false,draggable:false,show:(Meetup.BD.isFbApp?null:"drop"),hide:(Meetup.BD.isFbApp?null:"drop"),position:(Meetup.BD.isFbApp?["center","top"]:null),width:(Meetup.BD.isFbApp?"400":"500")});if(this.steps.length>1){stepTitle=$('<div class="dialogStepsTitle"><span>'+headline+"</span>").appendTo(this.dialog);this.dialogSteps=$('<div class="dialogSteps"><span class="dialogStepCurrent">'+(this.currentStep+1)+"</span> of "+this.steps.length+"</div>").prependTo(stepTitle)}this.dialogFrames=$('<div class="dialogFrames"/>').appendTo(this.dialog);this.dialog.bind("advance",$.proxy(this.advanceToNextStep,this));this.advanceToNextStep()},advanceToNextStep:function(event,outgoingCallback){var step,el,oldBailFn,outgoingFrame,incomingFrame;if(this.currentStep>=this.steps.length){this.dialog.dialog("close")}else{step=this.steps[this.currentStep];if(step){el=$($.isFunction(step)?step():step);oldBailFn=this.bailFn||$.noop;this.bailFn=el.data("bailFn")||$.noop;this.dialog.bind("dialogclose",this.bailFn);this.dialog.bind("dialogclose",function(){$(this).dialog("destroy")});outgoingFrame=this.dialogFrames.find("div.dialogFrame:last");incomingFrame=$('<div class="dialogFrame"/>').append(el);incomingFrame.appendTo(this.dialogFrames);if(outgoingFrame.length){incomingFrame.css({position:"relative",top:0,left:incomingFrame.width()});outgoingFrame.css({position:"absolute",top:0,left:0,width:outgoingFrame.width()+"px"}).animate({left:(-1*outgoingFrame.width())+"px"},250,function(){oldBailFn();$(this).remove()});incomingFrame.animate({left:0},250)}if(this.dialogSteps){this.dialogSteps.find("span.dialogStepCurrent:first").text(this.currentStep+1)}this.dialog.height("auto")}this.currentStep++}},steps:null,currentStep:null,dialogSteps:null,dialogFrames:null,bailFn:null}})(jQuery);(function($,window){$.fn.stickToTop=function(options){var $window=$(window),defaults={className:"fixed",CSS:{}};options=$.extend(true,defaults,options);return this.each(function(){var self=$(this),placeholder=$('<div class="stickToTopPlaceholder" style="display:none; width:'+self.outerWidth(true)+"px; height:"+self.outerHeight(true)+'px;" />'),measureSelf=true;options.CSS.position="fixed";self.after(placeholder);$window.bind("scroll",checkScroll);checkScroll();function checkScroll(){var offset=measureSelf?self.offset():placeholder.offset();options.CSS.margin="-"+offset.top+"px 0 0 0";if($window.scrollTop()>offset.top){self.addClass(options.className).css(options.CSS);placeholder.css("display","block");measureSelf=false}else{self.removeClass(options.className).removeAttr("style");placeholder.css("display","none");measureSelf=true}}})}})(jQuery,window);(function($){var valueTypes=["input","textarea","button"];function getValueOrText(elem){return $.inArray(elem.type,valueTypes)>=0?$(elem).val():$(elem).text()}function setValueOrText(elem,value){return $.inArray(elem.type,valueTypes)>=0?$(elem).val(value):$(elem).text(value)}$.fn.toggleText=function(){return this.each(function(){var self=$(this),current=getValueOrText(this),newValue;if(!self.data("toggleInited")){self.data("toggleInited",true);self.data("toggleText",self.attr("data-toggleText"));self.data("toggleDefault",current)}newValue=self.data(current===self.data("toggleDefault")?"toggleText":"toggleDefault");setValueOrText(this,newValue)})}})(jQuery);(function($){var defaults={startDelay:500,fadeThis:false};$.fn.waitPls=function(custom){var options=$.extend({},defaults,custom);if(this.length){var that=this;that.spinner=false;that.timeout=false;that.show=function(){var offset,topPos,leftPos;clearTimeout(that.timeout);if(!that.spinner){that.spinner=$('<div class="BD_spinner"></div>').appendTo("body");offset=that.offset();topPos=Math.round(offset.top+(that.outerHeight()/2)-(that.spinner.outerHeight()/2));leftPos=Math.round(offset.left+(that.outerWidth()/2)-(that.spinner.outerWidth()/2));if(typeof options.fadeThis==="number"){that.css("opacity",options.fadeThis)}that.spinner.css({display:"none",top:topPos+"px",left:leftPos+"px"}).fadeIn("slow")}};that.stop=that.hide=function(){clearTimeout(that.timeout);if(that.spinner){that.spinner.remove();if(typeof options.fadeThis==="number"){that.css("opacity",1)}that.spinner=false}};that.start=function(){that.timeout=setTimeout(that.show,options.startDelay)}}return this}})(jQuery);(function($,BD,CopyBD){var inited=false,defaultOpts={delay:300,leftOffset:0,topOffset:0},overlay=$('<div id="avatar-overlay" class="wrap" style="display:none;" />');function markupContents(contents){var html="";if(typeof contents==="object"){if(contents.photo.length){html+='<div class="photo" style="background-image: url('+contents.photo+');" />'}if(contents.name.length){html+="<h4>"+contents.name+"</h4>"}if(contents.helper.length){html+="<p>"+contents.helper+"</p>"}if(contents.facebook.length||contents.twitter.length){html+='<div class="social wrap">';if(contents.facebook.length){html+='<a class="icon facebook" target="_blank" href="http://www.facebook.com/profile.php?id='+contents.facebook+'">Facebook</a>'}if(contents.twitter.length){html+='<a class="icon twitter" target="_blank" href="http://twitter.com/'+contents.twitter+'">Twitter</a>'}html+="</div>"}}return html}$.fn.birddogAvatarOverlays=function(kids,custom){var options=$.extend({},defaultOpts,custom);function handleOver(e){var self=$(this);self.data("hovering",true);setTimeout(function(){if(self.data("hovering")){showOverlay(self)}},options.delay)}function handleOut(e){var self=$(this);self.data("hovering",false)}function handleOverlayOut(e){overlay.fadeOut("fast")}function showOverlay(self){var coords=self.offset(),markup=markupContents(self.data("overlay"));if(markup){overlay.html(markup).css({top:coords.top+options.topOffset,left:coords.left+options.leftOffset}).fadeIn("fast")}}if(!inited){inited=true;$(document.body).append(overlay);overlay.bind("mouseleave",handleOverlayOut)}return this.each(function(){var self=$(this);if(kids){self.delegate(kids,"mouseover",handleOver);self.delegate(kids,"mouseout",handleOut)}else{self.bind("mouseover",handleOver);self.bind("mouseout",handleOut)}})}}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){var suggestOverlay=$('<div id="geocode-field-suggestions" class="wrap" style="display:none;"><ul></ul></div>'),defaultOptions={minLength:1,onFormSubmit:false,delay:2000,suggestMax:5,dataCallback:null,geoCallback:null,chooseCallback:null},commandMap={execute:executeGeocode,suggest:showSuggestions,hideSuggest:hideSuggestions},lastGeocode=getNow(),initCount=0,initLimit=10,geocoder,initTimeout;function init(){clearTimeout(initTimeout);initCount++;if(!geocoder){try{geocoder=new google.maps.Geocoder();suggestOverlay.appendTo(document.body).delegate("li","click",suggestionChoice)}catch(e){initTimeout=initCount<initLimit&&setTimeout(init,500)}}}function getNow(){return +(new Date)}function executeGeocode(dataCallback,geoCallback){if(geocoder){var isWithinDelay,isLongEnough,field=this,options=field.data("options"),text=field.val(),data={address:text};if(typeof dataCallback==="function"){dataCallback(data)}isWithinDelay=getNow()-lastGeocode>options.delay;isLongEnough=data.address.length>=options.minLength;if(options.onFormSubmit||(isWithinDelay&&isLongEnough)){geocoder.geocode(data,function(result,status){lastGeocode=getNow();if(typeof geoCallback==="function"){geoCallback.call(field,result,status)}})}}}function showSuggestions(result,status){var i=0,max=result.length,temp,field=$(this),options=field.data("options"),list=suggestOverlay.children("ul"),offset=field.offset(),position={top:offset.top+field.outerHeight(),left:offset.left,width:field.outerWidth()};if(options.suggestMax>0){list.empty();max=(max<=options.suggestMax)?max:options.suggestMax;while(i<max){temp=$("<li>"+(result[i].formatted_address||result[i].streetAddress)+"</li>").data("result",result[i]);suggestOverlay.children("ul").append(temp);i++}suggestOverlay.data("field",field).css(position).fadeIn("fast")}}function hideSuggestions(){suggestOverlay.fadeOut("fast",function(){suggestOverlay.data("field",null).children("ul").empty()})}function suggestionChoice(e){var item=$(this),geoData=item.data("result"),field=suggestOverlay.data("field"),options=field.data("options");field.data("location",geoData);if(typeof options.chooseCallback==="function"){options.chooseCallback.call(field,geoData)}hideSuggestions()}$.fn.geocodeField=function(custom,commandArgs){if(typeof custom==="string"&&commandMap[custom]){this.each(function(){var field=$(this);commandMap[custom].apply(field,$.isArray(commandArgs)?commandArgs:[])})}else{if(typeof custom==="object"||typeof custom==="undefined"){var options=$.extend({},defaultOptions,custom);init();this.each(function(){var field=$(this);field.bind("blur",hideSuggestions).data({options:options,location:false,original:""}).bind("focus",function(e){field.data("original",field.val())});if(options.onFormSubmit){field.closest("form").bind("submit",function(e){e.preventDefault();executeGeocode.call(field,options.dataCallback,options.geoCallback)})}else{field.bind("keyup",function(e){if($.trim(field.val())!==""&&e.keyCode>=48&&e.keyCode<=90){executeGeocode.call(field,options.dataCallback,options.geoCallback)}})}})}}return this}}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){$.fn.lmaForm=function(custom){var $lmaForm,geocodeTimer,options=$.extend({handler:BD.formProcessor(true)},custom),$title=$("#title"),$datePicker=$("#eventDatePicker"),$venueName=$("#venueName"),$venueAddress=$("#venueAddress"),$suggestLink=$("#lma-suggest"),$suggestLinkText=$suggestLink.text(),dontStop={dontStop:true};var hours=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"},{label:"11",value:"11"},{label:"12",value:"0"}],minutes=[{label:"00",value:"0"},{label:"15",value:"15"},{label:"30",value:"30"},{label:"45",value:"45"}],templates=BD.templates.lma;function updateVenue(){var response=BD.venueLocator.geocoded[0],center=[response.lat,response.lng].join(",");$venueAddress.val(response.address);$("#street").val(response.street_address);$("#postal_code").val(response.postal_code);$("#city").val(response.city);$("#the_state").val(response.region);$("#country").val(response.country);$("#lat").val(response.lat);$("#lng").val(response.lng)}function swapTemplate(args){var templateClass=args.templateClass||"",view=args.view||{},templateName=args.templateName||"current",element=args.element||$("#"+templateClass),method=args.method||templateName==="current"?"replaceWith":"html";if(templates[templateClass][templateName]){if(typeof templates[templateClass][templateName]==="string"){template=$.mustache(templates[templateClass][templateName],view)}else{template=templates[templateClass][templateName]}if(templateName==="edit"){templates[templateClass].current=element.clone()}else{templates[templateClass].current=null}element[method](template).toggleClass("collapsed")}else{return false}}function cancelEdit(e){e.preventDefault();var $sectionId=$(this).attr("data-elm");var el=$("#"+$sectionId),temp=$sectionId,proposeSection=el.find(".propose");if(templates[temp].current){swapTemplate({element:el,templateClass:temp})}else{if(proposeSection.length){proposeSection.show();el.find(".input").remove();el.addClass("collapsed")}}}function editWhen(e){e.preventDefault();var view={minutes:minutes,hours:hours};swapTemplate({templateClass:"lma_when",templateName:"edit",view:view});$("#eventDatePicker").datepicker(BD.datePickerSettings)}function editWhere(e){e.preventDefault();swapTemplate({templateClass:"lma_where",templateName:"edit"});$venueName=$("#venueName");$venueAddress=$("#venueAddress");$venueName.TextInputTip(dontStop);$venueAddress.TextInputTip(dontStop)}function editPlan(e){e.preventDefault();swapTemplate({templateClass:"lma_plan",templateName:"edit"});$("#longDescr").CharCounter()}function init(){$lmaForm=$(this);$lmaForm.expand=function(e){if(Member.id===0){return BD.forceLogin(e)}e&&e.preventDefault&&e.preventDefault();if($suggestLink.hasClass("cancel-lma")){$suggestLink.trigger("collapse");return}if($.browser.msie&&(parseInt($.browser.version,10)<8)){$("#lma-form").removeClass("jsStartHidden").show()}else{$("#lma-form").hide().removeClass("jsStartHidden").slideDown(function(){$suggestLink.text(Meetup.Copy.cancelLMA);$suggestLink.removeClass("plus_bk").addClass("cancel_bk cancel-lma")})}};$lmaForm.collapse=function(e){e&&e.preventDefault&&e.preventDefault();$title.val($title.attr("title"));swapTemplate({templateClass:"lma_when",templateName:"current"});swapTemplate({templateClass:"lma_where",templateName:"current"});swapTemplate({templateClass:"lma_plan",templateName:"current"})};$lmaForm.bind("expand",$lmaForm.expand);$lmaForm.bind("collapse",$lmaForm.collapse);$("#birddogBody").delegate("a.cancel-lma","click",function(e){e.preventDefault();$("#C_context").children("div.D_box.error").remove();$lmaForm.find("div.ERR").remove();$lmaForm.collapse();if($.browser.msie&&(parseInt($.browser.version,10)<8)){$("#lma-form").hide()}else{$("#lma-form").slideUp(function(){$suggestLink.text($suggestLinkText);$suggestLink.removeClass("cancel_bk cancel-lma").addClass("plus_bk")})}});$lmaForm.delegate("a.cancel-field","click",cancelEdit).delegate("a.lma_when","click",editWhen).delegate("a.lma_where","click",editWhere).delegate("a.lma_plan","click",editPlan).delegate("#venueAddress","keyup",function(){if(this.value!==""){clearTimeout(geocodeTimer);geocodeTimer=setTimeout(function(){BD.venueLocator.geocode({address:$venueName.val()+" "+$venueAddress.val(),callback:updateVenue})},700)}});$title.bind("focus",$lmaForm.expand);$title.CharCounter().TextInputTip(dontStop);if($datePicker.length){$datePicker.TextInputTip(dontStop).datepicker(BD.datePickerSettings)}$lmaForm.bind("submit",options.handler)}return this.each(init)}}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){var regex={username:/@(\w+)/gm,url:/((((ht|f){1}(tp:[/][/]){1})|((www.){1}))[-a-zA-Z0-9@:%_\+.~#?&//=]+)/gm,tag:/#(\w+)/gm};function createLink(href){return'<a href="'+href+'" title="'+href+'">'+(href.length>30?href.substring(0,20)+"&hellip;":href)+"</a>"}function linkify(text){return text.replace(regex.url,function(match){return createLink(match)})}function usernameify(text){return text.replace(regex.username,'<a href="http://twitter.com/$1">@$1</a>')}function tagify(text){return text.replace(regex.tag,'<a href="http://twitter.com/search/%23$1">#$1</a>')}function processText(text){return tagify(usernameify(linkify(text)))}function getUncachedResults(resultSet,cache){var i,max,id,temp=[];for(i=0,max=resultSet.length;i<max;i++){id=resultSet[i].id;if($.inArray(id,cache)===-1){cache.push(id);temp.push(resultSet[i])}}return temp}function getNewData($this,options){options.refreshCount+=1;$.ajax({url:"http://search.twitter.com/search.json",data:{q:options.tag,rpp:options.tweetsPer},dataType:"jsonp",success:function(data){var callback,results;if(data.results.length){callback=typeof options.dataCallback==="function"?options.dataCallback:$.noop,results=getUncachedResults(data.results,options.cache);callback.call($this[0],results,options)}if(!options.refreshMax||options.refreshCount<options.refreshMax){$this.data("twitterFeedTimeout",setTimeout(function(){getNewData($this,options)},options.interval))}}})}function dataCallback(results,options){var i,max,temp,$this=$(this),items=[],template='				<li style="display:none;" class="clearfix">					<a class="avatar" href="{{url}}">						<img width="48" height="48" src="{{imgSrc}}" alt="{{imgAlt}}" />					</a>					<span class="user">						<a href="{{url}}">{{username}}</a>					</span>					<p class="tweet">{{{tweet}}}</p>				</li>';for(i=0,max=results.length;i<max;i+=1){temp=$.mustache(template,{url:"http://twitter.com/"+results[i].from_user,imgSrc:results[i].profile_image_url,imgAlt:results[i].from_user,username:results[i].from_user,tweet:processText(results[i].text)});items.push(temp)}$this.find("li.loader").remove();$this.prepend(items.join(""));$this.find("li:hidden").slideDown("slow");$this.find("li:gt("+(options.tweetsPer*2-1)+")").slideUp("slow",function(){$(this).remove()})}$.fn.twitterFeed=function(custom){return this.each(function(){var $this=$(this),defaults={tag:$this.data("tag"),refreshMax:0,tweetsPer:5,interval:5000,dataCallback:dataCallback},options=$.extend(defaults,custom);options.refreshCount=0;options.cache=[];getNewData($this,options)})}}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,M,BD,CopyBD,window,document,undefined){BD.hours12=["1","2","3","4","5","6","7","8","9","10","11","0"];BD.hours24=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","0"];BD.minutes=["00","15","30","45"];BD.dontStop={dontStop:true};BD.removeMSIEFilter=function(elem){if(elem.style.removeAttribute){elem.style.removeAttribute("filter")}};BD.formProcessor=function(requireLogin,callback){return function(e){if(this.hasBeenSubmitted){e.preventDefault()}else{this.hasBeenSubmitted=true;if(requireLogin&&Member.id===0){e.preventDefault();BD.forceLogin.call(this,e)}else{if(typeof callback==="function"){callback.call(this,e)}}}}};BD.createShortUrl=function(url,srcCode,destCode,callback){var shortUrl;$.ajax({url:"/api/",data:{method:"shortenUrl",arg_url:url,arg_srcCode:srcCode,arg_memberId:Member.id,arg_chapterId:Chapter?Chapter.id:0,arg_destCode:destCode},success:callback})};BD.createError=function(target,type,message,method){var html,view={type:type,message:message};method=method||"prepend";target=$(target);if(target.length&&target[method]&&typeof type==="string"&&typeof message==="string"){html=$.mustache(BD.templates.error,view);target[method](html)}};BD.removeError=function(target,type,method,animMethod,animSpeed){var targetError;method=method||"find";animMethod=animMethod||"slideUp";animSpeed=typeof animSpeed==="undefined"?"fast":animSpeed;target=$(target);if(target.length&&target[method]&&typeof type==="string"){targetError=target[method]("div.ERR."+type);if(targetError.length&&targetError[animMethod]){if(animMethod==="hide"){targetError.remove()}else{animSpeed=typeof animSpeed!=="undefined"?animSpeed:"fast";targetError[animMethod](animSpeed,function(){targetError.remove()})}}}};BD.generateMinutes=function(selected){var minutes=BD.minutes,minslength=minutes.length,times=[],time,i;for(i=0;i<minslength;i++){time={option:minutes[i],formatted:minutes[i],selected:(selected===minutes[i])};times.push(time)}return times};BD.generateHours=function(selected){var hours=(Meetup.Language==="en_US"?BD.hours12:BD.hours24),hourslength=hours.length,times=[],time,i;function getProperHour(hour){if(hourslength===12){return hour==="0"?"12":hour}else{return hour}}for(i=0;i<hourslength;i++){time={option:hours[i],formatted:getProperHour(hours[i]),selected:(selected===getProperHour(hours[i]))};times.push(time)}return times};BD.format24HourTime=function(hour,ampm){hour=parseInt(hour,10);ampm=parseInt(ampm,10);if(hour===12){return ampm===1?(hour).toString():"00"}else{if(ampm===1){return(hour+12).toString()}else{return(hour).toString()}}};BD.generateTimes=function(selected){var hours=(Meetup.Language==="en_US"?BD.hours12:BD.hours24),minutes=BD.minutes,hourslength=hours.length,minslength=BD.minutes.length,times=[],time,temp,i,j;for(i=0;i<hourslength;i++){for(j=0;j<minslength;j++){temp=hours[i]+":"+minutes[j];time={option:temp,formatted:(Meetup.Language==="it"?hours[i]+"."+minutes[j]:temp),selected:(selected===temp)};times.push(time)}j=0}return times};BD.generateDateTwoWeeksAway=function(date){var when=date||new Date();return new Date(when.getTime()+1209600000)};BD.notEmpty=function(data){return !!(data.toString().replace(/(\s+)/g,"").length)};BD.stripQueryStringAndHash=function(loc){loc=loc||window.location.href;return loc.split("?")[0].split("#")[0]};BD.nl2br=function(str,regex){str=typeof"str"==="string"?str:str.toString();regex=regex||/\n/g;return str.replace(regex,"<br />")};BD.datePickerSettings={buttonImage:"http://img1.meetupstatic.com/img/0919832613484209749/icon/ical.gif",buttonImageOnly:true,dateFormat:"m/d/yy",minDate:0,onClose:function(){var $this=$(this),newDate=$this.datepicker("getDate");if(newDate&&typeof newDate==="object"){$this.siblings("input[type=hidden].day").val(newDate.getUTCDate());$this.siblings("input[type=hidden].month").val(newDate.getMonth()+1);$this.siblings("input[type=hidden].year").val(newDate.getFullYear());if($this.siblings("select.hour").val()===""||$this.siblings("select.minute").val()===""){$this.siblings("select.hour").val("7");$this.siblings("select.minute").val("0");$this.siblings("select.ampm").val("1")}}}};BD.loadFavicon=function(target,url){var faviconUrl="http://"+url+"/favicon.ico",defaultUrl="http://img1.meetupstatic.com/img/80829196880766041895/thirdparty/fff/silk/world_link.png",image=new Image();$(image).bind("load",function(data,textStatus){target.attr("src",textStatus==="error"?defaultUrl:faviconUrl)});image.src=faviconUrl};BD.buildInviteStep=function(){var bodyString=['<label id="fbInviteLabel" for="fbInviteFilter">Search Facebook friends:</label>','<input type="text" id="fbInviteFilter" class="fbFriendFilter" title="Start typing a friend\'s name..." />',BD.facebookInviter.buildFriendList(6)].join("");return !BD.getBirddogFB&&!BD.isFbApp?null:BD.buildConfirmThis({question:"Invite friends",explain:bodyString,yesFunction:$.noop,yesLabel:"All done",noLabel:CopyBD.noThanks})};BD.buildMultiShare=function(){var steppedDialog=$("#steppedDialog"),sharePrompt=$("#sharePrompt"),mehLite=sharePrompt.find("span.meh_lite");removeCookie("MF_rsvpd");mehLite.bind("click",function(){steppedDialog.trigger("advance")});function afterSubmit(resp){steppedDialog.trigger("advance");return{quiet:!!steppedDialog.dialog("isOpen")}}M.Socialize.init($.noop,afterSubmit);return sharePrompt.css({display:"block"}).data({bailFn:function(){mehLite.unbind();sharePrompt.appendTo("body").css({display:"none"})}})};BD.containerListUpdate=function(){var $list=$("#meetupList"),$whereIs=$("#whereIs"),locationChanged=$whereIs.data("storedValue")!==$whereIs.val(),args,spinner;spinner=$list.waitPls();$list.css("opacity",0.5);args={city:$list.data("city"),lat:$list.data("lat"),lon:$list.data("lon"),sort:$list.data("sort"),whereIs:$whereIs.val(),all:$list.data("all")||"",last_sort:$list.data("last_sort"),birddog:$list.data("birddog"),__fragment:"meetupList"};$.ajax({type:"POST",data:args,url:BD.stripQueryStringAndHash(),success:function(data){spinner.stop();var content=eval(data),newCenter;$("#withinDistance").text($whereIs.val());$list.html(content[0]).css("opacity",1).data("last_sort",args.sort);$("#addNewCommunity").html(content[1]);if(locationChanged&&window.Microsoft.Maps&&BD.bigMap){newCenter=new Microsoft.Maps.Location(args.lat,args.lon);BD.bigMap.map.setView({center:newCenter})}}})};BD.birddogNameInput=function(e){$("#birddogTitlePreview").text(this.value+" ");if(BD.nameChangesUrl){$("#urlkey").val(M.urlify(this.value))}if(BD.nameChangesTag){$("#tag").val(BD.nameToHash(this.value))}};BD.birddogUrlInput=function(e){var urlKey=M.urlify(this.value);if(urlKey.length>0){$(this).val(urlKey)}else{Meetup.BD.nameChangesUrl=true}};BD.birddogTagInput=function(e){var tag=M.urlify(this.value).replace(/-/g,"");if(tag.length>0){$(this).val(tag)}else{Meetup.BD.nameChangesTag=true}};BD.hashLength=10;BD.nameToHash=function(name){var ret=name.replace(/\b(as|a|an|the|but|as|and|or|are|is)\b/gi,""),initialsRegExp=/.*?(\w).*?\b(\w).*?\b(\w).*?\b(\w).*?\b(\w).*/;if(ret.match(initialsRegExp)){ret=ret.replace(initialsRegExp,"$1$2$3$4$5").toLowerCase()}else{ret=ret.replace(/[\W]+/g,"");if(ret.length>BD.hashLength){var firstLetter=ret.substring(0,1);ret=ret.replace(/[aeiuo]/g,"");if(firstLetter.match(/[aeiou]/)){ret=firstLetter+ret}}if(ret.length>BD.hashLength){ret=ret.substring(0,BD.hashLength)}}return ret+"Mup"};BD.signupLogin=function(show,hide,target){var returnUri,uriStr,qsMatch,url,oper,helloPanes=$("#helloPanes");if(target){if(target.href){uriStr=target.href;qsMatch=uriStr.match(/[\?&]+returnUri=(.*?)(&|$)/);if(qsMatch&&qsMatch[1]){returnUri=qsMatch[1]}else{returnUri=uriStr.indexOf("?")>-1?encodeURIComponent(uriStr):encodeURIComponent(window.location)}}else{if(target.action){returnUri=encodeURIComponent(target.action+"?"+$(target).serialize())}}if(returnUri){$("#popupSignUp_returnUri, #popupLogIn_returnUri").each(function(){$(this).attr("value",unescape(returnUri))});if($("#registerNoLocation")[0]){url=$("#registerNoLocation").attr("href");oper=(url.indexOf("?")>=0)?"&":"?";$("#registerNoLocation").attr("href",url+oper+"returnUri="+returnUri)}M.FB.returnUri=returnUri}}if($.browser.msie&&parseInt($.browser.version,10)<=8){var bigMap=$("#birddogMap"),eventMap=$("#event-details").find(".map-link");bigMap.css("visibility","hidden");eventMap.css("visibility","hidden");helloPanes.dialog("option","beforeClose",function(){bigMap.css("visibility","visible");eventMap.css("visibility","visible")})}$("#"+show).show();$("#"+hide).hide();helloPanes.dialog("open");if(target&&target.action){target.hasBeenSubmitted=false}};BD.showDialogAndPosition=function(e,dialog,callback){if(BD.isFbApp){var eventTarget=$(e.target),dialogWrapper=dialog.parent("div"),offset=eventTarget.offset(),balancedHeight=offset.top-Math.floor(dialogWrapper.outerHeight()/2);dialog.dialog("option",{position:[50,balancedHeight]});dialog.dialog("open");if(typeof callback==="function"){callback.call(this,e)}}else{dialog.dialog("open")}};BD.forceLogin=function(e,alt){if(typeof(e)!=="object"){e=null}if(Member.id===0){if(e){e.preventDefault()}if(!BD.isFbApp){BD.signupLogin("paneLogin","paneSignup",this)}else{var fbSignup=$("#fb-signup-dialog"),targ=e?$(e.target):null;if(targ){if(targ.is("textarea")){targ.blur()}if(targ.is("a")){Meetup.FB.returnUri+=targ.attr("href")}}if(e){BD.showDialogAndPosition(e,fbSignup)}else{$("#fb-signup-dialog").dialog("open")}}}else{if(typeof alt==="function"){if(Meetup.BD.isFbApp){var that=this,j=e;Meetup.FB.extendPerms("email",function(){Meetup.FB.hasGrantedPermission=true;alt.call(that,j)})}else{alt.call(this,e)}}}};BD.apiFollowCommunity=function(callback){$.ajax({type:"POST",url:"/api/",data:{method:"followChapter",arg_memberId:Member.id,arg_chapterId:Meetup.BD.chapter.id,arg_birddogId:Meetup.BD.birddog.id},success:function(){if(callback&&typeof callback==="function"){callback()}}})};BD.buildConfirmThis=function(step){var el=$($.mustache(BD.templates.confirm_this,{question:step.question,explain:step.explain,hasYesFunc:typeof step.yesFunction==="function",yesLocation:step.yesLoc,yes:step.yesLabel,no:step.noLabel}));el.find("span.go_lite").bind("click",function(){if(typeof step.yesFunction==="function"){step.yesFunction()}$("#steppedDialog").trigger("advance")});el.find("span.meh_lite").bind("click",function(){if(typeof step.noFunction==="function"){step.noFunction()}else{$("#steppedDialog").trigger("advance")}});return el};BD.confirmThis=function(that,arg){var $that=$(that),args=arg||{},loc,opts;if(!args.yesFunction){if($that.is("a")){loc=$that.attr("href")}else{if($that.is("form")){loc=[that.action,$that.serialize()].join("?")}else{loc=window.location.href}}}opts=$.extend({question:CopyBD.youSure,explain:CopyBD.noUndo,yesLabel:CopyBD.yes,noLabel:CopyBD.no,yesLoc:loc},args);new BD.steppedDialog([BD.buildConfirmThis({question:opts.question,explain:opts.explain,yesFunction:opts.yesFunction,yesLabel:opts.yesLabel,noLabel:opts.noLabel,yesLoc:opts.yesLoc,noFunction:opts.noFunction})])};BD.copyEventConfirmation=function(elem){var $elem,copy_data,view,form_html,$from;$elem=$(elem);copy_data=$elem.data("copy");view=$.extend({path:elem.href},copy_data);form_html=$.mustache(BD.templates.copy_event_confirm,view);$form=$(form_html);$form.dialog({autoOpen:true,open:function(){var $long_field=$form.find("textarea");$long_field.CharCounter();$form.delegate("a.meh","click",function(){$form.dialog("close").dialog("destroy").remove()}).bind("submit",function(e){var CopyEvent=Meetup.Copy.BD.event,$short_field=$form.find('input[type="text"]'),short_descr=$short_field.val(),long_descr=$long_field.val(),long_descr_max=$long_field.data("max-len");BD.removeError($form,"inline","find","hide",0);if(!short_descr.length){e.preventDefault();BD.createError($short_field.parent(),"inline",CopyEvent.inline_editing.short_descr_missing)}else{if(long_descr.length>long_descr_max){e.preventDefault();BD.createError($long_field.parent(),"inline",CopyEvent.inline_editing.descr_too_long)}}})}})};BD.seeMore=function(listId,opts){var done=false;if(!opts){opts={}}var $list=$("#"+listId),$lastInList=$list.find("li:last"),wait=$lastInList.waitPls(),toElmId=$lastInList.prev().attr("id"),moreArgs=opts.args||{},contentKey=opts.contentKey||0,allKey=opts.allKey||"all",url=opts.url||location.href,args={__fragment:listId,birddog:Meetup.BD.birddog.id};args[allKey]=1;$.extend(args,moreArgs);$list.fadeTo("fast",0.5,function(){if(!done){wait.start()}});$.ajax({url:BD.stripQueryStringAndHash(),data:args,success:function(data){done=true;wait.stop();var content=eval(data);$list.data(allKey+"",1);$list.html(content[contentKey]);location.hash="#"+toElmId;$list.fadeTo("fast",1).find("img[data-src]").lazyImg()}})};BD.iconTrays=function(){var api={},timeout;function showOrHide(e,element,show){var $tray=$(element).find("span.actionsIcons");clearTimeout(timeout);if(e.data&&e.data.delay&&e.data.delay>0){timeout=setTimeout(function(){show?$tray.show():$tray.hide()},e.data.delay)}else{show?$tray.show():$tray.hide()}}api.show=function(e){showOrHide(e,this,true)};api.hide=function(e){showOrHide(e,this)};return api}()}(jQuery,Meetup,Meetup.BD,Meetup.Copy.BD,window,window.document));Meetup.BD.comments=(function($,BD,CopyBD){var api={},indexes={comment:{error:0,list:1},reply:{toggle:0,list:1,error:2}},comments=$("#comments"),commentsList=$("#comments-list"),ajaxPostUri=BD.event?BD.event.url:window.location.href.split("#")[0];function notEmpty(data){return !!(data.toString().replace(/(\s+)/g,"").length)}function parseEmbedly(){if(typeof jQuery.embedly!=="undefined"){$(".embed").remove();$("div.contents").each(function(i,el){$(el).embedly({maxWidth:300,method:"afterParent"})})}}function updateRepliesByParentId(parentCommentId,toggle,replies){var replyList=$("#subComments"+parentCommentId),toggleLink=$("#replyToggle"+parentCommentId),hasReplies=notEmpty(replies);replyList.children("li.loading").remove();if(hasReplies){toggleLink.remove();replyList.before(toggle).html(replies);parseEmbedly();replyList.find("img[data-src]").lazyImg({effect:"fadeIn",effectspeed:"slow"})}else{replyList.empty()}}function expandReplies(list){list.data("expanded",true);list.prepend('<li class="loading">'+CopyBD.loading+"</li>");$.ajax({type:"GET",url:ajaxPostUri,data:{__fragment:list[0].id,showAll:"1"},success:function(data){var content=eval(data);updateRepliesByParentId(list.data("parentid"),content[indexes.reply.toggle],content[indexes.reply.list])}})}function collapseReplies(list){var listItems=list.children(),filtered=listItems.filter(":lt("+(listItems.length-2)+")");filtered.slideUp("fast",function(){list.data("expanded",false);filtered.remove()})}function addErrorTo(element,errorType,errorMessage){element.data(errorType,true).html('<div class="ERR"><div class="ERR_body">'+errorMessage+"</div></div>")}function getLength(str){if(!str.match(/(\r\n)/)){if(str.match(/(\r)/)){str=str.replace(/(\r)/g,"xx")}else{if(str.match(/(\n)/)){str=str.replace(/(\n)/g,"xx")}}}return str.length}api.updateCommentsList=function(content){function updateDom(content){commentsList.html(content[indexes.comment.list]);$("#commentInputText").val("").trigger("reset");commentsList.find("form").collapsable();commentsList.find("textarea").CharCounter().TextInputTip();commentsList.find("img[data-src]").lazyImg({effect:"fadeIn",effectspeed:"slow"});parseEmbedly()}if($.isArray(content)){updateDom(content)}else{$.ajax({type:"GET",url:ajaxPostUri,data:{__fragment:"comments"},success:function(data){updateDom(eval(data))}})}};api.comment=BD.formProcessor(true,function(e){if(BD.event.id>0){e.preventDefault();var that=this,form=$(this),commentText=$.trim(form.find("textarea").val()),postData,waitSpin,newLocation;if(!commentText){addErrorTo(form.find("div.errors"),"errorTooShort",CopyBD.comments.errorTooShort);that.hasBeenSubmitted=false}else{if(commentText.length>500){addErrorTo(form.find("div.errors"),"errorTooLong",CopyBD.comments.errorTooLong);that.hasBeenSubmitted=false}}postData=form.serialize()+"&__fragment="+form.data("fragment"),waitSpin=form.waitPls(),waitSpin.start();comments.fadeTo("fast",0.5);$.ajax({type:"POST",url:ajaxPostUri,data:postData,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(data){var content=eval(data),hasError=notEmpty(content[indexes.comment.error]);waitSpin.stop();if(hasError){$("#commentErrors").html(content[indexes.comment.error]).data("errorTooLong",true)}else{api.updateCommentsList(content)}comments.fadeTo("fast",1,function(){BD.removeMSIEFilter(this)});that.hasBeenSubmitted=false}})}});api.reply=BD.formProcessor(true,function(e){var commentText,postData,waitSpin,parentComment,parentCommentId,replyList,that=this,form=$(this);e.preventDefault();if(BD.event.id>0){commentText=$.trim(form.find("textarea").val());postData=form.serialize()+"&__fragment="+form.data("fragment");waitSpin=form.waitPls();parentComment=form.closest("li");parentCommentId=form.find('input[name="parentCommentId"]').val();replyList=$("#subComments"+parentCommentId);if(!commentText){addErrorTo(form.find("div.errors"),"errorTooShort",CopyBD.comments.errorTooShort);that.hasBeenSubmitted=false}else{if(commentText.length>500){addErrorTo(form.find("div.errors"),"errorTooLong",CopyBD.comments.errorTooLong);that.hasBeenSubmitted=false}else{waitSpin.start();parentComment.fadeTo("fast",0.5);if(replyList.data("expanded")){postData+="&showAll=1"}$.ajax({type:"POST",url:ajaxPostUri,data:postData,success:function(data){var content=eval(data),hasError=notEmpty(content[indexes.reply.error]),textarea=form.find("textarea");waitSpin.stop();if(hasError){$("#commentErrors"+parentCommentId).html(content[indexes.reply.error]).data("errorTooLong",true)}else{updateRepliesByParentId(parentCommentId,content[indexes.reply.toggle],content[indexes.reply.list]);textarea.val("").trigger("blur")}parentComment.fadeTo("fast",1,function(){BD.removeMSIEFilter(this)});that.hasBeenSubmitted=false}})}}}else{if(BD.event.id<0){window.location=window.location.href.split("#")[0]+"?"+form.serialize()}}});api.removeComment=function(e){e.preventDefault();var self=$(this);$.ajax({type:"POST",url:ajaxPostUri,data:{op:"remove_comment",comment_id:self.data("commentid"),__fragment:"comments"},success:function(data){api.updateCommentsList(eval(data))}})};api.removeReply=function(e){e.preventDefault();var self=$(this),list=self.closest("ul");$.ajax({type:"POST",url:ajaxPostUri,data:{op:"remove_comment",comment_id:self.data("commentid"),__fragment:list[0].id},success:function(data){var content=eval(data);if(content){updateRepliesByParentId(list.data("parentid"),content[indexes.reply.toggle],content[indexes.reply.list])}else{api.updateCommentsList()}list.data("expanded",false)}})};api.toggleReplyList=function(list,toggleLink){if(list.data("expanded")){toggleLink.toggleText();collapseReplies(list)}else{expandReplies(list)}};api.toggleReplyListHandler=function(e){e.preventDefault();var self=$(this),list=$("#subComments"+self.data("parentid"));api.toggleReplyList(list,self)};api.checkErrors=function(){var self=$(this),textLen=getLength($.trim(self.val())),errors=self.closest("form").find("div.errors");if(errors.data("errorTooLong")&&textLen<500){errors.data("errorTooLong",false).empty()}else{if(errors.data("errorTooShort")&&textLen>0){errors.data("errorTooShort",false).empty()}}};return api}(jQuery,Meetup.BD,Meetup.Copy.BD));Meetup.BD.inlineEditors=(function($,BD,CopyBD){var logPre="Meetup.BD.inlineEditors",Copy=CopyBD.event.inline_editing,api={},editCallbacks={},validation={},processors={},cleanup={},hoverToEditFields=["#event-when","#event-where","#event-desc"],handleSave;function enableHoverToEdit(fields){if(BD.isFbApp){return}var fieldList=$.isArray(fields)?fields:[fields];function editField(field){var $field=$(field),$fieldEditLink=$field.find(".inline-edit-link");if(BD.event.id<0){window.location=$fieldEditLink.attr("href");return}$fieldEditLink.click();$field.find(".inline-edit-cancel").click(function(){$field.data("hoverToEdit").enable()})}for(var i=0,il=fieldList.length;i<il;i++){var field=fieldList[i],options={},$field=$(fieldList[i]),$cancel=$field.find(".inline-edit-cancel");if($field.length&&!$field.hasClass("hover-to-edit-disabled")&&($.inArray(field,hoverToEditFields)>-1)){options[field]={noCancel:true,changeCallback:function(ev,elm){editField(elm)}};$field.hoverToEdit({delegate:false,each:options});if($cancel.length){$field.data("hoverToEdit").disable();$cancel.click(function(){$(this).closest(".hover-to-edit").data("hoverToEdit").enable()})}}}}function handleError(elem,error,method){var existing=elem.find("div.ERR:first"),errorText=Copy[error];elem.find("div.ERR:gt(0)").remove();if(existing.length){existing.children("div").text(errorText)}else{BD.createError(elem,"inline",errorText,method)}}function handleEdit(e){BD.forceLogin.call(this,e,function(e){var target=$(this).closest(".event-editable"),data=target.data("form"),callback=(typeof editCallbacks[data.type]==="function")?editCallbacks[data.type]:false;e.preventDefault();api.triggerEdit(target,callback)})}function handleEditCancel(e){e.preventDefault();var target=$(this).closest(".event-editable");api.cancelEdit(target)}handleSave=BD.formProcessor(true,function(e){e.preventDefault();var form=$(this),editable=form.closest(".event-editable"),data=editable.data("form"),validator=(typeof validation[data.type]==="function")?validation[data.type]:false,valid=validator?validator(form):true;if(valid){save.call(this)}else{this.hasBeenSubmitted=false}});function isStreetAddress(result){var accept=["street_number","route","point_of_interest"];return $.inArray(result[0].address_components[0].types[0],accept)>-1}function getResultsValue(data,search){var i,max,components;data=$.isArray(data)?data[0]:data;components=data.address_components;for(i=0,max=components.length;i<max;i++){if($.inArray(search,components[i].types)>-1){return components[i].short_name}}return false}function generateFormattedAddress(location){var address=[];if(location.street_number){address.push(location.street_number)}if(location.route){address.push(location.route+",")}if(location.locality){address.push(location.locality+",")}if(location.country==="US"){address.push(location.administrative_area_level_1)}else{if(location.country){address.push(location.country)}}if(location.postal_code){address.push(location.postal_code)}return address.join(" ")}function processGoogleData(data){var i,max,temp,formatted,search=["street_number","route","sublocality","locality","administrative_area_level_1","country","postal_code"],location={};for(i=0,max=search.length;i<max;i++){location[search[i]]=getResultsValue(data,search[i])||""}return{country:location.country,city:location.locality,street:$.trim(location.street_number+" "+location.route),zip:location.postal_code,state:location.administrative_area_level_1,lat:data.geometry.location.lat(),lon:data.geometry.location.lng(),formatted:generateFormattedAddress(location)}}function processLocSearchData(data){if(data.accuracy&&data.accuracy>4){return{country:BD.chapter.country||"",city:data.city||BD.chapter.city||"",street:data.streetAddress||"",zip:data.postalCode||BD.chapter.zip||"",state:data.region||"",lat:data.lat||"",lon:data.lng||"",formatted:data.addressLines.join(" ")||""}}else{return false}}function updateVenueFields(data){$("#venue-country").val(data.country);$("#venue-city").val(data.city);$("#venue-street").val(data.street);$("#venue-zip").val(data.zip);$("#venue-state").val(data.state);$("#venue-lat").val(data.lat);$("#venue-lon").val(data.lon);$("#venue-address").val(data.formatted)}function save(){var form=$(this),editable=form.closest(".event-editable"),data=editable.data("form"),wait=editable.waitPls();wait.start();form.fadeTo("fast",0.3);function resetForm(){form.fadeTo("fast",1);wait.stop();form[0].hasBeenSubmitted=false}$.ajax({type:"POST",contentType:"application/x-www-form-urlencoded; charset=UTF-8",url:form[0].action,data:form.serialize(),dataType:"json",success:function(response){if(!response.error){$.ajax({type:"GET",url:BD.stripQueryStringAndHash(),data:{__fragment:data.__fragment,eventRw:true,page_id:BD.fbPageId},success:function(response){var content=eval("("+response+")");resetForm();$("#event-"+data.type).replaceWith(content[0]);if(!BD.userIsRsvpd&&!BD.userIsOwner&&!alreadyRsvpdToWmd){if(!BD.isFbApp){BD.rsvp.yes();BD.userIsRsvpd=true}else{$(".rsvpYes").trigger("click")}}if(typeof cleanup[data.type]==="function"){cleanup[data.type]($("#event-"+data.type))}enableHoverToEdit("#event-"+data.type)}})}else{handleError(form,response.error);resetForm()}},error:function(){handleError(form,"unknown");resetForm()}})}function generateTextFieldValidator(selector,errors){return function(form){var type,message,tooShort,tooLong,input=form.find(selector),maxLen=input.data("max-len");function isValid(){var value=input[0].value;tooShort=errors.tooShort?value==="":false;tooLong=errors.tooLong?value.length>maxLen:false;return !(tooShort||tooLong)}function removeErrorWhenValid(){if(isValid()){BD.removeError(input,type,"siblings");input.unbind("keyup",removeErrorWhenValid)}}if(!isValid()){message=tooShort?errors.tooShort:tooLong?errors.tooLong:false;if(message){handleError(input,message,"before");input.bind("keyup",removeErrorWhenValid);return false}else{return true}}else{return true}}}validation.idea=generateTextFieldValidator('input[type="text"]',{tooShort:"short_descr_missing",tooLong:"short_descr_too_long"});validation.when=function(form){var time,dateField=form.find("input.date"),date=$.datepicker.formatDate("yy-mm-dd",dateField.datepicker("getDate")),hour=form.find("select.hour").val(),minute=form.find("select.minute").val(),ampm=form.find("select.ampm").val();hour=BD.format24HourTime(hour,ampm);time=[hour,minute,"00"].join(":");form.find("input.value").val([date,time].join(" "));return true};validation.where=function(form){var field=$("#venue-address"),nameField=$("#venue-name"),name=nameField.val(),nameDefault=nameField[0].title,current=field.val(),original=field.data("original"),hasChanged=field.val()!==original,location=field.data("location");function dataCallback(data){data.address=name+" "+data.address}function geoCallback(result,status){var location;if(status===google.maps.GeocoderStatus.OK&&result.length>0){if(result.length>1){this.geocodeField("suggest",[result,status]);handleError(form,"venue_specificity")}else{if(isStreetAddress(result)){this.data("location",result[0]);this.geocodeField("hideSuggest");location=processGoogleData(result[0]);updateVenueFields(location);form.trigger("submit")}else{this.data("location",result[0]);var that=this;$.ajax({dataType:"json",url:[Meetup.Data.secureUrl,"locSearch.jsp?q=",name," ",current].join(""),success:function(response){if(response&&response.responseData&&response.responseData.results){if(response.responseData.results.length===1){location=processLocSearchData(response.responseData.results[0]);if(location){updateVenueFields(location);form.trigger("submit")}else{handleError(form,"venue_specificity")}}else{if(response.responseData.results.length>1){that.geocodeField("suggest",[response.responseData.results])}}}else{handleError(form,"invalid_location")}}})}}}else{handleError(form,"invalid_location")}}if(current===""){handleError(form,"invalid_location");return false}else{if(name===nameDefault||name===""){handleError(form,"invalid_venue_name");return false}else{if(!location){field.geocodeField("execute",[dataCallback,geoCallback]);return false}else{if(location&&location.success&&location.success===""){handleError(form,"venue_specificity")}else{field.geocodeField("hideSuggest");return true}}}}};validation.descr=generateTextFieldValidator("textarea",{tooLong:"descr_too_long"});cleanup.where=function(editable){return;var data=editable.data("form"),mapSize=!!BD.isFbApp?"160x160":"250x201",mapSrc=["http://maps.google.com/maps/api/staticmap?center=",data.lat,",",data.lon,"&zoom=14&size=",mapSize,"&maptype=roadmap&markers=color:red|label:M|",data.lat,",",data.lon,"&sensor=false"].join(""),mapUrl=["http://maps.google.com/maps?saddr=",data.location.replace(" ","+","g"),"&sll=",data.lat,",",data.lon].join("");$("#event-details").find("a.map-link").attr("href",mapUrl).find("img").attr("src",mapSrc)};processors.when=function(view){var i,max,tempDate;view.hours=BD.generateHours(view.selectedHour||"7");view.minutes=BD.generateMinutes(view.selectedMinute||"00");if(!view.date){tempDate=BD.generateDateTwoWeeksAway();view.date=[tempDate.getMonth()+1,tempDate.getDate(),tempDate.getFullYear()].join("/")}return view};editCallbacks.idea=function(elem){elem.find("input.text").CharCounter()};editCallbacks.when=function(elem){elem.find("input.date").datepicker(BD.datePickerSettings)};editCallbacks.where=function(elem){$("#venue-address").geocodeField({minLength:8,delay:1500,geoCallback:function(result,status){var isOk=status===google.maps.GeocoderStatus.OK&&result.length>0;if(isOk&&result.length>1){this.geocodeField("suggest",[result,status])}else{if(isOk&&isStreetAddress(result)){this.data("location",result[0]);this.geocodeField("suggest",[result,status])}else{this.data("location",false);this.geocodeField("hideSuggest")}}},chooseCallback:function(result){var location;try{location=processGoogleData(result)}catch(e){location=processLocSearchData(result)}updateVenueFields(location)}});$("#venue-name").TextInputTip(BD.dontStop)};editCallbacks.descr=function(elem){elem.find("textarea").CharCounter()};api.init=function(){var initial=$("#event-"+BD.initialEdit),initialCallback=(typeof editCallbacks[BD.initialEdit]==="function")?editCallbacks[BD.initialEdit]:false;if(initial.length){var editEl=initial.hasClass("event-editable")?initial:initial.find(".event-editable");if(editEl.length){api.triggerEdit(editEl,initialCallback)}}if(BD&&BD.chapter&&BD.chapter.id>0&&BD.event.id>0){$(document.body).delegate("a.inline-edit-link","click",handleEdit).delegate("a.inline-edit-cancel","click",handleEditCancel).delegate("form.inline-edit","submit",handleSave)}enableHoverToEdit(hoverToEditFields)};api.triggerEdit=function(elem,callback){if(!elem.length){return false}var view=elem.data("form"),template=BD.templates.inlineEdit[view.type],processor=(typeof processors[view.type]==="function")?processors[view.type]:false,view=processor?processor(view):view,temp;view=$.extend(view,{isfb:BD.isFbApp?true:false});temp=$.mustache(template.edit,view);template.original=elem.children(".original").clone();elem.html(temp);if(typeof callback==="function"){callback(elem)}};api.cancelEdit=function(elem,callback){if(!elem.length){return false}var view=elem.data("form"),template=BD.templates.inlineEdit[view.type];if(template.original){elem.html(template.original)}if(typeof callback==="function"){callback(elem)}};return api}(jQuery,Meetup.BD,Meetup.Copy.BD));Meetup.BD.rsvp=(function($,BD,CopyBD){var api={};if(!BD.isFbApp){api.indexes={count:0,action:1,list:2,chapterMembers:3,sharePrompt:4}}else{api.indexes={count:0,action:1,list:2}}function memberProfileImg(){var oneMore=parseInt($("#chapterMemberCount").text(),10)+1;return $.mustache(BD.templates.rsvp.member_profile_img,{className:(oneMore%4===0)?"fourth":"",image:BD.chapterMemberImg,name:Member.name})}function yes(callback){if(BD.event.id>0){Meetup.BD.userIsRsvpd=true;var waitSpin=$("#rsvpActionWrap").waitPls();api.updateEffects("down",function(){waitSpin.start();$.ajax({type:"POST",url:window.location.href.split("#")[0],data:{op:"rsvp",__fragment:"rsvpList"},success:function(data){waitSpin.stop();var content=eval(data);if(!BD.isFbApp){chapterMemberAdd(content[BD.rsvp.indexes.chapterMembers]);updateSharePrompt(content[BD.rsvp.indexes.sharePrompt])}api.updateEffects("up",function(){if(!BD.isFbApp){new BD.steppedDialog(api.doAfterRsvp())}else{api.doAfterFbRsvp()}},content);if(callback){callback()}}})})}else{var ops="op=rsvp&page_id="+Meetup.BD.fbPageId;window.location=[BD.stripQueryStringAndHash(),ops].join("?")}}function chapterMemberAdd(markup){if(!BD.userIsChapterMember){BD.userIsChapterMember=true;var chapterMemberImgs=$("#communityMembers"),chapterMembers=$("#chapterMemberCount"),updatesSection=$("#getUpdates"),chapterMemberCount;chapterMemberCount=parseInt(chapterMembers.text(),10);chapterMembers.text(chapterMemberCount+1);updatesSection.html($.mustache(BD.templates.rsvp.following,{chapterUrl:BD.chapter.url}));if(markup){chapterMemberImgs.html(markup)}else{chapterMemberImgs.append(memberProfileImg())}}}function updateSharePrompt(markup){$("#sharePrompt").html(markup)}function populateEventInfo(button){var li=button.parents("li");if(!BD.event){BD.event={}}BD.event.shortDescr=li.data("shortDescr");BD.event.url=li.data("url");BD.event.formattedDate=li.data("formattedDate");BD.event.descr=li.data("descr");BD.event.isRemoteRSVP=true}function yesRemote(memberId,birddogId,chapterId,eventId,successCallback,errorCallback){$.ajax({type:"GET",url:"/api/",data:{method:"rsvpForEverywhereEvent",arg_memberId:memberId,arg_birddogId:birddogId,arg_chapterId:chapterId,arg_eventId:eventId},error:errorCallback,success:successCallback})}function cancelRemote(memberId,birddogId,chapterId,eventId,successCallback,errorCallback){$.ajax({type:"GET",url:"/api/",data:{method:"cancelRsvpForEverywhereEvent",arg_memberId:memberId,arg_birddogId:birddogId,arg_chapterId:chapterId,arg_eventId:eventId},error:errorCallback,success:successCallback})}api.doAfterRsvp=function(){var steps=[];if(!!BD.fbFriendList){steps.push(BD.buildInviteStep)}steps.push(BD.buildMultiShare);if(BD.collectEmails){steps.push(api.buildEmailShareStep)}if(BD.eventLink){steps.push(api.buildVisitStep)}return steps};api.doAfterFbRsvp=function(){FB.ui({display:"popup",method:"feed",name:"Invite friends",link:window.location.toString(),picture:"http://img1.meetupstatic.com/892670376411449149876/img/header/logo.png",caption:"Local community",description:"Attend a "+BD.birddog.name+"near you!",message:"Enter a message here"})};api.updateEffects=(function(){var wrap=$("#rsvpActionWrap");function equalize(frame,wrap){wrap.height(frame.outerHeight())}function down(frame,callback){equalize(frame,wrap);frame.css({position:"absolute"}).animate({top:wrap.height()+"px"},200,callback)}function up(content,frame,wrap,callback){if(content){var count=parseInt(content[BD.rsvp.indexes.count].split(" ")[0],10),howMany=BD.isFbApp?$("#whosComing").find("h4"):$("ul.event-details-list").children("li.rsvp-count");howMany.html(content[BD.rsvp.indexes.count]);if(isNaN(count)||count<1){howMany.removeClass("is-set").addClass("not-set")}else{howMany.addClass("is-set").removeClass("not-set")}wrap.html(content[BD.rsvp.indexes.action])}frame=$("#rsvpAction");frame.css({display:"block",position:"absolute",top:wrap.height()+"px"}).animate({top:0},600,"easeOutElastic",function(){equalize(frame,wrap);if(content){var rsvpList=$("#rsvpList");rsvpList.html(content[BD.rsvp.indexes.list]);rsvpList.css({opacity:0.5}).animate({opacity:1},200,function(){BD.removeMSIEFilter(this);callback()}).find("img[data-src]").lazyImg()}else{callback()}})}return function(action,callback,content){var frame=$("#rsvpAction");callback=$.isFunction(callback)?callback:$.noop;wrap.css({position:"relative",overflow:"hidden"});if(action==="up"){up(content,frame,wrap,callback)}else{if(action==="down"){down(frame,callback)}}}}());api.buildEmailShareStep=function(){var html=$.mustache(BD.templates.rsvp.email_share,{header:CopyBD.rsvp.steps.shareEmailHeader,explanation:CopyBD.rsvp.steps.shareEmailExplanation,email:BD.yourRegisteredEmail,shareEmailEdit:CopyBD.rsvp.steps.shareEmailEdit,yes:CopyBD.rsvp.steps.shareEmailConfirm,no:CopyBD.no}),el=$(html);function testEmailAddress(){var emailString=$("#shareThisEmail").val(),input=$("#shareThisEmail_input");if(emailString===""){input.css({background:"url(//img1.meetupstatic.com/img/162792119248481331/thirdparty/fff/silk/error.png) right center no-repeat"});return false}else{if(emailString.match(/^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4})*$/)){input.css({background:"url(//img1.meetupstatic.com/img/539349144020249835648/thirdparty/fff/silk/accept.png) right center no-repeat"});return true}else{input.css({background:"url(//img1.meetupstatic.com/img/162792119248481331/thirdparty/fff/silk/error.png) right center no-repeat"});return false}}}$("#shareThisEmail").bind("keyup",testEmailAddress);$("#shareThisEmail_change").live("click",function(){var that=$(this);that.parent().css({minHeight:that.height()});that.fadeOut(100,function(){$("#shareThisEmail_input").effect("drop",{direction:"up",mode:"show"},100,function(){BD.removeMSIEFilter(this);testEmailAddress()})})});el.find("span.go_lite").bind("click",function(){if(testEmailAddress()){$.ajax({type:"POST",url:BD.stripQueryStringAndHash(),data:{op:"share_email",alt_email:$("#shareThisEmail").val(),birddog:$("#birddog").val(),event:$("#event").val(),__fragment:"dummy"},success:function(){BD.collectEmails=false;$("#steppedDialog").trigger("advance")}})}});el.find("span.meh_lite").bind("click",function(){$("#steppedDialog").trigger("advance")});return el};api.buildVisitStep=function(){return BD.buildConfirmThis({question:CopyBD.rsvp.steps.visitHeader,explain:CopyBD.rsvp.steps.visitExplanation,yesFunction:function(){window.open("http://"+BD.eventLink)},yesLabel:CopyBD.rsvp.steps.visitConfirm,noLabel:CopyBD.noThanks})};api.yes=function(e){if(typeof(e)==="object"){e.preventDefault()}BD.forceLogin.call(this,e,function(){var self=$(this),actionDiv=self.parents(".action");if(actionDiv.data("existing-rsvp")){var otherRsvp={chapterId:actionDiv.data("chapter-id"),eventId:actionDiv.data("event-id")};BD.confirmThis(self,{question:CopyBD.rsvp.changeRsvpLocation.header,explain:CopyBD.rsvp.changeRsvpLocation.details.replace("__WMDNAME__",BD.event.shortDescr).replace("__CHAPTERNAME__",BD.chapter.name),yesLabel:CopyBD.rsvp.changeRsvpLocation.yesDoIt,noLabel:CopyBD.noThanks,yesFunction:function(){yes(function(){cancelRemote(Member.id,BD.birddog.id,otherRsvp.chapterId,otherRsvp.eventId,$.noop,$.noop)})},noFunction:function(){var steppedDialog=$("#steppedDialog");steppedDialog.dialog("close");setTimeout(function(){steppedDialog.remove()},2000)}})}else{yes()}})};api.rsvpFormInit=function(e){var $rsvpBox=$("#rsvpBox"),$rsvpForm=$rsvpBox.find("form:first"),$opInput=$("#rsvp_op"),$memberInput=$("for_member_id"),$radioYes=$("#response_yes"),$radioYesLabel=$radioYes.parent(),$radioNo=$("#response_no"),$radioNoLabel=$radioNo.parent(),$rsvpStatus=$("#rsvp-mine"),$rsvpChange=$rsvpStatus.find(".rsvp-change"),$signInToRsvp=$("#signInToRsvp");$("label",$rsvpBox).click(function(){var el=$(this),elRadio=el.find(".rsvp-choice-radio"),elId=el.attr("id");$radioYesLabel.add($radioNoLabel).removeClass("selected");if(elRadio.attr("id")=="response_yes"){$opInput.val("rsvp");$radioYesLabel.addClass("selected")}else{if(elRadio.attr("id")=="response_no"){$opInput.val("remove_attendee");$radioNoLabel.addClass(" selected")}else{return}}});$rsvpChange.click(function(e){e.preventDefault();$rsvpBox.slideDown("fast");$rsvpChange.hide()});if($signInToRsvp.length){$signInToRsvp.click(function(e){e.preventDefault();BD.forceLogin(e)})}};api.yesFormFacebook=function(e){if(typeof(e)==="object"){e.preventDefault()}var $form=$(this).parent("form");Meetup.FB.returnUri=encodeURIComponent(window.location.href+"&rsvpAfterLogin=true");BD.forceLogin.call(this,e,function(){var self=$(this),actionDiv=self.parents(".action");if(actionDiv.data("existing-rsvp")){var otherRsvp={chapterId:actionDiv.data("chapter-id"),eventId:actionDiv.data("event-id")};BD.confirmThis(self,{question:CopyBD.rsvp.changeRsvpLocation.header,explain:CopyBD.rsvp.changeRsvpLocation.details.replace("__WMDNAME__",BD.event.shortDescr).replace("__CHAPTERNAME__",BD.chapter.name),yesLabel:CopyBD.rsvp.changeRsvpLocation.yesDoIt,noLabel:CopyBD.noThanks,yesFunction:function(){cancelRemote(Member.id,BD.birddog.id,otherRsvp.chapterId,otherRsvp.eventId,function(){$form.submit()},$.noop)},noFunction:function(){var steppedDialog=$("#steppedDialog");steppedDialog.dialog("close");setTimeout(function(){steppedDialog.remove()},2000)}})}else{$form.submit()}})};api.yesRemote=function(e){e.preventDefault();BD.forceLogin.call(this,e,function(){var self=$(this),actionDiv=self.parents(".action"),rsvpBox=self.parent().parent(),memberId=Member.id,birddogId=BD.birddog.id,chapterId=self.data("chapterid")||BD.chapter.id,eventId=self.data("eventid");populateEventInfo(self);function rsvpUser(callback){if(eventId>0&&chapterId>0){rsvpBox.waitPls().fadeTo("slow","0.5",function(){rsvpBox.start();yesRemote(memberId,birddogId,chapterId,eventId,function(data){var worked=$.parseJSON(data),actionBox,countElem,count,dialog;if(worked){actionBox=self.parent();countElem=$("#eventRsvpCount"+eventId);count=parseInt(countElem.text(),10)+1;if(count===1&&!BD.isFbApp){countElem.parent().show().prev().hide()}countElem.text(count).closest("div.count").removeClass("not-set").addClass("is-set");chapterMemberAdd();actionBox.html($.mustache(BD.templates.rsvp.im_going,{chapterUrl:BD.chapter.url,chapterId:BD.chapter.id,eventId:eventId}));if(!BD.isFbApp){dialog=new BD.steppedDialog(api.doAfterRsvp())}else{api.doAfterFbRsvp()}}if(callback){callback()}rsvpBox.stop();rsvpBox.fadeTo("slow","1")})})}else{window.location=self.attr("href")}}if(actionDiv.data("existing-rsvp")===true){var shortDescr=self.parents("li").data("shortDescr"),otherRsvp={chapterId:actionDiv.data("chapter-id"),eventId:actionDiv.data("event-id")};BD.confirmThis(self,{question:CopyBD.rsvp.changeRsvpLocation.header,explain:CopyBD.rsvp.changeRsvpLocation.details.replace("__WMDNAME__",shortDescr).replace("__CHAPTERNAME__",BD.chapter.name),yesLabel:CopyBD.rsvp.changeRsvpLocation.yesDoIt,noLabel:CopyBD.noThanks,yesFunction:function(){rsvpUser(function(){cancelRemote(Member.id,BD.birddog.id,otherRsvp.chapterId,otherRsvp.eventId,$.noop,$.noop);actionDiv.data("existing-rsvp","false")})},noFunction:function(){var steppedDialog=$("#steppedDialog");steppedDialog.dialog("close");setTimeout(function(){steppedDialog.remove()},2000)}})}else{rsvpUser()}})};api.cancelRemote=function(e){e.preventDefault();var self=$(this);BD.forceLogin.call(this,e,function(){var rsvpBox=self.parent().parent(),memberId=Member.id,birddogId=BD.birddog.id,chapterId=BD.chapter.id,eventId=self.data("eventid");rsvpBox.waitPls().fadeTo("slow","0.5",function(){rsvpBox.start();cancelRemote(memberId,birddogId,chapterId,eventId,function(data){var worked=$.parseJSON(data),actionBox,countElem,count;if(worked===true){actionBox=self.parent();if(actionBox.find("span.going").length){countElem=$("#eventRsvpCount"+eventId);count=parseInt(countElem.text(),10)-1;count=count||0;countElem.text(count);if(count<1){countElem.closest("div.count").removeClass("is-set").addClass("not-set")}}actionBox.html($.mustache(BD.templates.rsvp.not_going,{chapterUrl:BD.chapter.url,chapterId:BD.chapter.id,eventId:eventId}))}else{LOG.error("Error cancelling RSVP!")}rsvpBox.stop();rsvpBox.fadeTo("slow","1")})})})};api.remove=function(e){BD.forceLogin(e,function(){if(BD.event.id>0){e.preventDefault();var self=$(e.target),removeSelf=self.hasClass("self"),removeHelper=self.hasClass("helper"),notRemove=self.hasClass("rsvpNo"),memberId=self.data("id"),memberName=self.data("name"),whosComing=$("#whosComing"),actionWrap=$("#rsvpActionWrap"),rsvpList=$("#rsvpList"),rsvpHead=$("#rsvpHead"),waitSpin,confirmMessage;function remove(){function makeCall(){$.ajax({type:"POST",url:window.location.href.split("#")[0],data:{op:"remove_attendee",for_member_id:memberId,__fragment:"rsvpList"},success:function(data){waitSpin.stop();var content=eval(data);if(removeSelf){if(!BD.isFbApp){updateSharePrompt(content[BD.rsvp.indexes.sharePrompt])}api.updateEffects("up",$.noop,content)}else{actionWrap.html(content[BD.rsvp.indexes.action]);rsvpList.html(content[BD.rsvp.indexes.list])}rsvpList.find("img[data-src]").lazyImg({effect:"fadeIn",effectspeed:500,threshold:300})}})}var removeRefreshUrl=Meetup.BD.event.url+"?op=remove_attendee&for_member_id="+memberId;return window.location=removeRefreshUrl;if(removeSelf){waitSpin=actionWrap.waitPls();Meetup.BD.userIsRsvpd=false;api.updateEffects("down",function(){waitSpin.start();makeCall()})}else{waitSpin=whosComing.waitPls();makeCall()}}if(removeSelf){confirmMessage=CopyBD.rsvp.confirmRemoveSelf}else{if(removeHelper){confirmMessage=CopyBD.rsvp.confirmRemoveHelper.replace("__WHO__",memberName,"g")}else{confirmMessage=CopyBD.rsvp.confirmRemoveAttendee.replace("__WHO__",memberName,"g")}}if(BD.event&&BD.event.id){BD.userIsRsvpd=false}if(notRemove){remove()}else{BD.confirmThis(this,{explain:confirmMessage,yesFunction:remove})}}})};return api}(jQuery,Meetup.BD,Meetup.Copy.BD));Meetup.BD.seedForm=(function($,BD,CopyBD){var api={},$wrapper,$form,$revealer,$fields,$preview;api.formValidate=function(){var required=$form.find("input.required-field, select.required-field, textarea.required-field"),filledIn=$.grep(required,function(el){return(el.value!=="")});return filledIn.length>=required.length};api.save=function(e,skipPreview){if(!skipPreview&&api.formValidate()){if(e&&e.preventDefault){e.preventDefault()}var view={name:$fields.shortDescr.val(),month:$fields.month.val(),day:$fields.day.val(),year:$fields.year.val(),hour:$fields.hour.find("option:selected").text(),minute:$fields.minute.find("option:selected").text(),ampm:$fields.ampm.find("option:selected").text(),details:BD.nl2br($fields.longDescr.val()),tag:$fields.tag.val()},template=BD.templates.seeded_meetups.preview,markup=$.mustache(template,view),$existing=$preview.find("dl.contents");if($existing.length){$existing.replaceWith(markup)}else{$preview.find("div.intro").after(markup)}BD.showDialogAndPosition(e,$preview)}};api.formReset=function(){$form.find("div.ERR").remove();$fields.shortDescr.val("").trigger("resetTip").trigger("reset");$fields.longDescr.val("").trigger("reset");$fields.date.val("").trigger("resetTip");$fields.hour.children(":selected").removeAttr("selected").siblings(":first").attr("selected","selected");$fields.minute.children(":selected").removeAttr("selected").siblings(":first").attr("selected","selected");$fields.ampm.children(":selected").removeAttr("selected").siblings(":first").attr("selected","selected");$fields.tag.val("")};api.formShow=function(e){if(e&&e.preventDefault){e.preventDefault()}$revealer.hide();$wrapper.slideDown("fast")};api.formHide=function(e){if(e&&e.preventDefault){e.preventDefault()}$("#C_context").children(".error").slideUp("fast",function(){$(this).remove()});$revealer.show();$wrapper.slideUp("fast",api.formReset)};api.init=function(){$revealer=$("#new-worldwide-meetup");$wrapper=$("#seeded-meetup-form");$form=$wrapper.find("form");$fields={day:$("#idea-day"),month:$("#idea-month"),year:$("#idea-year"),shortDescr:$("#short-descr"),date:$("#idea-datepicker"),hour:$("#idea-hour"),minute:$("#idea-minute"),ampm:$("#idea-am-pm"),longDescr:$("#long-descr"),tag:$("#tag-field")};$preview=$("#seeded-meetup-preview");$revealer.bind("click",api.formShow);$form.bind("submit",api.save);if(!BD.isFbApp){$form.find("a.cancel").bind("click",api.formHide)}$fields.shortDescr.CharCounter().TextInputTip(BD.dontStop);$fields.date.TextInputTip(BD.dontStop).datepicker(BD.datePickerSettings);$fields.longDescr.CharCounter();$fields.tag.bind("blur",BD.birddogTagInput);$preview.dialog().delegate("a.go","click",function(e){e.preventDefault();$preview.dialog("close");$form.trigger("submit",[true])}).delegate("a.meh","click",function(e){e.preventDefault();$preview.dialog("close")})};return api}(jQuery,Meetup.BD,Meetup.Copy.BD));Meetup.BD.seedComments=(function($,BD,CopyBD){var $overlay,api={};api.create=function(e){if(e&&e.preventDefault){e.preventDefault()}var seedId=$(this).data("seed-id");$("#seed-comment-event-id").val(seedId);BD.showDialogAndPosition(e,$overlay)};api.save=BD.formProcessor(true,function(e){var $form=$(this),$errTarget=$form.find("div.input"),text=$form.find("textarea").val(),tooLong=$form.find("div.limit-container").children("span").hasClass("error"),tooShort=$.trim(text).length===0;BD.removeError($errTarget,"errorTooLong");BD.removeError($errTarget,"errorTooShort");if(tooLong){e.preventDefault();BD.createError($errTarget,"errorTooLong",CopyBD.comments.errorTooLong);this.hasBeenSubmitted=false}else{if(tooShort){e.preventDefault();BD.createError($errTarget,"errorTooShort",CopyBD.comments.errorTooShort);this.hasBeenSubmitted=false}}});api.deleteComment=function(e){if(e&&e.preventDefault){e.preventDefault()}BD.confirmThis(this,{explain:CopyBD.seed.commentDeleteConfirm})};api.toggleReplies=function(e){if(e&&e.preventDefault){e.preventDefault()}var $this=$(this),$list=$this.parent().prev(),isHider=$this.hasClass("hide"),action=isHider?"slideUp":"slideDown",callback=isHider?$.noop:function(){$(this).find("img[data-src]").lazyImg()};$list[action]("fast",callback);$this.hide().siblings("a").show()};api.init=function(){$overlay=$("#seed-comment");$overlay.dialog({width:(BD.isFbApp?"400":"500")}).find("form").bind("submit",BD.seedComments.save).find("textarea").CharCounter()};return api}(jQuery,Meetup.BD,Meetup.Copy.BD));Meetup.BD.seedInline=(function($,BD,CopyBD){var api={};api.edit=function(e){var $this,$list_item,$target,$form,template,view,markup;if(e&&e.preventDefault){e.preventDefault()}$this=$(this);$list_item=$this.closest(".seeded-listing");if($list_item.data("editing")){return}$list_item.data("editing",true);$target=$list_item.children("div.editable-region");template=Meetup.BD.templates.seeded_meetups.edit_seed;view=$target.data("form");view.hours=BD.generateHours(view.selected_hour||"7");view.minutes=BD.generateMinutes(view.selected_minute||"00");markup=$.mustache(template.form,view);template.original=$target.clone();$target.replaceWith(markup);$form=$list_item.children("form");$form.find("input.hasMaxLen, textarea.hasMaxLen").CharCounter();$form.find("input.tag").bind("blur",BD.birddogTagInput);$form.find("input.date").datepicker(BD.datePickerSettings)};api.cancel=function(e){var $this,$target,template;if(e&&e.preventDefault){e.preventDefault()}$this=$(this);$list_item=$this.closest(".seeded-listing");$target=$list_item.children("form");template=Meetup.BD.templates.seeded_meetups.edit_seed;$target.replaceWith(template.original);$list_item.data("editing",false)};api.save=BD.formProcessor(true,function(e){if(e&&e.preventDefault){e.preventDefault()}var $form=$(this),waitSpin=$form.waitPls({startDelay:0,fadeThis:0.25}),id=$form.data("seed-id"),dateChanged=false;$form.find("div.editor-date").find("input[type=text], select").each(function(){var $this=$(this);if($this.val()!=$this.data("original-value")){dateChanged=true;return false}});function cleanup(){waitSpin.stop();$form[0].hasBeenSubmitted=false;$form.closest(".seeded-listing").data("editing",false)}function validate(){var short_descr_field=$form.find('input[name="short_descr"]'),short_descr=$.trim(short_descr_field.val()),short_too_short=short_descr.length===0,short_too_long=short_descr.length>short_descr_field.data("max-chars"),long_descr_field=$form.find("textarea"),long_descr=$.trim(long_descr_field.val()),long_too_short=long_descr.length===0,long_too_long=long_descr.length>long_descr_field.data("max-chars");if(!short_too_short&&!short_too_long&&!long_too_short&&!long_too_long){BD.removeError(short_descr_field.parent(),"inline");BD.removeError(long_descr_field.parent(),"inline");request()}else{$form[0].hasBeenSubmitted=false;if(short_too_short){BD.createError(short_descr_field.parent(),"inline",CopyBD.seed.shortDescrTooShort)}else{if(short_too_long){BD.createError(short_descr_field.parent(),"inline",CopyBD.seed.shortDescrTooLong)}}if(long_too_short){BD.createError(long_descr_field.parent(),"inline",CopyBD.seed.longDescrTooShort)}else{if(long_too_long){BD.createError(long_descr_field.parent(),"inline",CopyBD.seed.longDescrTooLong)}}}}function request(){waitSpin.start();$.ajax({type:"POST",url:BD.stripQueryStringAndHash(),data:$form.serialize(),contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(data){var content=eval("("+data+")");cleanup();$form.replaceWith(content[0])},error:cleanup})}if(dateChanged){BD.confirmThis($form,{explain:Meetup.Copy.BD.seed.confirmDateChange,yesFunction:validate,noFunction:function(){$form[0].hasBeenSubmitted=false;$("#steppedDialog").trigger("advance")}})}else{validate()}});return api}(jQuery,Meetup.BD,Meetup.Copy.BD));Meetup.BD.venueLocator=(function($,BD,CopyBD){var geo,geoSession;var api={geocoded:[],country:""};var getResultsValue=function(data,val){var search=val,resp;var obj=$.isArray(data)?data[0]:data;$.each(obj.address_components,function(i,el){var index=$.inArray(search,el.types);if(index>-1){resp=el.short_name}});return resp};var isStreetAddress=function(addr){var comp=addr[0].address_components[0].types[0];return comp==="street_number"||comp==="route"||comp==="point_of_interest"};var removeDropdown=function(){$(document).unbind("keypress click",removeDropdown);$("div.disambiguation").remove()};var mapResults=function(data){function mapFallback(data){if(data.accuracy&&data.accuracy>4){api.geocoded.push({address:[data.streetAddress,data.city,data.region].join(", "),lat:data.lat||api.geocoded.lat,lng:data.lng||api.geocoded.lng,street_address:data.streetAddress||api.geocoded.streetAddress,region:data.region||api.geocoded.region,country:api.country,city:data.city||api.geocoded.city,postal_code:data.postal_code||api.geocoded.postal_code})}}function mapStandard(data){var search=["street_number","route","locality","administrative_area_level_1","country","postal_code"],found={};$.each(search,function(i,el){var value=getResultsValue(data,el);if(value){found[el]=value}});api.geocoded.push({address:data.formatted_address,lat:data.geometry.location.lat(),lng:data.geometry.location.lng(),street_address:[found.street_number,found.route].join(" "),city:found.locality,region:found.administrative_area_level_1,country:found.country,postal_code:found.postal_code})}$.each(data,function(i,el){fallback?mapFallback(el):mapStandard(el)})};var disambiguate=function(data){mapResults(data);if(api.geocoded.length){$(document).trigger("success.venueLocator");var dropdown=$("<div/>",{className:"disambiguation"});$.each(api.geocoded,function(i,el){var d=$("<div/>",{className:"disambiguationLink",text:el.address,click:function(e){api.geocoded=api.geocoded.slice(i,i+1);geoSession.callback.call(this,el);removeDropdown()}});dropdown.append(d);pos=$("#venueAddress").position();dropdown.css({left:pos.left,top:pos.top+$("#venueAddress").outerHeight(),width:$("#venueAddress").width()});$("#venueAddress").after(dropdown);$(document).bind("keypress click",removeDropdown)})}else{$(document).trigger("error.venueLocator",CopyBD.event.inline_editing.invalid_location)}};var parseGeocode=function(data){var venueName=$("#venueName"),venueAddress=$("#venueAddress");if(fallback){disambiguate(data.responseData.results)}else{if(isStreetAddress(data)){disambiguate(data)}else{if(venueName.val()!==""&&venueAddress.val()!==""){fallback=true;api.country=getResultsValue(data,"country");$.ajax({dataType:"json",url:Meetup.Data.secureUrl+"locSearch.jsp?q="+geoSession.address,async:false,success:parseGeocode})}}}};api.geocode=function(args){if(!geo){geo=new google.maps.Geocoder()}api.geocoded=[];fallback=false;geoSession=args;geo.geocode({address:args.address},function(response,status){if(status===google.maps.GeocoderStatus.OK){$(document).trigger("success.venueLocator");parseGeocode(response)}else{$(document).trigger("error.venueLocator",CopyBD.event.inline_editing.invalid_location)}})};return api}(jQuery,Meetup.BD,Meetup.Copy.BD));Meetup.BD.facebookInviter=(function($,BD,CopyBD){var api={};api.buildFriendList=function(options){if(BD.fbFriendList.data){var opts=$.extend({showNum:3,callback:null},options);function buildList(){var friends=BD.fbFriendList.data,numFriends=friends.length,notEnoughFriends=opts.showNum>friends.length,visibleCount=notEnoughFriends?friends.length:opts.showNum,docFrag=[],showList=[],numShown=0;if(notEnoughFriends){for(var i=0;i<numFriends;i++){showList.push(friends[i])}}else{while(showList.length<visibleCount){var randomShow=Math.floor(Math.random()*numFriends);if(!$.inArray(randomShow,showList)>-1){showList.push(randomShow)}}}$.each(friends,function(i,el){var isVisible=($.inArray(i,showList)>-1),visibleClass=isVisible?(numShown===visibleCount-1?"visible showing finalFriend":"visible showing"):"",imgSrcString=isVisible?"src":"data-src";var friend=['<div class="fbFriend wrap ',visibleClass,'">',"<img ",imgSrcString,'="http://graph.facebook.com/',el.id,'/picture"/>','<div class="fbLinks">',"<strong>",el.name,"</strong>",'<a href="https://graph.facebook.com/',el.id,'/feed" data-friendName="',el.name,'" data-fbFriendId="',el.id,'" class="shareWallPost">',Meetup.Copy.BD.facebook.inviteThem,"&rarr;","</a>","</div>","</div>"];docFrag.push(friend.join(""));if(visibleClass!==""){numShown++}});return docFrag.join("")}var html=buildList(opts);if(opts.callback){opts.callback.call(this,html)}else{return html}}};api.wallPost=function(e,args){e.preventDefault();var targ=$(e.target),formattedChapterName=!!BD.chapter?[BD.chapter.name,BD.birddog.name].join(" "):"",options={picture:"http://img1.meetupstatic.com/892670376411449149876/img/header/logo.png",to:targ.attr("data-fbFriendId"),from:BD.fbUserId};if(BD.event){if(BD.userIsRsvpd||BD.event.isRemoteRSVP){options.message=CopyBD.goingToMeetupWithCommunity.replace("__BDCHAPTER__",formattedChapterName);options.trackingCode="BDFR"}else{options.message=CopyBD.checkOutMeetupWithCommunity.replace("__BDCHAPTER__",formattedChapterName);options.trackingCode="BDFE"}options.name=BD.event.shortDescr;options.link=BD.event.url;options.caption=BD.event.formattedDate;options.description=BD.event.descr}else{if(BD.chapter){options.message=CopyBD.checkOutTheBDNameCommunity.replace("__BDNAME__",formattedChapterName);options.trackingCode="BDFC";options.name=CopyBD.theBDNameCommunity.replace("__BDNAME__",formattedChapterName);options.link=BD.chapter.url;options.caption=CopyBD.localCommunity;options.description=CopyBD.meetOtherLocalMembers.replace("__BDWHO__",BD.birddog.who).replace("__BDCHAPTER__",BD.chapter.formattedLocation)}else{options.message=CopyBD.meetupsHappeningEverywhere.replace("__BDNAME__",BD.birddog.name);options.trackingCode="BDFI";options.name=[BD.birddog.name,Meetup.Copy.BD.meetupsEverywhere].join(" ");options.link=BD.stripQueryStringAndHash();options.caption=CopyBD.localCommunity;options.description=Meetup.Copy.BD.findNearestMeetup.replace("__BDNAME__",BD.birddog.name)}}if(args){options=$.extend(options,args)}var fbShareParam=options.trackingCode==="BDFR"?"facebook_share_RSVP=1":"facebook_share=1",urlToShorten=[options.link,fbShareParam].join("?");BD.createShortUrl(urlToShorten,options.trackingCode,"BDFB",function(response){FB.ui({method:"feed",name:options.name,link:response,picture:options.picture,caption:options.caption,description:options.description,message:options.message,to:options.to,from:options.from},function(response){if(response&&response.post_id){var fbFriend=targ.parent().parent();fbFriend.fadeOut("slow",function(){fbFriend.nextAll().not(".visible").eq(0).fadeIn("slow")})}})})};api.filterFriends=function(input,filterTarget){var el=input,target=filterTarget,filter=el.val(),friendItems=target.find(".fbFriend");if(filter!==""){var matches=friendItems.find("strong:Contains("+filter+")").parent().parent(),unloaded=$.grep(matches.find("img[data-src]"),function(n,i){return(n.src==="")});matches=matches.slice(0,3);friendItems.removeClass("showing");matches.addClass("showing");if(unloaded.length){$(unloaded).lazyImg()}}else{friendItems.removeClass("showing");$(".fbFriend.visible").addClass("showing")}};return api}(jQuery,Meetup.BD,Meetup.Copy.BD));jQuery.expr[":"].Contains=function(a,i,m){return(a.textContent||a.innerText||"").toUpperCase().indexOf(m[3].toUpperCase())>=0};(function($,BD,CopyBD){if(BD.birddog.template!=="birddogCreate"){return}$(function($){var submitHandler=BD.formProcessor(true),facebookHelpDialog=$("#fb-help-dialog");$("#name").bind("keyup",BD.birddogNameInput);$("#urlkey").bind("blur",BD.birddogUrlInput).bind("keyup",function(e){if(e.keyCode!==9){BD.nameChangesUrl=false}});$("#tag").bind("blur",BD.birddogTagInput).bind("keyup",function(e){if(e.keyCode!==9){BD.nameChangesTag=false}});$("#create").bind("submit",submitHandler);$("#link_name").TextInputTip({dontStop:true});$("#ga_code_id").TextInputTip({dontStop:true});$("#who").TextInputTip({dontStop:true});$("#link").blur(function(){var target=$("#yourFavicon"),url=$(this).val().split("/")[0];BD.loadFavicon(target,url)});$("input.useThisFollowLink").change(function(){var $el=$(this),elem=$el.nextAll("div"),inputEls=elem.find("input");if($el.attr("checked")){elem.slideDown();inputEls.removeAttr("disabled")}else{elem.slideUp();inputEls.attr("disabled","disabled")}});$("#use_ga").change(function(){var codeWrap=$("#ga_code_wrap"),input=codeWrap.find("input:first");if($(this).is(":checked")){codeWrap.show("slide",{direction:"up"},200,function(){input.removeAttr("disabled")})}else{codeWrap.hide("slide",{direction:"up"},200,function(){input.attr("disabled","disabled")})}});$("div.textwrap table").click(function(){$(this).find("input:first").focus()});$("textarea.hasMaxLen, input.hasMaxLen").CharCounter();$("#birddog-facebook-help").bind("click",function(e){e.preventDefault();facebookHelpDialog.dialog("open")});facebookHelpDialog.dialog()})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="community"){return}$(function($){var facebookPlz=$("#facebookPlz");$("#getUpdates").find("a.accept").bind("click",BD.forceLogin);$("#joinUsPlz").find("a.accept").bind("click",BD.forceLogin);$("a.forceLogin").bind("click",BD.forceLogin);$("#deleteCommunity").bind("click",deleteCommunityConfirmation);$("#lma-suggest").bind("click",function(e){e.preventDefault();$("#lma-form").trigger("expand").show()});$("#lma").lmaForm();$("#event-list").find("img[data-src]").lazyImg({effect:"fadeIn",effectspeed:"slow"});function deleteCommunityConfirmation(e){e.preventDefault();new BD.steppedDialog([new BD.buildConfirmThis({question:CopyBD.hangOn,explain:CopyBD.community.confirmDelete1,yesLabel:CopyBD.understand,noLabel:CopyBD.nevermind,noFunction:function(){var steppedDialog=$("#steppedDialog");steppedDialog.dialog("close");setTimeout(function(){steppedDialog.remove()},2000)},yesFunction:$.noop}),new BD.buildConfirmThis({question:CopyBD.youSure,explain:CopyBD.community.confirmDelete2,yesLabel:CopyBD.community.yesDeleteIt,noLabel:CopyBD.no,yesFunction:false,yesLoc:this.href})])}$("ul.meetupList").delegate("a.yes","click",BD.rsvp.yesRemote).delegate("a.no","click",BD.rsvp.cancelRemote).delegate("a.noSeeded","click",BD.forceLogin).delegate("a.event-copy","click",function(e){var that=this;BD.forceLogin(e,function(e){e.preventDefault();BD.copyEventConfirmation(that)})})})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="container"){return}$(function($){var meetupList=$("#meetupList"),allLists=$("ul.bdList"),whereIs=$("#whereIs"),whereIsSubmit=$("#whereIsSubmit"),addNewCommunity=$("#addNewCommunity");meetupList.data("birddog",BD.birddog.id);$("#newCommunityField").TextInputTip({dontStop:true});whereIs.data("storedValue",whereIs.val());if(Meetup.BD.seeAll===false){whereIs.geocodeField({minLength:4,onFormSubmit:true,geoCallback:function(result,status){var statuses=google.maps.GeocoderStatus,errorDiv=whereIs.siblings("div.geoError");if(status===statuses.OK&&result.length>0){whereIsSubmit.focus();meetupList.data("city",result[0].address_components[0].long_name).data("lat",result[0].geometry.location.lat()).data("lon",result[0].geometry.location.lng()).data("sort","distance");BD.containerListUpdate();whereIs.data("storedValue",whereIs.val());errorDiv.css({display:"none"})}else{errorDiv.css({display:"block"})}}})}whereIs.bind("focus",function(e){whereIs.data("storedValue",whereIs.val()).val("")});whereIs.bind("blur",function(e){if(whereIs.val()==""){whereIs.val(whereIs.data("storedValue"))}});meetupList.delegate("li.showSubList","click",function(){$(this).slideUp("fast");meetupList.find("li.subList").slideDown("fast",function(){$("#newCommunityTrigger").css({display:"block"})})});allLists.delegate(".clickable","click",function(e){var self=$(this),href=self.attr("href");window.location.href=href}).find("span.helperPhoto").birddogAvatarOverlays(false,{leftOffset:-8,topOffset:-8});addNewCommunity.delegate("form","submit",BD.formProcessor(false,function(e){e.preventDefault();var that=this,$this=$(this),newCommunityField=$("#newCommunityField"),isEmpty=newCommunityField.val().replace(/[\W]/g,"")==="",isDefault=newCommunityField.val().toLowerCase()===newCommunityField[0].title.toLowerCase(),errorTarget=$this.children("label"),errorType,errorMessage,errorRemoveHandler,confirmCopy;if(isEmpty||isDefault){if(isDefault){errorType="default";errorMessage=CopyBD.community.errorDefaultName}else{errorType="empty";errorMessage=CopyBD.community.errorInvalidName}errorRemoveHandler=function(e){BD.removeError(errorTarget,errorType,"siblings");newCommunityField.unbind("keyup change",errorRemoveHandler)};BD.createError(errorTarget,errorType,errorMessage,"after");newCommunityField.bind("keyup change",errorRemoveHandler);this.hasBeenSubmitted=false}else{confirmCopy=CopyBD.confirmChapterCreate.replace(/__WHERE__/g,$("#newCommunityPlace").text());BD.confirmThis(this,{explain:confirmCopy,noFunction:function(){that.hasBeenSubmitted=false;$("#steppedDialog").trigger("advance")},yesFunction:function(){if(Member.id===0){BD.signupLogin("paneLogin","paneSignup",that)}else{window.location=[that.action,$this.serialize()].join("?")}}})}})).delegate("a.cancelAddCommunity","click",function(e){e.preventDefault();var field=$("#newCommunityField");field.val(field.attr("title")).addClass("ghost");$("#newCommunityForm").slideUp("fast");$("#newCommunityTrigger").slideDown("fast")});$("#newCommunityTrigger").live("click",function(e){$(this).slideUp("fast");$("#newCommunityForm").slideDown("fast")})});$(window).bind("load",function(){var map=new L.Map("birddogMap");var osmUrl=BD.osmUrl,osmLayer=new L.TileLayer(osmUrl,{maxZoom:3,attributionControl:false});var center=new L.LatLng(25,0);map.setView(center,1).addLayer(osmLayer);for(var i=0;i<BD.mapPoints.length;i++){i;var point=BD.mapPoints[i];var latlng=new L.LatLng(point.latitude,point.longitude);var marker=new L.Marker(latlng);map.addLayer(marker)}})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="eventCreate"){return}$(function($){var createForm=$("#create"),shortDescription=$("#_short_description"),longDescription=$("#_description"),venueName=$("#venueName"),venueAddress=$("#venueAddress"),venueConfirm=$("#venueConfirm"),venueMap=$("#venueMap"),submitHandler=BD.formProcessor(true),geocodeTimer,street=$("#street"),postalCode=$("#postal_code"),city=$("#city"),theState=$("#the_state"),country=$("#country"),lat=$("#lat"),lng=$("#lng");function _updateVenue(){var response=BD.venueLocator.geocoded[0],center=[response.lat,response.lng].join(","),mapString=["http://maps.google.com/maps/api/staticmap?center=",center,"&zoom=15&size=115x100&maptype=roadmap&markers=color:red|label:M|",center,"&sensor=false"].join("");venueMap.css({"background-image":"url("+mapString+")"});venueAddress.val(response.address);street.val(response.street_address);postalCode.val(response.postal_code);city.val(response.city);theState.val(response.region);country.val(response.country);lat.val(response.lat);lng.val(response.lng)}createForm.bind("submit",submitHandler);shortDescription.CharCounter();longDescription.CharCounter();venueAddress.bind("keyup",function(){var self=$(this);if(self.value!==""){clearTimeout(geocodeTimer);geocodeTimer=setTimeout(function(){BD.venueLocator.geocode({address:venueName.val()+" "+venueAddress.val(),callback:function(){_updateVenue()}})},700)}});$("input.useThisFollowLink").bind("change",function(){var elId=this.id.split("_")[1],elem=$("#"+elId+"_url"),inputEls=elem.find("input");if($(this).attr("checked")){elem.show("slide",{direction:"up"},200,function(){inputEls.each(function(){signal(this,"retip")})});inputEls.removeAttr("disabled")}else{elem.hide("slide",{direction:"up"},200,function(){inputEls.each(function(){signal(this,"retip")})});inputEls.attr("disabled","disabled")}});if(BD.editing){var editedItem=$("#"+BD.editField);if(editedItem.length){$("html,body").animate({scrollTop:editedItem.offset().top-100},500)}}})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="eventHome"){return}$(function($){var commentsList=$("#comments-list"),rsvpList=$("#rsvpList"),rsvpAction=$("#rsvpActionWrap"),whosComing=$("#whosComing"),hostInfoPrompt=$("#hostInfoPrompt"),eventHead=$("#birddogEventHead"),thread,hostInfo,hostInfoClose;BD.inlineEditors.init();if(BD.thread){thread=$("#comment"+BD.thread);if(thread){$.scrollTo(thread)}}$("#getUpdates").find("a.accept").bind("click",BD.forceLogin);$("#comment-form").bind("submit",BD.comments.comment);$("#seeAllLink").bind("click",function(e){e.preventDefault();Meetup.BD.seeMore("rsvpList",{contentKey:2,allKey:"all_rsvps",url:Meetup.BD.event.url,args:{event:Meetup.BD.event.id}})});$("#commentInputText").TextInputTip({dontStop:true}).CharCounter();commentsList.find("textarea").CharCounter();$("#commentInputText").bind("keyup blur",BD.comments.checkErrors);commentsList.delegate("form","submit",BD.comments.reply).delegate("a.replyToggle","click",BD.comments.toggleReplyListHandler).delegate("a.removeComment","click",BD.comments.removeComment).delegate("a.removeReply","click",BD.comments.removeReply).delegate("div.actions","mouseenter click",BD.iconTrays.show).delegate("div.actions","mouseleave",BD.iconTrays.hide).delegate("textarea","keyup blur",BD.comments.checkErrors).delegate(".textwrap","click",function(){$(this).find("textarea").focus()}).find("form").collapsable().find("textarea").TextInputTip({dontStop:true});$("#commentInputText").bind("focus",function(){$("#comment-form").removeClass("shortify")}).bind("blur",function(){if(this.value===this.title){$("#comment-form").addClass("shortify")}});if(!BD.isFbApp){commentsList.find("img[data-src]").lazyImg({effect:"fadeIn",effectspeed:"slow"})}$("div.contents").each(function(i,el){$(el).embedly({maxWidth:300,method:"afterParent"})});whosComing.delegate("li","mouseenter",BD.iconTrays.show).delegate("div.actions","click",BD.iconTrays.show).delegate("li","mouseleave",BD.iconTrays.hide);if(!BD.isFbApp){BD.rsvp.rsvpFormInit()}else{whosComing.delegate(".rsvpYes","click",BD.rsvp.yesFormFacebook)}if(!BD.isFbApp){rsvpAction.delegate("a.remove","click",BD.rsvp.remove).delegate("a.no","click",BD.rsvp.cancelRemote)}else{rsvpAction.delegate("a.remove","click",function(e){e.preventDefault();var $this=$(this);$this.parent("form").submit()})}if(!BD.isFbApp){rsvpList.delegate("a.remove","click",BD.rsvp.remove).find("img[data-src]").lazyImg({effect:"fadeIn",effectspeed:500,threshold:300})}if(hostInfoPrompt.length){hostInfo=$("#hostInfo");hostInfoClose=$("#hostInfoClose");hostInfoPrompt.bind("click",function(){hostInfoPrompt.slideUp();hostInfo.slideDown()});hostInfoClose.bind("click",function(){hostInfoPrompt.slideDown();hostInfo.slideUp()})}$("#eventIsPast").delegate("a.copy-event","click",function(e){var that=this;BD.forceLogin(e,function(e){e.preventDefault();BD.copyEventConfirmation(that)})});eventHead.delegate(".cancel-event","click",function(e){e.preventDefault();BD.confirmThis(this,{explain:CopyBD.event.confirmCancel})});if(typeof(rsvpAfterLogin)!=="undefined"&&rsvpAfterLogin&&BD.isFbApp){var yesRsvp=$(".rsvpYes");if(yesRsvp.length){$(".rsvpYes").trigger("click")}}})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){$(function($){var $broadcastForm=$("#broadcastForm"),fbFriendInvite=$("#inviteFromFacebook");if($broadcastForm.length){$broadcastForm.dialog({resizable:false,draggable:false,modal:true,autoOpen:false,closeText:"x",zIndex:4503,width:500});$("#broadcastLink").bind("click",function(e){e.preventDefault();$broadcastForm.dialog("open")});if(jQueryOnly){$("#broadcastBody").CharCounter()}else{Meetup.DomDeco.applyById("broadcastBody",Meetup.DomDeco.CharCounter)}}if(BD.birddog.template!=="container"||BD.seeAll===true){var whereIsForm=$("#sortListForm"),whereIsField=$("#whereIs");whereIsField.TextInputTip({dontSubmit:true}).geocodeField({minLength:4,onFormSubmit:true,geoCallback:function(result,status){var latitude,longitude,city,errorDiv=whereIsForm.find("div.geoError"),statuses=google.maps.GeocoderStatus,errorTypes=[statuses.ERROR,statuses.INVALID_REQUEST,statuses.UNKNOWN_ERROR,statuses.ZERO_RESULTS];if(status===statuses.OK&&result.length===1){latitude=result[0].geometry.location.lat();longitude=result[0].geometry.location.lng();city=result[0].address_components[0].long_name;$("#whereIsCity").val(city);$("#whereIsLat").val(latitude);$("#whereIsLon").val(longitude);errorDiv.css({display:"none"});whereIsForm.unbind("submit").submit()}else{if(result.length>1||$.inArray(status,errorTypes)!==-1){errorDiv.css({display:"block"})}}}});$("#communityMembers").birddogAvatarOverlays("li",{leftOffset:-8,topOffset:-8})}if(fbFriendInvite.length){$(window).bind("fbFriendsLoaded",function(){BD.facebookInviter.buildFriendList({callback:function(friendList){var fbFilter=$("#filterFbFriends");fbFriendInvite.append(friendList);fbFilter.bind("keyup",function(e){Meetup.BD.facebookInviter.filterFriends.call(this,fbFilter,fbFriendInvite)}).TextInputTip();fbFriendInvite.delegate(".shareWallPost","click",function(e){Meetup.pageTracker._trackPageview(Meetup.pageName+"_>_facebook_share");BD.facebookInviter.wallPost.call(this,e)})}})});$("#fbInviteFilter").live("keyup",function(e){var el=$(e.target);BD.facebookInviter.filterFriends.call(this,el,el.parent().parent())});$(".ui-dialog-content .shareWallPost").live("click",function(e){Meetup.pageTracker._trackPageview(Meetup.pageName+"_>_facebook_share_RSVP");BD.facebookInviter.wallPost.call(this,e)})}})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="ideas_list"){return}$(function($){var mediaBox=$("#eventExternalMedia"),mList=$("#seededMeetupList");if(mList.length&&!BD.isFbApp){$("span.helperPhoto").birddogAvatarOverlays(false,{leftOffset:-8,topOffset:-8})}else{if(mediaBox.length){mediaBox.embedly({maxWidth:200,maxHeight:138,wrapElement:"div",className:"embeddedContent",method:"replace"})}}if(!BD.isFbApp){$("#twitterFeed").twitterFeed()}})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="ideas"&&!BD.isFbApp){return}$(function($){if(!BD.canManage){return}var $seedLists=$("ul.seed-list"),$seedCommentLists=$seedLists.find("div.seededComments"),$broadcastForm=$("#broadcastForm");function seedEmail(e){if(e&&e.preventDefault){e.preventDefault()}var seedId=$(this).data("seed-id");$("#emailSeedId").val(seedId);BD.showDialogAndPosition(e,$broadcastForm)}function seedDelete(e){if(e&&e.preventDefault){e.preventDefault()}new BD.steppedDialog([new BD.buildConfirmThis({question:CopyBD.hangOn,explain:CopyBD.seed.confirmDelete1,yesLabel:CopyBD.understand,noLabel:CopyBD.nevermind,noFunction:function(){var steppedDialog=$("#steppedDialog");steppedDialog.dialog("close");setTimeout(function(){steppedDialog.remove()},2000)},yesFunction:$.noop}),new BD.buildConfirmThis({question:CopyBD.youSure,explain:CopyBD.seed.confirmDelete2,yesLabel:CopyBD.seed.yesDeleteIt,noLabel:CopyBD.no,yesFunction:false,yesLoc:this.href})])}formValidate=function(){var required=$form.find("input.required-field, select.required-field, textarea.required-field"),filledIn=$.grep(required,function(el){return(el.value!=="")});return filledIn.length>=required.length};function seedAnnounce(e){if(e&&e.preventDefault){e.preventDefault()}BD.confirmThis(this,{explain:CopyBD.seed.announceConfirm})}BD.seedForm.init();BD.seedComments.init();$seedLists.delegate("a.seed-comment","click",BD.seedComments.create).delegate("a.seed-email","click",seedEmail).delegate("a.seed-edit","click",BD.seedInline.edit).delegate("a.seed-edit-cancel","click",BD.seedInline.cancel).delegate("a.seed-delete","click",seedDelete).delegate("a.seed-announce","click",seedAnnounce).delegate("form","submit",BD.seedInline.save);$(document.body).delegate("a.seed-wall-post","click",function(e){e.preventDefault();var that=$(this),eventLink=that.data("eventlink"),eventName=that.data("eventname"),eventDescr=that.data("eventdescr"),eventTime=that.data("eventdatetime"),pageLink=BD.fbPageLink.indexOf("facebook.com")>-1?BD.fbPageLink:["http://www.facebook.com/",BD.fbPageLink].join(""),fullLink=[pageLink,"?sk=app_",BD.fbAppId].join("");FB.ui({display:"popup",method:"stream.publish",to:BD.fbPageId,from:BD.fbPageId,message:'Announcing "'+eventName+'" on '+eventTime+"! RSVP to meet face-to-face with other fans in your city! "+eventLink,attachment:{media:[{type:"image",src:"http://www.meetup.com/fb/img/partnerwall/fbwall_button.png",href:fullLink}],href:fullLink,name:eventName,caption:eventTime,description:eventDescr,callback:function(response){}}})});$seedCommentLists.delegate("a.delete","click",BD.seedComments.deleteComment).delegate("a.toggler","click",BD.seedComments.toggleReplies);$broadcastForm.dialog({width:(BD.isFbApp?"400":"500")});$broadcastForm.find("form").submit(function(e){var $subject=$("#broadcastSubject"),subject=$.trim($subject.val()),subject_too_short=subject.length===0,subject_too_long=subject.length>$subject.data("max-chars"),$subjwrapper=$subject.parents(".input"),subjHasError=$subjwrapper.find("ERR"),$emailbody=$("#broadcastBody"),bodymsg=$.trim($emailbody.val()),body_too_short=bodymsg.length===0,body_too_long=bodymsg.length>$emailbody.data("max-chars"),$emailbodywrapper=$emailbody.parents(".input"),bodyHasError=$emailbodywrapper.find("ERR");BD.removeError($subjwrapper,"","find","hide");BD.removeError($emailbodywrapper,"","find","hide");if(!subject_too_short&&!subject_too_long&&!body_too_short&&!body_too_long){return true}else{if(!subject_too_short&&!subject_too_long){BD.removeError($subjwrapper,"")}else{if(subjHasError.length===0){if(subject_too_short){BD.createError($subjwrapper,"",Meetup.Copy.subjectTooShort)}else{if(subject_too_long){BD.createError($subjwrapper,"",Meetup.Copy.subjectTooLong)}}}}if(!body_too_short&&!body_too_long){BD.removeError($subjwrapper,"");BD.removeError($emailbodywrapper,"");$broadcastForm.submit()}else{if(bodyHasError.length===0){if(body_too_short){BD.createError($emailbodywrapper,"",Meetup.Copy.bodyTooShort)}else{if(body_too_long){BD.createError($emailbodywrapper,"",Meetup.Copy.bodyTooLong)}}}}return false}});if(Member.id===0&&BD.isFbApp&&BD.fbPageId===""&&$("#page_id").length){setTimeout(function(){Meetup.FB.returnUri=encodeURIComponent(window.location.href+"?page_id="+$("#page_id").val());BD.forceLogin.call(this,null)},150)}})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="splash"){return}$(function($){$("#faqTrigger > a").bind("click",function(e){e.preventDefault();var self=$(this).parent();self.siblings(".faq").slideDown("fast");self.slideUp("slow")})})}(jQuery,Meetup.BD,Meetup.Copy.BD));(function($,BD,CopyBD){if(BD.birddog.template!=="widgets"){return}$(function($){var dialog,tpl=Meetup.BD.templates.widgets_page,styleToggleSelect=$("#styleToggler"),widgetsLists=$("#birddogBody ul.widgetsList"),widgetsListForms=widgetsLists.find("form");function previewWidget(e){e.preventDefault();var self=$(this),form=self.closest("form"),view=getUrlParams(form),code=$.mustache(tpl[form.data("template")],view),width=form.find("input.widgetWidth").val();if(typeof dialog!=="undefined"){dialog.dialog("destroy")}dialog=$("<div>"+code+"</div>").dialog({autoOpen:true,dialogClass:styleToggleSelect.val()==="dark"?"ui-widget-preview ui-widget-preview-dark":"ui-widget-preview",resizable:false,width:parseInt(width,10),beforeClose:function(e,ui){$(this).remove()}})}function accordionEmbedCodes(e){e.preventDefault();var self=$(this);self.closest("form").find("div.text:first").slideToggle();self.toggleText()}function toggleCustomCssField(e){e.preventDefault();var self=$(this),showing=!self.hasClass("shown");if(showing){self.addClass("shown")}self.siblings("div.customCss:first").slideToggle(500,function(){if(!showing){self.removeClass("shown")}})}function getUrlParams(form,manual){manual=typeof manual==="object"?manual:{};var width=manual.width||getWidgetWidth(form),height=form.data("template")==="closest_event_list"?"320":(manual.height||getWidgetHeight(form,width));return{urlkey:Meetup.BD.birddog.urlname,css:manual.css||getWidgetCss(form),width:width,height:height,style:manual.style||styleToggleSelect.val(),theme:manual.theme||getUseTheme(form)}}function updateSingle(form,manual){manual=typeof manual==="object"?manual:{};var view=getUrlParams(form,manual),code=$.mustache(tpl[form.data("template")],view);form.find("textarea:first").val(code)}function updateAll(e){if(e&&e.preventDefault){e.preventDefault()}var style=styleToggleSelect.val();if(style==="dark"){widgetsLists.find("span.thumb").addClass("thumbDark")}else{widgetsLists.find("span.thumb").removeClass("thumbDark")}widgetsListForms.each(function(){var form=$(this);checkMinWidth(form);updateSingle(form,{S:style})})}function getWidgetWidth(form){return parseInt(form.find("input.widgetWidth:first").val(),10)}function getWidgetHeight(form,width){var height,scale="normal",map=form.data("height-map");if(map){width=width||getWidgetWidth(form);if(width<=500){scale=(width<=300)?"small":"medium"}height=map[scale]}return height}function getWidgetCss(form){return escape(form.find("input.widgetCss:first").val())}function getUseTheme(form){return form.find("input.useTheme:checked").length?"&usetheme=1":""}function checkMinWidth(form,width){width=width||getWidgetWidth(form);var minPixels,html,pixels=form.find("div.pixels"),min=form.data("min-width");form.find("div.pixels label.warning").remove();if(width<min){minPixels=CopyBD.widgets.recommendMinimumPixels.replace("__NUM__",min,"g");pixels.append($.mustache('<label class="warning" for="{{forId}}">{{min}}</label>',{forId:pixels.find("input")[0].id,min:minPixels}))}}function updateWidgetWidth(e){var blurType="focusout",that=$(this),form=that.closest("form"),min=form.data("min-width"),width=getWidgetWidth(form);if(e&&e.preventDefault){e.preventDefault()}if(e.type===blurType&&isNaN(width)){width=this.value=that.data("default")}if(!isNaN(width)){if(e.type===blurType){checkMinWidth(form,width)}updateSingle(form,{width:width,height:getWidgetHeight(form,width)})}}function updateWidgetCss(e){e.preventDefault();var form=$(this).closest("form");updateSingle(form,{css:getWidgetCss(form)})}function updateUseTheme(e){var form=$(this).closest("form");updateSingle(form,{theme:getUseTheme(form)})}$("#styleToggle").stickToTop();styleToggleSelect.bind("change",updateAll);widgetsListForms.delegate("input.preview","click",previewWidget).delegate("input.getCode","click",accordionEmbedCodes).delegate("input.widgetWidth","keyup blur",updateWidgetWidth).delegate("input.useTheme","click",updateUseTheme).delegate("a.showCustom","click",toggleCustomCssField).delegate("input.widgetCss","keyup blur",updateWidgetCss);updateAll()})}(jQuery,Meetup.BD,Meetup.Copy.BD));
