# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: modules/extlink/extlink.js
--- modules/extlink/extlink.js Base (1.4.2.1)
+++ modules/extlink/extlink.js Locally Modified (Based On 1.4.2.1)
@@ -65,8 +65,15 @@
     }
 
     if (Drupal.settings.extlink.extTarget) {
+      if (Drupal.settings.extlink.extTarget == "ext_frame" && $('html', window.frames['ext_frame'].document).length == 0) {
+        $(external_links).attr('href', function() {
+          return "/frame/node/--/" + $(this).attr('href').replace(/^https?:\/\//, "")
+        });
+        $(external_links).removeAttr('target');
+      } else {
       // Apply the target attribute to all links.
       $(external_links).attr('target', Drupal.settings.extlink.extTarget);
     }
+    }
   });
 }
Index: modules/extlink/extlink.module
--- modules/extlink/extlink.module Base (1.3.2.2)
+++ modules/extlink/extlink.module Locally Modified (Based On 1.3.2.2)
@@ -11,6 +11,12 @@
     'access callback' => 'user_access',
     'access arguments' => array('administer site configuration'),
   );
+  $items['frame'] = array(
+    'title' => 'Frame',
+    'page callback' => 'extlink_frame',
+    'access arguments' => array('access frame'),
+    'type' => MENU_CALLBACK,
+  );
   return $items;
 }
 
@@ -21,7 +27,8 @@
   $path = drupal_get_path('module', 'extlink');
   drupal_add_js($path .'/extlink.js');
   drupal_add_js(array('extlink' => array(
-    'extTarget'     => variable_get('extlink_target', 0),
+    'extTarget'     => variable_get('extlink_target', '_self'),
+//    'extIntenal'    => variable_get('extlink_internal', '_self'),
     'extClass'      => variable_get('extlink_class', 'ext'),
     'extSubdomains' => variable_get('extlink_subdomains', 1),
     'mailtoClass'   => variable_get('extlink_mailto_class', 'mailto'))), 'setting'
@@ -57,13 +64,51 @@
     '#description' => t('If checked, links with the same primary domain will all be considered internal. A link from www.example.com to my.example.com would be considered internal. Links between the www. and non-www. domain are always considered internal.'),
   );
 
+/*  $form['extlink_internal'] = array(
+    '#type' => 'radios',
+    '#title' => t('How internal links should be opened when in a frameset'),
+    '#options' => array('_self' => 'The same frame', '_top' => 'Replace frameset'),
+    '#default_value' => variable_get('extlink_internal', '_self'),
+    '#description' =>  t('Sets the target location for all internal links. \'The same frame\' is the default.'),
+  );
+*/
   $form['extlink_target'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Open external links in a new window'),
-    '#return_value' => '_blank',
-    '#default_value' => variable_get('extlink_target', 0),
-    '#description' => t('Should all external links be opened in a new window?'),
+    '#type' => 'radios',
+    '#title' => t('How external links should be opened'),
+    '#options' => array('_self' => 'The same window', '_blank' => 'A new window/tab', 'ext_frame' => 'A new frame (split window)'),
+    '#default_value' => variable_get('extlink_target', '_self'),
+    '#description' =>  t('Sets the target location for all external links. \'The same window\' is the default.'),
   );
   
+  $form['extlink_height'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Height of frame for external links'),
+    '#default_value' => variable_get('extlink_height', '35%'),
+    '#description' =>  t('Sets the height of target frame for all external links.'),
+    '#size' => 4,
+    '#maxlength' => 4,
+  );
+  
   return system_settings_form($form);
 }
+
+function extlink_frame() {
+  $arg_list = arg();
+  $term = array_search('--', $arg_list);
+  $src_page = implode('/', array_slice($arg_list, 1, $term - 1));
+  $ext_page = implode('/', array_slice($arg_list, $term + 1));
+  print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
+  "http://www.w3.org/TR/html4/frameset.dtd">
+<HTML>
+<HEAD>
+<TITLE>Drupal in a frameset</TITLE>
+</HEAD>
+<FRAMESET rows="*, ' . variable_get('extlink_height', '35%') . '">
+  <FRAME src="/' . $src_page . '">
+  <FRAME name="ext_frame" src="http' . '://' . $ext_page . '">
+  <NOFRAMES>
+    <a>This frameset document contains:</a>
+  </NOFRAMES>
+</FRAMESET>
+</HTML>';
+}
