public function config($id = false) {
        $boxes = $this->_getAllBrowseboxes();
        if (count($boxes)) {
            $script = "Garp.browseboxes = [];\n";
            foreach ($boxes as $boxId => $box) {
                $jsConfig  = $this->_getJavascriptOptions($box);
                $boxScript = '';
                $boxScript .= "new Garp.Browsebox({\n";
                $boxScript .= "\t\"id\": \"$boxId\",\n";
                $i = 0;
                $total = count($jsConfig);
                foreach ($jsConfig as $confKey => $confVal) {
                    $boxScript .= "\t\"$confKey\": \"$confVal\"";
                    if ($i < ($total-1)) {
                        $boxScript .= ',';
                    }
                    $boxScript .= "\n";
                    $i++;
                }
                $boxScript .= "})";

                if ($id && $boxId === $id) {
                    return $this->_wrapInTags($boxScript);
                }
                $script .= "Garp.browseboxes.push($boxScript);\n";
            }
            return $this->_wrapInTags($script);
        }
        return '';
    }