Index: google_cse_adv.module
===================================================================
--- google_cse_adv.module	(revision 1633)
+++ google_cse_adv.module	(working copy)
@@ -52,6 +52,14 @@
     '#maxlength' => 100,
     '#default_value' => variable_get('google_cse_adv_proxy', '')
   );
+  $form['google_cse_adv_sitesearch_domain'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Search domain'),
+    '#description' => t('Domain to limit searches to, e.g. "drupal.org"'),
+    '#size' => 50,
+    '#maxlength' => 100,
+    '#default_value' => variable_get('google_cse_adv_sitesearch_domain', '')
+  );
   return system_settings_form($form);
 }
 
@@ -223,6 +231,10 @@
        .   (isset($_GET['more']) ? '+more:' . urlencode($_GET['more']) : '')
        . '&start=' . urlencode($page * $rows);
 
+  if (($domain = variable_get('google_cse_adv_sitesearch_domain', '')) > '') {
+    $url .= '&as_sitesearch=' . $domain;
+  }
+  
   $request = new stdClass();
   $request->url = $url;
 
