diff -rupN ad/ad.admin.inc ad.new/ad.admin.inc
--- ad/ad.admin.inc	2011-05-30 05:11:43.000000000 +1000
+++ ad.new/ad.admin.inc	2011-07-01 13:13:07.865889620 +1000
@@ -523,6 +523,13 @@ function ad_admin_configure_settings($fo
     '#description' => t('If enabled, %tag will be added to advertisement links generated by this module.', array('%tag' => t('rel="nofollow"'))),
   );
 
+  $form['general']['ad_obfuscate'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('obfuscate advertisement markup'),
+    '#default_value' => variable_get('ad_obfuscate', false),
+    '#description' => t('If enabled, various attempts to obfuscate advertisement markup content will be made. This can helps bypass adblock and other similar browser features.'),
+  );
+
   // Provide hook for ad_display_TYPE modules to set display TYPE.
   $display_options = array_merge(array('javascript' => t('JavaScript'), 'jquery' => t('jQuery'), 'iframe' => t('IFrame'), 'raw' => t('Raw')), module_invoke_all('displayapi', 'display_method'), array());
 
@@ -661,6 +668,8 @@ function ad_admin_configure_settings_val
 function ad_admin_configure_settings_submit($form, &$form_state) {
   variable_set('ad_link_target', $form_state['values']['ad_link_target']);
   variable_set('ad_link_nofollow', $form_state['values']['ad_link_nofollow']);
+  /* TODO: re-generate menus on ad_obfuscate change */
+  variable_set('ad_obfuscate', $form_state['values']['ad_obfuscate']);
   variable_set('ad_cache', $form_state['values']['ad_cache']);
   variable_set('ad_display', $form_state['values']['ad_display']);
   variable_set('ad_validate_url', $form_state['values']['ad_validate_url']);
diff -rupN ad/ad.module ad.new/ad.module
--- ad/ad.module	2011-05-30 05:11:43.000000000 +1000
+++ ad.new/ad.module	2011-07-01 13:13:07.633904862 +1000
@@ -89,6 +89,11 @@ function ad($group = FALSE, $quantity = 
     _ad_check_installation();
     return (t('The ad module is <a href="@misconfigured">misconfigured</a>.', array('@misconfigured' => url('admin/content/ad/configure'))));
   }
+  
+  // We're using menu if obfuscated
+  if (variable_get('ad_obfuscate', false)) {
+    $adserve = variable_get('ad_serve_path', 'ad/serve');
+  }
 
   // Be sure a display method has been chosen.
   if (!isset($options['ad_display'])) {
@@ -112,7 +117,7 @@ function ad($group = FALSE, $quantity = 
       // Fall through...
     case 'javascript':
     default:
-      $query['q'] = $quantity;
+      $query['a'] = $quantity;
       if (isset($options['hostid'])) {
         $query['k'] = $options['hostid'];
       }
@@ -206,15 +211,22 @@ function theme_ad_display($group, $displ
 
   // The naming convention for the id attribute doesn't allow commas.
   $group = preg_replace('/[,]/', '+', $group);
+  
+  // Only add class if not obfuscating
+  if (variable_get('ad_obfuscate', false)) {
+    $class = '';
+  } else {
+    $class = "class=\"advertisement group-$group\"";
+  }
 
   if ($method == 'jquery') {
-    return "\n<div class=\"advertisement group-$group\" id=\"group-id-$id\">\n <script type=\"text/javascript\">\n//<![CDATA[\n  $(document).ready(function(){ jQuery(\"div#group-id-$id\").load(\"$display\"); });\n //]]>\n </script>\n</div>\n";
+    return "\n<div $class id=\"group-id-$id\">\n <script type=\"text/javascript\">\n//<![CDATA[\n  $(document).ready(function(){ jQuery(\"div#group-id-$id\").load(\"$display\"); });\n //]]>\n </script>\n</div>\n";
   }
   else if ($method == 'raw') {
     return $display;
   }
   else {
-    return "\n<div class=\"advertisement group-$group\" id=\"group-id-$group\">$display</div>\n";
+    return "\n<div $class id=\"group-id-$group\">$display</div>\n";
   }
 }
 
@@ -1206,10 +1218,25 @@ function ad_menu() {
     'page arguments' => (array(2)),
   );
 
+  if (variable_get('ad_obfuscate', false)) {
+    $items[variable_get('ad_serve_path', 'ad/serve')] = array(
+      'page callback' => 'adserve_menu',
+      'access arguments' => array('show advertisements'),
+    );
+  }
+  
   return $items;
 }
 
 /**
+ * Function to do the same thing as serve.php does from the menu
+ */
+ 
+function adserve_menu() {
+  include('serve.php');
+}
+
+/**
  * Load settings for all ad modules. Those modules, who don't
  * have their settings form, will get a standard one.
  */
@@ -1278,6 +1305,9 @@ function ad_block($op = 'list', $delta =
       break;
     case 'view':
       $block['content'] = ad($delta, variable_get('ad_block_quantity_'. $delta, 1));
+      if (variable_get('ad_obfuscate', false)) {
+        $block['module'] = variable_get('ad_block_module', 'obfusticated');
+      }
       return $block;
   }
 }
@@ -1611,4 +1641,3 @@ function _ad_get_group($nid) {
 
   return $groups[$nid];
 }
-
diff -rupN ad/adserve.inc ad.new/adserve.inc
--- ad/adserve.inc	2011-05-30 05:11:43.000000000 +1000
+++ ad.new/adserve.inc	2011-07-01 12:53:44.935891666 +1000
@@ -75,7 +75,7 @@ function adserve_variable($variable, $va
       $values['n'] = isset($value['nids']) ? $value['nids'] : '';
       $values['t'] = isset($value['tids']) ? $value['tids'] : '';
       $values['k'] = isset($value['hostid']) ? $value['hostid'] : '';
-      $values['q'] = isset($value['quantity']) ? $value['quantity'] : 1;
+      $values['a'] = isset($value['quantity']) ? $value['quantity'] : 1;
       $values['m'] = isset($value['ad_display']) ? $value['ad_display'] : 0;
       unset($value);
     }
diff -rupN ad/image/ad_image.module ad.new/image/ad_image.module
--- ad/image/ad_image.module	2011-05-30 05:11:43.000000000 +1000
+++ ad.new/image/ad_image.module	2011-07-01 13:13:07.963883187 +1000
@@ -25,7 +25,12 @@ function ad_image_display_ad($ad) {
  */
 function theme_ad_image_ad($ad) {
   if (isset($ad->aid) && (isset($ad->filepath) || isset($ad->remote_image))) {
-    $output = '<div class="image-advertisement" id="ad-'. $ad->aid .'">';
+    /* Don't use class or ID if obfuscating */
+    if (variable_get('ad_obfuscate', false)) {
+      $output = '<div>';
+    } else {
+      $output = '<div class="image-advertisement" id="ad-'. $ad->aid .'">';
+    }
     if (isset($ad->url) && !empty($ad->url)) {
       $image = theme('ad_image_image', !empty($ad->remote_image) ? $ad->remote_image : $ad->filepath, check_plain($ad->tooltip), check_plain($ad->tooltip));
       $output .= l($image, $ad->redirect .'/@HOSTID___', array('attributes' => ad_link_attributes(), 'absolute' => TRUE, 'html' => TRUE));
diff -rupN ad/text/ad_text.module ad.new/text/ad_text.module
--- ad/text/ad_text.module	2011-05-30 05:11:43.000000000 +1000
+++ ad.new/text/ad_text.module	2011-07-01 13:13:07.925885682 +1000
@@ -28,7 +28,12 @@ function theme_ad_text_ad($ad) {
     if (!isset($ad->adheader)) {
       $ad = node_load($ad->aid);
     }
-    $output = '<div class="text-advertisement" id="ad-'. $ad->aid .'">';
+    /* Don't use class or ID if obfuscating */
+    if (variable_get('ad_obfuscate', false)) {
+      $output = '<div>';
+    } else {
+      $output = '<div class="text-advertisement" id="ad-'. $ad->aid .'">';
+    }
     if (isset($ad->url) && !empty($ad->url)) {
       $output .= theme('ad_text_text', ad_text_display_prepare($ad->adheader, $ad->format), ad_text_display_prepare($ad->adbody, $ad->format), $ad->redirect .'/@HOSTID___');
     }
@@ -53,7 +58,12 @@ function theme_ad_text_ad($ad) {
  *  A string containing the text ad.
  */
 function theme_ad_text_text($header, $body, $link = NULL) {
-  $output  = '<div class="ad-header">';
+  /* Don't use class or ID if obfuscating */
+  if (variable_get('ad_obfuscate', false)) {
+    $output = '<div>';
+  } else {
+    $output  = '<div class="ad-header">';
+  }
   if (isset($link) && !empty($link)) {
     $output .= l($header, $link, array('attributes' => ad_link_attributes(), 'html' => TRUE));
   }
@@ -61,7 +71,12 @@ function theme_ad_text_text($header, $bo
     $output .= $header;
   }
   $output .= '</div>';
-  $output .= '<div class="ad-body">'. $body .'</div>';
+  /* Don't use class or ID if obfuscating */
+  if (variable_get('ad_obfuscate', false)) {
+    $output .= '<div>'. $body .'</div>';
+  } else {
+    $output .= '<div class="ad-body">'. $body .'</div>';
+  }
   return $output;
 }
 
