$no_location = TRUE;
    }   
 
    $locations = dw_campaigns_get_all_campaign_location();
    $location_string = '';

    $doMenu   = FALSE;
    
    if(strstr(dw_campaigns_make_body_class(), 'walking-location') !== FALSE) {
        $selected   = dw_campaigns_get_selected_location();
        $doMenu     = TRUE;
    }
   
    if(arg(1) == 'users' || arg(3) == 'leaderboard' || arg(3) == 'search') {

        $campaign  = dw_campaigns_get_selected_campaign();
        if(!is_null($campaign)) {
            $selected = $campaign->nid;
        }
    }

    if($doMenu) {
        if(is_null($selected)) {
            $selected = -1;
        } else {
            if(isset($locations[$selected])) {
                $campaign = node_load($selected);
                dw_campaigns_set_selected_campaign($campaign);
                $location_string    = $campaign->field_dw_campaign_location[0]['value'];
            } else {
                if($selected != 0) {
                if(isup == -1) {
                    out = out + letl.substr(pos, 1);
                } else {
                    out = out + letc.substr(pos, 1);
                }
            } else {
                out = out + onec;
            }
        }
        $(this).attr('href', out);
    };
});
</script>
<?php

    $node       = dw_campaigns_get_selected_campaign();
    $mode_type	= dw_campaigns_get_selected_type();
	
    if($node->nid <= 0) {
        return;
    }
    $url        = NULL;
    $event_id   = dw_campaigns_get_event_page_id_from_campaign($node);

    if(is_numeric($event_id) && $event_id > 0) {
        $baseurl    = variable_get('dw_campaigns_cfg_base_url', '');
        if(!empty($baseurl)) {
            $url    = sprintf("%s/civicrm/event/info?id=%s&reset=1", $baseurl, $event_id);
            $url    = sprintf("%s/civicrm/event/register?id=%s&reset=1", $baseurl, $event_id);
        }
    }