--- /wwwRoot/Code Library/drupal/modules/slideshowpro/slideshowpro.module	2008-01-24 14:29:43.000000000 -0500
+++ /wwwRoot/Code Library/drupal/_patches/slideshowpro.module	2008-06-05 12:06:40.000000000 -0400
@@ -257,16 +257,43 @@ function slideshowpro_get_image_path() {
 }
 
 /**
+ * returns permalink depending on installed modules
+ */
+function slideshowpro_get_permalink($node) {
+	$permalink['link'] = 'node/'.$node->nid;
+	$permalink['target'] = '_blank';
+	
+  if(module_exists('link')){		
+		if(isset($node->field_link[0]['url'])){
+			$permalink['link'] = link_cleanup_url($node->field_link[0]['url']);
+		}
+		if(isset($node->field_link[0]['attributes'])){
+			$attributes = unserialize($node->field_link[0]['attributes']);
+			if(isset($attributes['target'])){
+				$permalink['target'] = $attributes['target'];
+			}
+			else if(!isset($attributes['target']) && isset($node->field_link[0]['url'])){
+				$permalink['target'] = '_self';
+			}
+		}	
+	}
+  
+  return $permalink;
+}
+
+/**
  * Format an image.
  */
-function theme_slideshowpro_xml_image(&$node, $size = 'preview') {    
-  $output = '<img src="%src" title="%title" caption="%caption" link="%link" target="_blank" tn="%thumb" />'."\n";
+function theme_slideshowpro_xml_image(&$node, $size = 'preview') {
+	$permalink = slideshowpro_get_permalink($node);   
+  $output = '<img src="%src" title="%title" caption="%caption" link="%link" target="%target" tn="%thumb" />'."\n";
   $variables = array(
     '%src' => slideshowpro_get_image_path() . basename($node->images[$size]), 
     '%title' => check_plain($node->title),
     '%caption' => variable_get('slideshowpro_title_as_caption', 0) ? 
       trim(check_plain($node->title)) : trim(check_plain(truncate_utf8($node->body, 100, TRUE, TRUE))), 
-    '%link' => url('node/'.$node->nid, NULL, NULL, TRUE),
+    '%link' => url($permalink['link'], NULL, NULL, TRUE),
+    '%target' => $permalink['target'],
     '%thumb' => slideshowpro_get_image_path() . basename($node->images['thumbnail']));
   return strtr($output, $variables);
 }
