How to pass javascript var into a ajax remoteFunction?

I have a view where ill have 3 divs:

Div 1: List of Brands with checkboxs.
Div 2: List of Categories with checkboxs.

Div 3: List of Items.

This last div will be refreshed with the all the items according to what is selected in the first two divs. At beginning it shows all the items, after we select some of the brands and/or categories and press refresh i'll want to refresh the div 3.

In Javascript I can get which of the categories/brands are selected and my biggest doubt is on how to refresh the last div...

Heres what I was trying:

function refresh() {
var brands= /**/
var categories = /**/
<?php echo $ajax->remoteFunction(array('url' => array('controller' => 'items', 
                                                      'action' => 'men', brands, categories),
                                                      'update' => 'itemsContent')); ?>
}

My problems are:
- How do I pass the js vars into the php method?
- How do I receive an js array in a cakephp action? Because brands and categories will be used to filter the query that produce results for the div 3...