use events to communicate with the outside world.
```javascript
$facet_list.trigger("facet:search-query", [merged_search_query]);
```
and where you're using this.
```javascript
$("...facet-list...").on("facet:search-query", function(event, query) {
    $("#search-box-main input[name=p]").val(query)
});
```