Index: ad.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ad/ad.module,v
retrieving revision 1.2.2.29.2.67
diff -u -p -r1.2.2.29.2.67 ad.module
--- ad.module	3 Apr 2008 18:34:32 -0000	1.2.2.29.2.67
+++ ad.module	4 Apr 2008 17:47:57 -0000
@@ -175,10 +175,19 @@ function ad_link_attributes() {
 
 /**
  * Ad API Helper Function:
- * Append target="..." as globally configured.
+ * Provide XHTML-strict-compatible target window onclick-handlers based on
+ * global configuration.
  */
 function ad_link_target() {
-  return ' target="'. variable_get('ad_link_target', '_self') .'"';
+  switch (variable_get('ad_link_target', '_self')) {
+    case '_blank':
+      return ' onclick="window.open(this.href); return false;"';
+    case '_parent':
+      return ' onclick="window.parent.location = this.href; return false;"';
+    case '_top':
+      return ' onclick="window.top.location = this.href; return false;"';
+  }
+  return '';
 }
 
 /**
Index: image/ad_image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ad/image/ad_image.module,v
retrieving revision 1.2.2.13.2.32
diff -u -p -r1.2.2.13.2.32 ad_image.module
--- image/ad_image.module	23 Jan 2008 15:28:03 -0000	1.2.2.13.2.32
+++ image/ad_image.module	4 Apr 2008 17:35:07 -0000
@@ -16,7 +16,7 @@ function ad_image_display_ad($ad) {
   $image = db_fetch_object(db_query('SELECT a.fid, a.url, a.tooltip, a.width, a.height, f.filepath FROM {ad_image} a INNER JOIN {files} f ON a.fid = f.fid WHERE a.aid = %d AND f.nid = %d', $ad->aid, $ad->aid));
   // Strip module path from image path if serving images from adserve.php.
   $image_path = preg_replace('&'. drupal_get_path('module', 'ad') .'/&', '', file_create_url($image->filepath));
-  return ("<div class=\"image-advertisement\" id=\"ad-$ad->aid\"><a href=\"$ad->redirect/@HOSTID___\" title=\"". htmlentities($image->tooltip, ENT_QUOTES, 'UTF-8') .'"'. ad_link_attributes() ."><img src=\"$image_path\" width=\"$image->width\" height=\"$image->height\" /></a></div>");
+  return ("<div class=\"image-advertisement\" id=\"ad-$ad->aid\"><a href=\"$ad->redirect/@HOSTID___\" title=\"". htmlentities($image->tooltip, ENT_QUOTES, 'UTF-8') .'"'. ad_link_attributes() ."><img alt=\"". htmlentities($image->tooltip, ENT_QUOTES, 'UTF-8') ."\" src=\"$image_path\" width=\"$image->width\" height=\"$image->height\" /></a></div>");
 }
 
 /*****/
