diff --git CHANGELOG.txt CHANGELOG.txt
index f6ec879..e950a53 100644
--- CHANGELOG.txt
+++ CHANGELOG.txt
@@ -1,6 +1,7 @@
 // $Id$
 
 amazon_store 2.0XXXXX ???
+* #559918 by rfay: Make category list configurable so categories can be excluded.
 * #566016 by rfay: Allow more liberal filtering of product description so the whole thing comes through.
 * #649380 by rfay: Make category pulldown optional on search page.
 * #648980 by rfay: Settings - allow separate control of front page search index 
diff --git amazon_store.install amazon_store.install
index 9a3cfb0..e27c9f2 100644
--- amazon_store.install
+++ amazon_store.install
@@ -12,6 +12,21 @@ function amazon_store_install() {
 
 function amazon_store_uninstall() {
   drupal_uninstall_schema('amazon_store');
+  $vars = "amazon_store_default_browsenode_id
+          amazon_store_default_items
+          amazon_store_default_item_list
+          amazon_store_default_search_index
+          amazon_store_include_categories
+          amazon_store_merchant_id
+          amazon_store_search_index_choice
+          amazon_store_show_category_select
+          amazon_store_show_narrowby_form
+          amazon_store_show_searchform
+          amazon_store_show_sort_form";
+
+  foreach(preg_split("/\s+/", $vars) as $var) {
+    variable_del($var);
+  }
 }
 
 function amazon_store_schema() {
diff --git amazon_store.module amazon_store.module
index d9575ec..4489f44 100644
--- amazon_store.module
+++ amazon_store.module
@@ -318,22 +318,28 @@ function amazon_store_admin_form() {
       ),
 
       'amazon_store_default_browsenode_id' => array(
-      '#type' => 'textfield',
-      '#title' => t("Default Browsenode ID"),
-      '#description' => t("Browsenode ID to use as default search. This browsenode MUST be valid with the Search Index you have chosen. You can find browsenodes at <a href='http://browsenodes.com'>browsenodes.com</a>"),
-      '#size' => 12,
-      '#default_value' => variable_get('amazon_store_default_browsenode_id',""),
+        '#type' => 'textfield',
+        '#title' => t("Default Browsenode ID"),
+        '#description' => t("Browsenode ID to use as default search. This browsenode MUST be valid with the Search Index you have chosen. You can find browsenodes at <a href='http://browsenodes.com'>browsenodes.com</a>"),
+        '#size' => 12,
+        '#default_value' => variable_get('amazon_store_default_browsenode_id',""),
       ),
 
       'amazon_store_default_item_list' => array(
-      '#type' => 'textfield',
-      '#title' => t("Default Item List"),
-      '#description' => t("Comma-separated list of up to 10 Amazon ASINs that should be displayed by default on the amazon_store page"),
-      '#size' => 80,
-      '#default_value' => variable_get('amazon_store_default_item_list',""),
-
+        '#type' => 'textfield',
+        '#title' => t("Default Item List"),
+        '#description' => t("Comma-separated list of up to 10 Amazon ASINs that should be displayed by default on the amazon_store page"),
+        '#size' => 80,
+        '#default_value' => variable_get('amazon_store_default_item_list',""),
       ),
+  );
 
+  $form['amazon_store_include_categories'] = array(
+      '#type' => 'checkboxes',
+      '#title' => t("Categories to include in search box, etc. It's often preferable to exclude some categories"),
+      '#description' => t("Note that this list changes if you change the locale, so you will have to revisit this page after changing the locale on the <a href='!amazon_settings_url'>Amazon Module Settings</a> page.", array('!amazon_settings_url' => url('admin/settings/amazon'))),
+      '#options' => $GLOBALS['amazon_store_search_indexes']->getAllCategories(),
+      '#default_value' => variable_get('amazon_store_include_categories', $GLOBALS['amazon_store_search_indexes']->getRecommendedCategories()),
   );
 
   return system_settings_form($form);
diff --git locales/.cvsignore locales/.cvsignore
deleted file mode 100644
index a374991..0000000
--- locales/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.amazon_store.locale.de.inc.swp
diff --git locales/amazon_store.locale.ca.inc locales/amazon_store.locale.ca.inc
index 64d3308..d46b8a7 100644
--- locales/amazon_store.locale.ca.inc
+++ locales/amazon_store.locale.ca.inc
@@ -94,6 +94,7 @@ function amazon_store_locale() {
   ),
   ),
   'VHS' => array('friendly_name' => t('VHS'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 962072,
   'parameters_allowed' => array( 'Actor', 'BrowseNode', 'Condition', 'Count', 'Director', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Publisher', 'Sort', 'Title'),
   'sorts' => array(
diff --git locales/amazon_store.locale.de.inc locales/amazon_store.locale.de.inc
index 9d7dee0..cc6a259 100644
--- locales/amazon_store.locale.de.inc
+++ locales/amazon_store.locale.de.inc
@@ -193,6 +193,7 @@ function amazon_store_locale() {
 ),
 
   'MP3Downloads' => array('friendly_name' => t('MP3 Downloads'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 77256031,
   'parameters_allowed' => array('Availability', 'BrowseNode', 'DeliveryMethod', 'Keywords', 'MerchantId', 'Sort', 'Title'),
   'sorts' => array(
diff --git locales/amazon_store.locale.fr.inc locales/amazon_store.locale.fr.inc
index 8477ff1..98e9a15 100644
--- locales/amazon_store.locale.fr.inc
+++ locales/amazon_store.locale.fr.inc
@@ -124,6 +124,7 @@ function amazon_store_locale() {
 ),
 ),
 'MP3Downloads' => array('friendly_name' => t('MP3 Downloads'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 206442031,
   'parameters_allowed' => array('Availability', 'BrowseNode', 'DeliveryMethod', 'Keywords', 'MerchantId', 'Sort', 'Title'),
   'sorts' => array(
diff --git locales/amazon_store.locale.uk.inc locales/amazon_store.locale.uk.inc
index dc86b9b..6b5aee8 100644
--- locales/amazon_store.locale.uk.inc
+++ locales/amazon_store.locale.uk.inc
@@ -171,6 +171,7 @@
   ),
 
   'MP3Downloads' => array('friendly_name' => t('MP3 Downloads'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 77198031,
   'parameters_allowed' => array( 'Author', 'Availability', 'BrowseNode', 'Count', 'DeliveryMethod', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ResponseGroup', 'ReviewSort', 'SearchIndex', 'Sort', 'TagPage', 'TagsPerPage', 'TagSort', 'Title'),
   'sorts' => array(
@@ -290,6 +291,7 @@
   ),
 
 'VHS' => array('friendly_name' => t('VHS'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 283926,
   'parameters_allowed' => array( 'Actor', 'AudienceRating', 'Availability', 'BrowseNode', 'Count', 'Director', 'Format', 'ItemPage', 'Keywords', 'Magazines', 'Performer', 'PostalCode', 'Publisher', 'Sort', 'State', 'Title'),
   'sorts' => array(
diff --git locales/amazon_store.locale.us.inc locales/amazon_store.locale.us.inc
index 3ca3e69..d7ec4d7 100644
--- locales/amazon_store.locale.us.inc
+++ locales/amazon_store.locale.us.inc
@@ -85,6 +85,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'DigitalMusic' => array('friendly_name' => t('Digital Music'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 301668,
   'parameters_allowed' => array( 'Actor', 'BrowseNode', 'Condition', 'Director', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
   'sorts' => array(
@@ -178,6 +179,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'KindleStore' => array('friendly_name' => t('Kindle Store'),
+  'exclude_default' => TRUE,
   'parameters_allowed' => array( 'Author', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Power', 'Publisher', 'Sort', 'TextStream', 'Title'),
   'sorts' => array(
   'daterank' => t('Publication date: newer to older'),
@@ -201,6 +203,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'Magazines' => array('friendly_name' => t('Magazines'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 44264011,
   'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Publisher', 'State', 'Sort', 'Title'),
   'sorts' => array(
@@ -214,6 +217,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'Merchants' => array('friendly_name' => t('Merchants'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 493964,
   'parameters_allowed' => array( 'Keywords', 'Title', 'BrowseNode', 'Artist', 'Author', 'Actor', 'Director', 'AudienceRating', 'Manufacturer', 'MusicLabel', 'Composer', 'Publisher', 'Brand', 'Conductor', 'City', 'Neighborhood', 'Orchestra', 'TextStream'),
   'sorts' =>  array(
@@ -226,6 +230,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'Miscellaneous' => array('friendly_name' => t('Miscellaneous'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 349028011,
   'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
   'sorts' => array(
@@ -239,7 +244,7 @@ $locale = array( 'US' => array(
 
   ),
   'MP3Downloads' => array('friendly_name' => t('MP3 Downloads'),
-
+  'exclude_default' => TRUE,
   'parameters_allowed' => array( 'Browsenode', 'Keyword', 'Title'),
   'sorts' => array(
   'price' => t('Price: low to high'),
@@ -281,6 +286,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'MusicTracks' => array('friendly_name' => t('Music Tracks'),
+  'exclude_default' => TRUE,
   'parameters_allowed' => array( 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State'),
   'sorts' => array(
   'titlerank' => t('Alphabetical: A to Z'),
@@ -418,6 +424,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'UnboxVideo' => array('friendly_name' => t('Unboxed Video'),
+  'exclude_default' => TRUE,
   'parameters_allowed' => array( 'Actor', 'BrowseNode', 'Condition', 'Director', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'MPAARating', 'Publisher', 'Sort', 'State', 'TextStream', 'Title'),
   'sorts' => array(
   'relevancerank' => t('Relevance'),
@@ -429,6 +436,7 @@ $locale = array( 'US' => array(
   ),
   ),
   'VHS' => array('friendly_name' => t('VHS'),
+  'exclude_default' => TRUE,
   'BrowseNode' => 404272,
   'parameters_allowed' => array( 'Actor', 'AudienceRating', 'Availability', 'BrowseNode', 'Count', 'Director', 'Format', 'ItemPage', 'Keywords', 'Magazines', 'Performer', 'PostalCode', 'Publisher', 'Sort', 'State', 'Title'),
   'sorts' =>  array(
diff --git searchindexes.inc searchindexes.inc
index 129ad4b..f7c3ccb 100644
--- searchindexes.inc
+++ searchindexes.inc
@@ -14,516 +14,18 @@
  *
  */
 class SearchIndexes {
-  protected $searchIndexPulldown = array();
+  protected $searchIndexPulldown = array();  // Populated search index pulldown.
+  protected $allCategories = array();   // All categories.
+  protected $recommendedCategories = array();  // Categories which will be on by default.
   protected $parametersAllowed = array();
   protected $browseNodes = array();
   protected $sorts = array(); // Allowable sorts for each SearchIndex
-  // List created by processing docs at http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/USSearchIndexParamForItemsearch.html
-  protected $data = array( 'US' => array(
-  'All' => array('friendly_name' => 'All',
-  'BrowseNode' => 2000,
-  'parameters_allowed' => array('Keywords'),
-  'sorts' => NULL,
-  ),
-  'Apparel' => array('friendly_name' => 'Apparel',
-  'BrowseNode' => 15683091,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'pricerank' => 'Price: low to high',
-  'inverseprice' => 'Price: high to low',
-  '-launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ),
-  ),
-  'Automotive' => array('friendly_name' => 'Automotive',
-  'BrowseNode' => 15690151,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Baby' => array('friendly_name' => 'Baby',
-  'BrowseNode' => 3760931,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  //       array('psrank' => 'Bestseller ranking taking into consideration projected      sales.The lower the value, the better the sales.'),
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  ),
-  ),
-  'Beauty' => array('friendly_name' => 'Beauty',
-  'BrowseNode' => 11055981,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  '-launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ),
-  ),
-  'Books' => array('friendly_name' => 'Books',
-  'BrowseNode' => 1000,
-  'parameters_allowed' => array( 'Author', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Power', 'Publisher', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'reviewrank' => 'Average customer review: high to low',
-  'pricerank' => 'Price: low to high',
-  'inverse-pricerank' => 'Price: high to low',
-  'daterank' => 'Publication date: newer to older',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Classical' => array('friendly_name' => 'Classical',
-  'BrowseNode' => 301668,
-  'parameters_allowed' => array( 'Artist', 'Author', 'Availability', 'BrowseNode', 'Composer', 'Conductor', 'Count', 'Format', 'ItemPage', 'Keywords', 'Magazines', 'MusicLabel', 'Orchestra', 'Performer', 'PostalCode', 'Sort', 'State', 'Title'),
-  'sorts' =>  array(
-  //       array('psrank' => 'Bestseller ranking taking into consideration projected      sales.The lower the value, the better the sales.'),
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  'orig-rel-date' => 'Release date: newer to older',
-  '-orig-rel-date' => 'Release date: older to newer',
-  'releasedate' => 'Release date: newer to older',
-  '-releasedate' => 'Release date: older to newer',
-  ),
-  ),
-  'DigitalMusic' => array('friendly_name' => 'Digital Music',
-  'BrowseNode' => 301668,
-  'parameters_allowed' => array( 'Actor', 'BrowseNode', 'Condition', 'Director', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'songtitlerank' => 'Most popular',
-  'uploaddaterank' => 'Date added',
-  ),
-  ),
-
-  'DVD' => array('friendly_name' => 'DVD',
-  'BrowseNode' => 130,
-  'parameters_allowed' => array( 'Actor', 'AudienceRating', 'Availability', 'BrowseNode', 'Count', 'Director', 'Format', 'ItemPage', 'Keywords', 'Magazines', 'Performer', 'PostalCode', 'Publisher', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-video-release-date' => 'Release date: newer to older',
-  'releasedate' => 'Release date: newer to older',
-  ),
-  ),
-  'Electronics' => array('friendly_name' => 'Electronics',
-  'BrowseNode' => 493964,
-  'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'reviewrank' => 'Average customer review: high to low',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  ),
-  ),
-  'GourmetFood' => array('friendly_name' => 'Gourmet Food',
-  'BrowseNode' => 3580501,
-  'parameters_allowed' => array( 'BrowseNode', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'pricerank' => 'Price: low to high',
-  'inverseprice' => 'Price: high to low',
-  'launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ),
-  ),
-  'HealthPersonalCare' => array('friendly_name' => 'Health/Personal Care',
-  'BrowseNode' => 3760931,
-  'parameters_allowed' => array( 'request.', 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'pricerank' => 'Price: low to high',
-  'inverseprice' => 'Price: high to low',
-  'launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ),
-  ),
-
-  'HomeGarden' => array('friendly_name' => 'Home and Garden',
-  'BrowseNode' => 1063498,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'Title'),
-  'sorts' => array(
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Industrial' => array('friendly_name' => 'Industrial',
-  'BrowseNode' => 228013,
-  'parameters_allowed' => array( 'BrowseNode', 'Keywords', 'Manufacturer', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Jewelry' => array('friendly_name' => 'Jewelry',
-  'BrowseNode' => 3880591,
-  'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' =>  array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'pricerank' => 'Price: low to high',
-  'inverseprice' => 'Price: high to low',
-  'launch-date' => 'Newest arrivals',
-  ),
-  ),
-  'KindleStore' => array('friendly_name' => 'Kindle Store',
-  'parameters_allowed' => array( 'Author', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Power', 'Publisher', 'Sort', 'TextStream', 'Title'),
-  'sorts' => array(
-  'daterank' => 'Publication date: newer to older',
-  '-edition-sales-velocity' => 'Quickest to slowest selling products.',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'relevancerank' =>  'Relevance',
-  'reviewrank' => 'Average customer review: high to low',
-  ),
-  ),
-  'Kitchen' => array('friendly_name' => 'Kitchen',
-  'BrowseNode' => 1063498,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Magazines' => array('friendly_name' => 'Magazines',
-  'BrowseNode' => 44264011,
-  'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Publisher', 'State', 'Sort', 'Title'),
-  'sorts' => array(
-  'subslot-salesrank' => 'Bestselling',
-  'reviewrank' => 'Average customer review: high to low',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'daterank' => 'Publication date: newer to older',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Merchants' => array('friendly_name' => 'Merchants',
-  'BrowseNode' => 493964,
-  'parameters_allowed' => array( 'Keywords', 'Title', 'BrowseNode', 'Artist', 'Author', 'Actor', 'Director', 'AudienceRating', 'Manufacturer', 'MusicLabel', 'Composer', 'Publisher', 'Brand', 'Conductor', 'City', 'Neighborhood', 'Orchestra', 'TextStream'),
-  'sorts' =>  array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'pricerank' => 'Price: low to high',
-  'inverseprice' => 'Price: high to low',
-  '-launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ),
-  ),
-  'Miscellaneous' => array('friendly_name' => 'Miscellaneous',
-  'BrowseNode' => 349028011,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-
-  ),
-  'MP3Downloads' => array('friendly_name' => 'MP3 Downloads',
-
-  'parameters_allowed' => array( 'Browsenode', 'Keyword', 'Title'),
-  'sorts' => array(
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  '-releasedate' => 'Release date',
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  ),
-  ),
-  'Music' => array('friendly_name' => 'Music',
-  'BrowseNode' => 301668,
-  'parameters_allowed' => array( 'Artist', 'Availability', 'BrowseNode', 'Count', 'Format', 'ItemPage', 'Keywords', 'Magazines', 'MusicLabel', 'Performer', 'PostalCode', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  //       array('psrank' => 'Bestseller ranking taking into consideration projected      sales.The lower the value, the better the sales.'),
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  'artistrank' => 'Artist name: A to Z',
-  'orig-rel-date' => 'Original Release Date',
-  'release-date' => 'Latest Release Date',
-  'releasedate' => 'Release date: most recent to oldest',
-  '-releasedate' => 'Release date: oldest to most recent',
-  'relevancerank' =>  'Relevance',
-  ),
-
-  ),
-  'MusicalInstruments' => array('friendly_name' => 'Musical Instruments',
-  'BrowseNode' => 12923151,
-  'parameters_allowed' => array( 'request.', 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  '-launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ),
-  ),
-  'MusicTracks' => array('friendly_name' => 'Music Tracks',
-  'parameters_allowed' => array( 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State'),
-  'sorts' => array(
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-
-  ),
-  'OfficeProducts' => array('friendly_name' => 'Office Products',
-  'BrowseNode' => 1084128,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'State', 'Title'),
-  'sorts' =>  array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'reviewrank' => 'Average customer review: high to low',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  ),
-  ),
-  'OutdoorLiving' => array('friendly_name' => 'Outdoor Living',
-  'BrowseNode' => 1063498,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  //       array('psrank' => 'Bestseller ranking taking into consideration projected      sales.The lower the value, the better the sales.'),
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'PCHardware' => array('friendly_name' => 'PC Hardware',
-  'BrowseNode' => 493964,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  // //       array('psrank' => 'Bestseller ranking taking into consideration projected      sales.The lower the value, the better the sales.'),
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  ),
-  ),
-  'PetSupplies' => array('friendly_name' => 'Pet Supplies',
-  'BrowseNode' => 13900811,
-  'parameters_allowed' => array( 'Author', 'Brand', 'BrowseNode', 'Condition', 'Count', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  '+pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Photo' => array('friendly_name' => 'Photo',
-  'BrowseNode' => 13900861,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Shoes' => array('friendly_name' => 'Shoes',
-  'BrowseNode' => 3375301,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  '-launch-date' => 'Newest arrivals',
-  'pmrank' => 'Featured items',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'xsrelevancerank' => 'Relevance',
-  'reviewrank' => 'Average customer review: high to low',
-  ),
-
-  ),
-  'SilverMerchants' => array('friendly_name' => 'Silver Merchants',
-  'parameters_allowed' => array( 'Keywords', 'Title', 'BrowseNode', 'Artist', 'Author', 'Actor', 'Director', 'AudienceRating', 'Manufacturer', 'MusicLabel', 'Composer', 'Publisher', 'Brand', 'Conductor', 'City', 'Neighborhood', 'Orchestra', 'TextStream'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'pricerank' => 'Price: low to high',
-  'inverseprice' => 'Price: high to low',
-  '-launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ), ),
-  'Software' => array('friendly_name' => 'Software',
-  'BrowseNode' => 409488,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'ItemPage', 'Keywords', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  ),
-  ),
-  'SportingGoods' => array('friendly_name' => 'Sporting Goods',
-  'BrowseNode' => 1036682,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'pricerank' => 'Price: low to high',
-  'inverseprice' => 'Price: high to low',
-  'launch-date' => 'Newest arrivals',
-  'sale-flag' => 'On sale',
-  ),
-  ),
-  'Tools' => array('friendly_name' => 'Tools',
-  'BrowseNode' => 228013,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'Toys' => array('friendly_name' => 'Toys',
-  'BrowseNode' => 130,
-  'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-age-min' => 'Age: high to low',
-  ),
-  ),
-  'UnboxVideo' => array('friendly_name' => 'Unboxed Video',
-  'parameters_allowed' => array( 'Actor', 'BrowseNode', 'Condition', 'Director', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'MPAARating', 'Publisher', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-video-release-date' => 'Release date: newer to older',
-  ),
-  ),
-  'VHS' => array('friendly_name' => 'VHS',
-  'BrowseNode' => 404272,
-  'parameters_allowed' => array( 'Actor', 'AudienceRating', 'Availability', 'BrowseNode', 'Count', 'Director', 'Format', 'ItemPage', 'Keywords', 'Magazines', 'Performer', 'PostalCode', 'Publisher', 'Sort', 'State', 'Title'),
-  'sorts' =>  array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-video-release-date' => 'Release date: newer to older',
-  '-releasedate' => 'Release date: newer to older',
-  ),
-  ),
-  'Video' => array('friendly_name' => 'Video',
-  'BrowseNode' => 130,
-  'parameters_allowed' => array( 'Actor', 'AudienceRating', 'Availability', 'BrowseNode', 'Count', 'Director', 'Format', 'ItemPage', 'Keywords', 'Magazines', 'Performer', 'PostalCode', 'Publisher', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'relevancerank' =>  'Relevance',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-video-release-date' => 'Release date: newer to older',
-  '-releasedate' => 'Release date: newer to older',
-  ),
-  ),
-  'VideoGames' => array('friendly_name' => 'Video Games',
-  'BrowseNode' => 44263011,
-  'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'pmrank' => 'Featured items',
-  'salesrank' => 'Bestselling',
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'titlerank' => 'Alphabetical: A to Z',
-  ),
-  ),
-  'Watches' => array('friendly_name' => 'Watches',
-  'BrowseNode' => 378516011,
-  'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'),
-  'sorts' => array(
-  'price' => 'Price: low to high',
-  '-price' => 'Price: high to low',
-  'relevancerank' =>  'Relevance',
-  'reviewrank' => 'Average customer review: high to low',
-  'salesrank' => 'Bestselling to worst selling',
-  ),
-  ),
-  'Wireless' => array('friendly_name' => 'Wireless',
-  'BrowseNode' => 408234,
-  'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'Title'),
-  'sorts' => array(
-  'daterank' => 'Publication date: newer to older',
-  'pricerank' => 'Price: low to high',
-  'inverse-pricerank' => 'Price: high to low',
-  'reviewrank' => 'Average customer review: high to low',
-  'salesrank' => 'Bestselling',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-  'WirelessAccessories' => array('friendly_name' => 'Wireless Accessories',
-  'BrowseNode' => 408234,
-  'parameters_allowed' => array( 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'Title'),
-  'sorts' => array(
-  //       array('psrank' => 'Bestseller ranking taking into consideration projected      sales.The lower the value, the better the sales.'),
-  'salesrank' => 'Bestselling',
-  'titlerank' => 'Alphabetical: A to Z',
-  '-titlerank' => 'Alphabetical: Z to A',
-  ),
-  ),
-
-  ),
-  );
+  protected $data = array();
 
   /**
    *
    * @param $locale
-   * 	Locale ("US") in the Amazon scheme of Locale
+   * 	 The Amazon.com locale ("US", "UK", "JP", etc.).
    * @return unknown_type
    */
   function __construct($locale) {
@@ -531,17 +33,18 @@ class SearchIndexes {
     $this->data = amazon_store_locale();
 
     if (!empty($this->data[$locale])) {
-      $error_level = error_reporting(0);
       foreach ($this->data[$locale] as $index => $item) {
         if (!empty($item['friendly_name'])) {
+          $this->allCategories[$index] = $item['friendly_name'];
           $this->searchIndexPulldown[$index] = $item['friendly_name'];
           $this->parametersAllowed[$index] = $item['parameters_allowed'];
-          $this->browseNodes[$index] = $item['BrowseNode'];
+          $this->browseNodes[$index] = !empty($item['BrowseNode']) ? $item['BrowseNode'] : NULL;
           $this->sorts[$index] = $item['sorts'];
+          if (empty($item['exclude_default'])) {
+            $this->recommendedCategories[] = $index;
+          }
         }
       }
-      error_reporting($error_level);
-
     }
   }
   function getBrowseNodes() {
@@ -560,9 +63,27 @@ class SearchIndexes {
   function getSorts($searchIndex) {
     return $this->sorts;
   }
+  /**
+   * Returns the possible sorts for this searchIndex.
+   * @param $searchIndex
+   * @return unknown_type
+   */
   function getSortPossiblities($searchIndex) {
     return $this->sorts[$searchIndex];
   }
+  /**
+   * Return the full category list for this locale.
+   */
+  function getAllCategories() {
+    return $this->allCategories;
+  }
+
+  /**
+   * Return static array of values of recommended categories to enable.
+   */
+  function getRecommendedCategories() {
+    return $this->recommendedCategories;
+  }
 }
 
 
