
/* --- URL 0: http://www.allforgood.org/zxrelease-1-9-r333.339750352312541358/js/snippets_list.js [FETCH=226ms] --- */
function shareEvent(div,eventUrl,eventTitle,eventSnippet){google.friendconnect.requestInvite(document.userDisplayName+" wants you to check out this event! "
+eventTitle+" "+eventUrl);}
function formatAsTwoDigits(n){return((n<10)?'0':'')+n;}
function formatDateAsUtc(date){var buffer=[];buffer.push(date.getUTCFullYear());buffer.push(formatAsTwoDigits(date.getUTCMonth()+1));buffer.push(formatAsTwoDigits(date.getUTCDate()));buffer.push('T');buffer.push(formatAsTwoDigits(date.getUTCHours()));buffer.push(formatAsTwoDigits(date.getUTCMinutes()));buffer.push(formatAsTwoDigits(date.getUTCSeconds()));buffer.push('Z');return buffer.join('');};function durationForYahooCalendar(duration){function div(numerator,denumerator){return numerator/denumerator-numerator%denumerator/denumerator;}
var durationInMinutes=div(duration,1000*60);var durationInHours=div(durationInMinutes,60);if(durationInHours>=12){return'0030';}else{return formatAsTwoDigits(durationInHours)+
formatAsTwoDigits(durationInMinutes%60);}}
function datesForGoogleCalendar(startdate,duration){var enddate=new Date(startdate.getTime()+duration);return formatDateAsUtc(startdate)+"/"+formatDateAsUtc(enddate);}
function addToCalendar(div,type,searchResult){var duration=searchResult.enddate.getTime()-
searchResult.startdate.getTime();if(duration>12*60*60*1000){duration=30*60*1000;}
var url;if(type=='GOOGLE'){url="http://www.google.com/calendar/event?action=TEMPLATE"
+"&text="+searchResult.title
+"&dates="+datesForGoogleCalendar(searchResult.startdate,duration)
+"&details="+searchResult.snippet+"+"+searchResult.url
+"&location="+searchResult.location;}else if(type=='YAHOO'){url="http://calendar.yahoo.com?v=60"
+"&ST="+formatDateAsUtc(searchResult.startdate)
+"&TITLE="+searchResult.title
+"&DUR="+durationForYahooCalendar(duration)
+"&VIEW=d"
+"&DESC="+searchResult.snippet
+"&in_loc="+searchResult.location;}
window.open(url,'calendar');}
function toggleInterest(resultIndex){var result=searchResults[resultIndex];var div=el('like_'+resultIndex);var newInterest=result.liked?0:1;var path='/action?type=star'+'&i='+newInterest+'&oid='+escape(result.itemId)+'&base_url='+escape(result.baseUrl)+'&zx='+Math.random();var success=function(data,textStatus){result.liked=newInterest;div.style.display=result.liked?'none':'';if(result.liked){createLikesActivity(result.title,result.hostWebsite,result.url,result.url_sig);result.totalInterestCount+=1}else{result.totalInterestCount-=1}
updateInterestInfoDisplay(resultIndex,true);};var error=function(xhr,textStatus,errorThrown){if(xhr.status==401){$('#pleaselogin').modal({close:false,position:["20%",],overlayId:'modal_overlay',containerId:'modal_container',onShow:function(dialog){dialog.data.find('.ok').click(function(){$.modal.close();});}});}else if(xhr.status==400){}};jQuery.ajax({type:'POST',url:path,async:true,dataType:'text',data:{},error:error,success:success});}
function updateInterestInfoDisplay(resultIndex){var result=searchResults[resultIndex];var html='';var nameList=[];if(result.liked){nameList.push('You');}
var friends=friendsByEventId[result.itemId]||[];for(var i=0;i<friends.length;i++){var friendId=friends[i];var info=friendsInfo[friendId];if(info){nameList.push(info.name);}}
var youAndFriendsCount=(friends?friends.length:0)+(result.liked?1:0);var strangerInterestCount=Math.max(result.totalInterestCount-youAndFriendsCount,0);if(strangerInterestCount==1){nameList.push('1 other');}else if(strangerInterestCount>1){nameList.push(strangerInterestCount+' others');}
if(nameList.length>0){html+='<img class="like_icon" src="/zx0000/images/like_default.png">&nbsp;';html+=nameList[0];for(var i=1;i<nameList.length-1;i++){html+=', ';html+=nameList[i];}
if(nameList.length>1){html+=' and ';html+=nameList[nameList.length-1];}
if((result.totalInterestCount==1)&&(!result.liked)){html+=' likes this';}else{html+=' like this';}}
if(result.liked){html+=' <span class="undo">('+'<a href="javascript:toggleInterest('+resultIndex+');void(0);">undo</a>)</span>';}
var div=el('interest_info_'+resultIndex);div.innerHTML=html;div.style.display=html.length?'':'none';}

/* --- URL 1: http://www.allforgood.org/zxrelease-1-9-r333.339750352312541358/js/map.js [FETCH=153ms] --- */
SimpleMap=function(div){if(!GBrowserIsCompatible()){return;}
this.div_=div;this.defaultZoom_=10;this.map=new GMap2(div);this.bounds_=null;var lat=40,lon=-100,zoom=3;try{lat=google.loader.ClientLocation.latitude;lon=google.loader.ClientLocation.longitude;zoom=this.defaultZoom_;}catch(err){}
this.map.setCenter(new GLatLng(lat,lon),zoom);this.map.enableContinuousZoom();this.geocoder_=new GClientGeocoder();this.map.addControl(new GSmallZoomControl());var icon=new GIcon();icon.image='http://www.google.com/mapfiles/marker_midblue.png';icon.shadow='http://www.google.com/mapfiles/shadow-mid.png';icon.iconSize=new GSize(16,27);icon.shadowSize=new GSize(16,28);icon.iconAnchor=new GPoint(8,27);icon.infoWindowAnchor=new GPoint(5,1);this.defaultIcon_=icon;};SimpleMap.prototype.setCenter=function(latLng){if(!GBrowserIsCompatible()){return;}
this.map.setCenter(latLng,this.defaultZoom_);};SimpleMap.prototype.setCenterGeocode=function(locationString){if(!locationString||!GBrowserIsCompatible()){return;}
var me=this;this.geocoder_.getLatLng(locationString,function(latLng){if(latLng){me.setCenter(latLng);}});};SimpleMap.prototype.addMarker=function(lat,lng,opt_suffix){if(!GBrowserIsCompatible()){return;}
var latLng=new GLatLng(Number(lat),Number(lng));var url='http://www.google.com/mapfiles/marker_midblue'+
[opt_suffix===undefined?'':opt_suffix]+'.png';this.map.addOverlay(new GMarker(latLng,new GIcon(this.defaultIcon_,url)));var markerBounds=SimpleMap.convertLatLngToBounds(latLng,0.1);if(this.bounds_===null){this.bounds_=markerBounds;}else{this.bounds_.extend(markerBounds.getSouthWest());this.bounds_.extend(markerBounds.getNorthEast());}};SimpleMap.prototype.clearMarkers=function(){this.map.clearOverlays();this.bounds_=null;};SimpleMap.prototype.autoZoomAndCenter=function(location){if(this.bounds_===null){this.setCenterGeocode(location);}else{var zoom=this.map.getBoundsZoomLevel(this.bounds_);this.map.setCenter(this.bounds_.getCenter(),zoom);}};SimpleMap.convertLatLngToBounds=function(latLng,padding){var north=latLng.lat()+padding;var south=latLng.lat()-padding;var west=latLng.lng()-padding;var east=latLng.lng()+padding;return new GLatLngBounds(new GLatLng(south,west),new GLatLng(north,east));};SimpleMap.prototype.addMarkerGeocode=function(locationString){if(!GBrowserIsCompatible()){return;}
var me=this;this.geocoder_.getLatLng(locationString,function(latLng){if(latLng){me.addMarker(latLng.lat(),latLng.lng());}});};SimpleMap.prototype.geocode=function(locationString,callback){if(!GBrowserIsCompatible()){return;}
var me=this;this.geocoder_.getLatLng(locationString,function(latLng){callback(latLng,0);});};

/* --- URL 2: http://www.allforgood.org/zxrelease-1-9-r333.339750352312541358/js/search_results.js [FETCH=274ms] --- */
var map;var NUM_PER_PAGE=10;var searchResults=[];var filters=[];var loadNumber=0;$(document).ready(function(){$.collapsible(".search-refine .header");var index=getSelectedTab();$("#tabs").tabs({select:function(event,ui){submitForm('oppType',ui.index);},selected:index,collapsible:true});$("#startdate").datepicker({minDate:new Date(),onSelect:function(dateText,inst){$("#enddate").datepicker("option","minDate",dateText);}});$("#enddate").datepicker({minDate:new Date()});$("#location_slider").slider({value:getHashParam('distance','')||25,min:5,max:100,step:5,slide:function(event,ui){$("#location_distance").html(ui.value);},stop:function(event,ui){submitForm("reset");}});$("#location_distance").html($("#location_slider").slider("value"));$("#submit-btn").click(function(){submitForm("reset");return false;});$("#location").keypress(function(e){code=(e.keyCode?e.keyCode:e.which);if(code==13){submitForm("reset");return false;}});var start=getHashParam('timeperiodstart','');var end=getHashParam('timeperiodend','');if(start!="everything"){getInputFieldValue(el('startdate')).value=start;}
if(end!="everything"){getInputFieldValue(el('enddate')).value=end;}
$("#facets_container").hide();});function getSelectedTab(){var type=getHashParam('type','');var index=0;if(type=="statewide")
index=1;else if(type=="virtual")
index=2;else if(type=="micro")
index=3;else if(type=="self_directed")
index=4;else
index=0;return index;}
function hideShowCategories(value,load){if(load==null){load=true;}
if(value&&value!=""){toggleFacetDisplay("category_list",value);$.cookie($(".search-refine .header").prev().attr("id"),'hide');populateActiveFacets();$("#category_item").html("<li>"+value+" (<a href=\"javascript:hideShowCategories()\">undo</a>)</li>");}else{toggleFacetDisplay("category_list");$.cookie($(".search-refine .header").prev().attr("id"),'show');$("#category_item").html("");$("#category_input").val("");populateActiveFacets();if(load)submitForm("facet");}}
function hideShowProviders(value,load){if(load==null){load=true;}
if(value&&value!=""){toggleFacetDisplay("provider_list",value);populateActiveFacets();$("#provider_item").html("<li>"+value+" (<a href=\"javascript:hideShowProviders()\">undo</a>)</li>");}else{toggleFacetDisplay("provider_list");$("#provider_item").html("");$("#provider_input").val("");populateActiveFacets();if(load)submitForm("facet");}}
function toggleFacetDisplay(id,value){$("#"+id+" li").each(function(){var item=$(this);if(value){item.hide();}else{item.show();}});if(value){if(id.indexOf("provider_list")>-1){var active=$("#active_prov");active.html("");active.html(value+" (<a href=\"javascript:hideShowProviders()\">undo</a>)");active.show();}else{var active=$("#active_cat");active.html("");active.html(value+" (<a href=\"javascript:hideShowCategories()\">undo</a>)");active.show();}}}
function removeKeyword(){setInputFieldValue(el('keywords'),"");submitForm("reset");}
function submitKeyword(value){setInputFieldValue(el('keywords'),value);submitForm("reset");}
function Query(keywords,location,distance,type,pageNum,sort,useCache,get_facet_counts,opt_timePeriodStart,opt_timePeriodEnd,opt_filters,category,source){var me=this;me.keywords_=keywords;me.location_=location;me.category_=category||'';me.distance_=distance||'25';me.type_=type||'all';me.source_=source||'';me.pageNum_=pageNum;me.sort_=sort;me.use_cache_=useCache;me.get_facet_counts_=get_facet_counts||true;me.timePeriodStart_=opt_timePeriodStart||'everything';me.timePeriodEnd_=opt_timePeriodEnd||'everything';me.filters_=opt_filters||{};};Query.prototype.clone=function(){var me=this;return jQuery.extend(true,new Query(),me);};Query.prototype.execute=function(){var urlQueryString=this.getUrlQuery();if(urlQueryString.length>0&&urlQueryString!=window.location.hash){dhtmlHistory.add(urlQueryString);setTimeout(executeSearchFromHashParams,dhtmlHistory.getWaitTime()+1);}};Query.prototype.setPageNum=function(pageNum){this.pageNum_=pageNum;};Query.prototype.getPageNum=function(){return this.pageNum_;};Query.prototype.getKeywords=function(){return this.keywords_;};Query.prototype.getFacetCounts=function(){return this.get_facet_counts_;}
Query.prototype.setKeywords=function(keywords){this.keywords_=keywords;};Query.prototype.getLocation=function(){return this.location_;};Query.prototype.setLocation=function(location){this.location_=location;};Query.prototype.setCategory=function(category){this.category_=category;};Query.prototype.getCategory=function(){return this.category_;};Query.prototype.setDistance=function(distance){this.distance_=distance;};Query.prototype.getDistance=function(){return this.distance_;};Query.prototype.setType=function(type){if(type=="1")
this.type_="statewide";else if(type=="2")
this.type_="virtual";else if(type=="3")
this.type_="micro";else if(type=="4")
this.type_="self_directed";else
this.type_="all";};Query.prototype.getType=function(){return this.type_;};Query.prototype.setSource=function(source){this.source_=source;};Query.prototype.getSource=function(){return this.source_;};Query.prototype.setSort=function(sort){this.sort_=sort;};Query.prototype.getSort=function(){return this.sort_;};Query.prototype.getTimePeriodStart=function(){return this.timePeriodStart_;};Query.prototype.setTimePeriodStart=function(period){this.timePeriodStart_=period;};Query.prototype.getTimePeriodEnd=function(){return this.timePeriodEnd_;};Query.prototype.setTimePeriodEnd=function(period){this.timePeriodEnd_=period;};Query.prototype.getFilter=function(name){if(name in this.filters_){return this.filters_[name];}else{return undefined;}}
Query.prototype.setFilter=function(name,value){this.filters_[name]=value;}
Query.prototype.getUrlQuery=function(){var me=this;urlQuery='';var facet_fields_added=0;var facet_queries_added=0;function addQueryParam(name,value){if(urlQuery.length>0){urlQuery+='&';}
urlQuery+=name+'='+escape(value);}
var keywords=me.getKeywords();if(keywords&&keywords.length>0){addQueryParam('q',keywords);}
addQueryParam('num',NUM_PER_PAGE)
addQueryParam('start',me.getPageNum()*NUM_PER_PAGE+1);var location=me.getLocation();if(location&&location.length>0){addQueryParam('vol_loc',location);$.cookie('user_vol_loc',location,{expires:30});}
var distance=me.getDistance();if(distance&&distance.length>0){addQueryParam('distance',distance);}
var type=me.getType();if(type&&type.length>0){addQueryParam('type',type);}
var sort=me.getSort();if(sort&&sort.length>0){addQueryParam('sort',sort);}
var category=me.getCategory();if(category&&category.length>0){addQueryParam('category',category);}
var source=me.getSource();if(source&&source.length>0){addQueryParam('source',source);}
var periodStart=me.getTimePeriodStart();if(periodStart){addQueryParam('timeperiodstart',periodStart)}
var periodEnd=me.getTimePeriodEnd();if(periodEnd){addQueryParam('timeperiodend',periodEnd)}
for(var name in me.filters_){var value=me.getFilter(name);if(value){addQueryParam(name,value);}}
var use_cache=me.getUseCache();addQueryParam('cache',use_cache);return urlQuery;};Query.prototype.getUseCache=function(){return this.use_cache_;};Query.prototype.setUseCache=function(use_cache){this.use_cache_=use_cache;};function createQueryFromUrlParams(){var keywords=getHashParam('q','');var location=getHashParam('vol_loc',getDefaultLocation().displayLong);var category=getHashParam('category','');var distance=getHashParam('distance','');var type=getHashParam('type','');var source=getHashParam('source','');var sort=getHashParam('sort','');var start=Number(getHashParam('start','1'));var timePeriodStart=getHashParam('timeperiodstart');var timePeriodEnd=getHashParam('timeperiodend');var use_cache=Number(getHashParam('cache','1'));var get_facet_counts=getHashParam('facet','true');start=Math.max(start,1);var numPerPage=Number(getHashParam('num',NUM_PER_PAGE));numPerPage=Math.max(numPerPage,1);var pageNum=(start-1)/numPerPage;var filters={};function getNamedFilterFromUrl(name){filters[name]=getHashParam(name,'');}
getNamedFilterFromUrl('bf');getNamedFilterFromUrl('bft');getNamedFilterFromUrl('vol_dist');getNamedFilterFromUrl('vol_startdate');getNamedFilterFromUrl('vol_enddate');getNamedFilterFromUrl('key');return new Query(keywords,location,distance,type,pageNum,sort,use_cache,get_facet_counts,timePeriodStart,timePeriodEnd,filters,category,source);}
function FilterWidget(div,title,entries,initialValue,callback){var me=this;me.div_=div;me.title_=title;me.entries_=entries;me.value_=initialValue;me.callback_=callback;filters.push(me);me.render();}
FilterWidget.prototype.render=function(oldValue){var me=this;oldValue=typeof oldValue==undefined?'':oldValue;var titleDiv=document.createElement('div');var catLink=document.createElement('a');titleDiv.className='filterwidget_title';catLink.innerHTML=me.title_;catLink.href='javascript:void(0)';titleDiv.appendChild(catLink);me.div_.innerHTML='';me.div_.appendChild(titleDiv);var clickCallback=function(index){return function(){var newValue=me.entries_[index][1];me.setValue(newValue);me.callback_(newValue);};}
for(var i=0;i<me.entries_.length;i++){var entryDiv=document.createElement('div');entryDiv.className='filterwidget_entry';me.div_.appendChild(entryDiv);var display=me.entries_[i][0];if(me.entries_[i].length>=3&&me.entries_[i][1]!=oldValue)
{display+=' ('+me.entries_[i][2]+')';}
if(me.entries_[i][1]==me.value_){entryDiv.innerHTML='<b>'+me.entries_[i][0]+'</b>';}else{var link=document.createElement('a');link.innerHTML=display;link.href='javascript:void(0)';link.onclick=clickCallback(i);entryDiv.appendChild(link);}}};FilterWidget.prototype.isDefault=function(){return(this.value_==this.entries_[0][1]);};FilterWidget.prototype.getValue=function(){return this.value_;};FilterWidget.prototype.setValue=function(newValue){var me=this;var oldValue=me.value_;me.value_=newValue;me.render(oldValue);};FilterWidget.prototype.getName=function(){var me=this;for(var i=0;i<me.entries_.length;i++)
{if(me.entries_[i][1]==me.value_)
return me.entries_[i][0];}}
function onLoadSearch(){if(el('location')){setInputFieldValue(el('location'),getHashParam('vol_loc','')||getDefaultLocation().displayLong);}
dhtmlHistory.create({debugMode:false,toJSON:function(o){return $.toJSON(o);},fromJSON:function(s){return $.evalJSON(s);}});dhtmlHistory.initialize();dhtmlHistory.addListener(executeSearchFromHashParams);createQueryFromUrlParams().execute();try{el('more').style.display='';}catch(err){}}
function populateSearchHistory()
{if(el('filter_results'))
{var me=el('filter_results');var titleDiv=document.createElement('div');var catLink=document.createElement('a');titleDiv.className='filterwidget_title';catLink.innerHTML='Search History';catLink.href='javascript:void(0)';titleDiv.appendChild(catLink);me.innerHTML='';me.appendChild(titleDiv);for(var i=0;i<filters.length;i++)
{var filt=filters[i];if(!filt.isDefault())
{var entryDiv=document.createElement('div');entryDiv.className='filterwidget_entry';me.appendChild(entryDiv);var change=document.createElement('b');change.innerHTML=filt.getName()+"&nbsp;&nbsp;&nbsp;";entryDiv.appendChild(change);var link=document.createElement('a');link.innerHTML='(undo)';link.href='javascript:void(0)';link.onclick=filt.setValue(0);entryDiv.appendChild(link);}}}}
executeSearchFromHashParams=function(currentLocation){var currentXhr;var tab_n=1+getSelectedTab();var it=el('tabs-'+tab_n+'-results');if(it){it.innerHTML='<div id="snippets_pane"></div>';}
return function(currentLocation){if(typeof currentLocation=='string'){if(currentLocation.indexOf('timeperiod')==-1&&currentLocation.indexOf('num=')==-1){window.history.go(-1);}}
if(currentXhr){currentXhr.abort();}
var query=createQueryFromUrlParams();el('loading').style.display='';if(el('loading-bottom')){el('loading-bottom').style.display='';}
lastSearchQuery=query;var success=function(text,status){setInputFieldValue(el('keywords'),query.getKeywords());var regexp=new RegExp('[a-zA-Z]')
if(regexp.exec(query.getLocation())){if(el('location')){setInputFieldValue(el('location'),query.getLocation());}}
jQuery('#snippets_pane').html(text);asyncLoadManager.addCallback('map',function(){map.autoZoomAndCenter(query.getLocation());});el('loading').style.display='none';if(el('loading-bottom')){el('loading-bottom').style.display='none';}};var error=function(XMLHttpRequest,textStatus,errorThrown){};var url;if(currentPageName=='SEARCH'){if(typeof campaignId!='undefined'){url='/ui_snippets?campaign_id='+campaignId+'&'}
else{url='/ui_snippets?';}}else if(currentPageName=='MY_EVENTS'){url='/ui_my_snippets?';}
url+=query.getUrlQuery();var location=query.getLocation();if(!location||location.length==0){url+='&vol_loc=USA&vol_dist=12400';}
var referrer=document.referrer;if(referrer){url+='&referrer='+encodeURIComponent(referrer);}
var tab_n=1+getSelectedTab();var it=el('tabs-'+tab_n+'-results');if(it){it.innerHTML='<div id="snippets_pane"><span class="loading">Loading...</span></div>';}
currentXhr=jQuery.ajax({url:url,async:true,dataType:'html',error:error,success:success});jQuery(this).ajaxStop(function(){scroll(0,0);});};}();function getStartDate(){var start=getInputFieldValue(el('startdate')).toString();if(!start||start=="Start Date"){start="";}
return start;}
function getEndDate(){var end=getInputFieldValue(el('enddate')).toString();if(!end||end=="End Date"){end="";}
return end;}
function getCategoryInput(){return $("#category_input").val().toString();}
function getSourceInput(){return $("#provider_input").val().toString();}
function getDistance(){return $("#location_slider").slider("value").toString();}
function submitForm(invoker,value){var keywords=getInputFieldValue(el('keywords'));if(invoker=='category'&&currentPageName!='SEARCH'){window.location='/search#category='+value;return;}
if(invoker=='sort'&&currentPageName!='SEARCH'){window.location='/search#sort='+value;return;}
var location=getInputFieldValue(el('location'));if(location){setSessionCookie('user_vol_loc',location);}
if(invoker=="reset"){loadNumber=0;}
var timePeriodStart=getStartDate();var timePeriodEnd=getEndDate();var distance=getDistance();var sort=getInputFieldValue(el('sort'));if(location==''){location=getDefaultLocation().displayLong;}
var category="";var source="";if((invoker&&invoker!="facet")||!invoker){$("#category_input").val("");$("#provider_input").val("");hideShowCategories("",false,null);hideShowProviders("",false,null);}else{category=getCategoryInput();source=getSourceInput();}
var query=lastSearchQuery.clone();query.setKeywords(keywords);query.setLocation(location);query.setDistance(distance);if(invoker=="oppType"){query.setType(value);var type=query.getType();$(".top_search").show();$("#location_distance_date").show();if(type=="all"||type=="statewide"){$("#location_box").show();$("#map").show();$("#location_distance_date").show();}
else{$("#location_box").hide();$("#map").hide();if(type=="self_directed"){$(".top_search").hide();$("#location_distance_date").hide();}}}
query.setPageNum(0);query.setSort(sort);query.setCategory(category);query.setSource(source);query.setTimePeriodStart(timePeriodStart);query.setTimePeriodEnd(timePeriodEnd);query.execute();}
function showMoreDuplicates(id){var it=document.getElementById(id);if(it){it.style.display='inline';}
it=document.getElementById('s'+id);if(it){it.style.display='none';}}
(function($){$.fn.expand=function(options){var defaults={length:285,minTrail:20,moreText:"[more]",lessText:" [less]",ellipsisText:"... ",moreAni:"",lessAni:""};var options=$.extend(defaults,options);return this.each(function(){obj=$(this);var body=obj.html();if(body.length>options.length+options.minTrail){var splitLocation=body.indexOf(' ',options.length);if(splitLocation!=-1){var splitLocation=body.indexOf(' ',options.length);var str1=body.substring(0,splitLocation);var str2=body.substring(splitLocation,body.length-1);obj.html(str1+'<span class="truncate_ellipsis">'+options.ellipsisText+'</span>'+'<span class="truncate_more">'+str2+'</span>');obj.find('.truncate_more').css("display","none");obj.append('<span class="clearboth">'+'<a href="#" class="truncate_more_link">'+options.moreText+'</a>'+'</span>');var moreLink=$('.truncate_more_link',obj);var moreContent=$('.truncate_more',obj);var ellipsis=$('.truncate_ellipsis',obj);moreLink.click(function(){if(moreLink.text()==options.moreText){moreContent.show(options.moreAni);moreLink.text(options.lessText);ellipsis.css("display","none");}else{moreContent.hide(options.lessAni);moreLink.text(options.moreText);ellipsis.css("display","inline");}
return false;});}}});};})(jQuery);function showLessDuplicates(id){var it=document.getElementById(id);if(it){it.style.display='none';}
it=document.getElementById('s'+id);if(it){it.style.display='inline';}}
function goToPage(pageNum){if(pageNum<0){return;}
if(lastSearchQuery){lastSearchQuery.setPageNum(pageNum);lastSearchQuery.execute();}}
function categorySearch(category){if(category==''){return;}
if(lastSearchQuery){lastSearchQuery.setKeywords("category:"+category);lastSearchQuery.execute();}}
function renderPaginator(div,totalNum,forceShowNextLink){if(!lastSearchQuery||totalNum==0){return;}
var numPages=parseInt(Math.ceil(totalNum/NUM_PER_PAGE));if(numPages==1){return;}
if(numPages>20){numPages=20;}
var html=[];function renderLink(pageNum,text){html.push('<a href="javascript:goToPage(',pageNum,');void(0);">',text,'</a> ');}
var currentPageNum=lastSearchQuery.getPageNum();if(currentPageNum>0){renderLink(currentPageNum-1,'&laquo; Previous Page');}
if(currentPageNum!=numPages-1){html.push('&nbsp;&nbsp;&nbsp;');renderLink(currentPageNum+1,'Next Page &raquo;');}
div.innerHTML=html.join('');}
initMap=function(){var initialized=false;return function(){if(!initialized){google.load('maps','2',{'callback':function(){map=new SimpleMap(el('map'));asyncLoadManager.doneLoading('map');}});initialized=true;}};}();function SearchResult(url,url_sig,title,location,snippet,startdate,enddate,itemId,baseUrl,liked,totalInterestCount,hostWebsite){this.url=url;this.url_sig=url_sig;this.title=title;this.location=location;this.snippet=snippet;this.startdate=startdate;this.enddate=enddate;this.itemId=itemId;this.baseUrl=baseUrl;this.liked=liked;this.totalInterestCount=totalInterestCount;this.hostWebsite=hostWebsite;}
var lastSearchQuery=new Query('','','',0,true,{},1,"","");var whenFilterWidget;var typeFilterWidget;var sourceFilterWidget;var distanceFilterWidget;var categoryFilterWidget;asyncLoadManager.addCallback('bodyload',onLoadSearch);

/* --- URL 3: http://www.allforgood.org/zxrelease-1-9-r333.339750352312541358/js/calendar_widget.js [FETCH=607ms] --- */
vol.Calendar=function(element){this.date_=new Date();this.date_.setDate(1);this.events_={};this.numRows_=0;this.table_=element.getElementsByTagName('table')[0];this.periodSelector=element.getElementsByTagName('select')[0];};vol.Calendar.MONTH_NAMES=['January','February','March','April','May','June','July','August','September','October','November','December'];vol.Calendar.ROWS=6;vol.Calendar.COLUMNS=7;vol.Calendar.prototype.nextMonth=function(){this.date_.setMonth(this.date_.getMonth()+1);this.render();};vol.Calendar.prototype.previousMonth=function(){this.date_.setMonth(this.date_.getMonth()-1);this.render();};vol.Calendar.prototype.markRange=function(t0,t1){if(t0.getTime()>t1.getTime()){var tmp=t0;t0=t1;t1=tmp;}
t0=vol.Calendar.copyDatePart(t0);t1=vol.Calendar.copyDatePart(t1);var firstDay=this.getFirstDay();if(t0.getTime()<firstDay.getTime()){t0=firstDay;}
var lastDay=this.getLastDay();if(t1.getTime()>lastDay.getTime()){t1=lastDay;}
for(var d=t0;d.getTime()<=t1.getTime();d.setDate(d.getDate()+1)){this.events_[vol.Calendar.dateAsString(d)]=true;}};vol.Calendar.prototype.clearMarks=function(){this.events_={};};vol.Calendar.prototype.getDateRange=function(){var startDate,endDate;switch(this.periodSelector.value){case'month':startDate=vol.Calendar.copyDatePart(this.date_);endDate=new Date(startDate.getTime());endDate.setMonth(endDate.getMonth()+1);break;case'week':startDate=vol.Calendar.copyDatePart(new Date());endDate=new Date(startDate.getTime());endDate.setDate(endDate.getDate()+7);break;case'weekend':startDate=vol.Calendar.copyDatePart(new Date());var daysToNextSaturday=6-startDate.getDay();startDate.setDate(startDate.getDate()+daysToNextSaturday);endDate=new Date(startDate.getTime());endDate.setDate(endDate.getDate()+1);break;case'today':startDate=vol.Calendar.copyDatePart(new Date());endDate=startDate;break;}
return[startDate,endDate];};vol.Calendar.prototype.getFirstDay=function(){var day=vol.Calendar.copyDatePart(this.date_);day.setDate(day.getDate()-(day.getDay()+6)%7);return day;};vol.Calendar.prototype.getLastDay=function(){var day=this.getFirstDay();day.setDate(day.getDate()+vol.Calendar.ROWS*vol.Calendar.COLUMNS-1);return day;};vol.Calendar.prototype.render=function(){var month=vol.Calendar.MONTH_NAMES[this.date_.getMonth()]
+' '+this.date_.getFullYear();forEachElementOfClass('calendar_month',function(e){e.innerHTML=month;},this.table_);var numRows=this.table_.rows.length;if(numRows>=6){for(var i=0;i<6;i++){this.table_.deleteRow(this.table_.rows.length-1);}}
var tbody=this.table_.getElementsByTagName('tbody')[0];for(var row=0,day=this.getFirstDay();row<vol.Calendar.ROWS;row++){var tr=document.createElement('tr');tbody.appendChild(tr);for(var col=0;col<vol.Calendar.COLUMNS;col++){var classes=[];if(vol.Calendar.dateAsString(day)in this.events_){classes.push('calendar_days_event');}else if((day.getDay()+6)%7>4){classes.push('calendar_days_weekend');}
if(vol.Calendar.isToday(day)){classes.push('calendar_days_today');}
var td=document.createElement('td');if(classes.length>0){td.className=classes.join(' ');}
tr.appendChild(td);td.innerHTML=day.getDate();day.setDate(day.getDate()+1);}}
this.table_.style.display='';};vol.Calendar.isToday=function(date){var today=new Date();return date.getFullYear()==today.getFullYear()&&date.getMonth()==today.getMonth()&&date.getDate()==today.getDate();};vol.Calendar.copyDatePart=function(date){return new Date(date.getFullYear(),date.getMonth(),date.getDate());};vol.Calendar.dateAsString=function(date){var buffer=[date.getFullYear(),'-'];var month=date.getMonth()+1;if(month<10){buffer.push('0');}
buffer.push(month,'-');var day=date.getDate();if(day<10){buffer.push('0');}
buffer.push(day);return buffer.join('');};vol.Calendar.dateFromString=function(str){var matches=/^(\d{4})-(\d{2})-(\d{2})$/.exec(str);return!matches?null:new Date(Number(matches[1]),Number(matches[2])-1,Number(matches[3]));};
