--- emfield\contrib\emvideo\emvideo.theme.inc	2010-04-30 09:51:00.000000000 -0700
+++ emfield\contrib\emvideo\emvideo.theme.inc	2010-07-20 12:36:49.000000000 -0700
@@ -1,8 +1,8 @@
 <?php
-// $Id: emvideo.theme.inc,v 1.1.2.38.2.4 2010/04/30 16:51:00 aaron Exp $
+// $Id: emvideo.theme.inc,v 1.1.2.38.2.6 2010/07/19 17:12:14 aaron Exp $
 
 /**
  * @file
  * This defines the various theme functions for Embedded Video Field (emvideo).
  */
 
@@ -120,20 +120,21 @@
   }
 
   // Define the thumbnail link's path.
   $link_url = isset($options['link_url']) ? $options['link_url'] : 'node/'. $node->nid;
 
   // Define the title/alt to display for the link hover.
-  $link_title = isset($options['link_title']) ? $options['link_title'] : (isset($options['title']) ? $options['title'] : (isset($field['widget']['thumbnail_link_title']) ? $field['widget']['thumbnail_link_title'] : variable_get('emvideo_default_thumbnail_link_title', t('See video'))));
-  if (module_exists('token')) {
+  $link_title = isset($options['link_title']) ? $options['link_title'] : (isset($options['title']) ? $options['title'] : (isset($field['widget']['thumbnail_link_title']) ? $field['widget']['thumbnail_link_title'] : (isset($item['title']) ? $item['title'] : variable_get('emvideo_default_thumbnail_link_title', t('See video')))));
+	if (module_exists('token')) {
     // Allow the editor to use [title] tokens.
     $link_title = token_replace($link_title, 'global', $node);
   }
-  $image_title = isset($options['image_title']) ? $options['image_title'] : $link_title;
-  $image_alt = isset($options['image_alt']) ? $options['image_alt'] : $link_title;
-
+
+  $image_title = isset($options['image_title']) ? $options['image_title'] : (isset($item['title']) ? $item['title'] : $link_title);
+  $image_alt = isset($options['image_alt']) ? $options['image_alt'] : (isset($item['description']) ? $item['description'] : $link_title);
+	
   if (isset($thumbnail_url)) {
     if ($options['absolute']) {
       $thumbnail_url = url($thumbnail_url, array('absolute' => $options['absolute']));
     }
     if (isset($options['return_url'])) {
       return $options['raw'] ? $thumbnail_url : url($thumbnail_url);
@@ -214,13 +215,13 @@
   }
 
   return $output;
 }
 
 function theme_emvideo_modal_generic($field, $item, $formatter, $node, $options = array()) {
-  $title = isset($options['title']) ? $options['title'] : (isset($node->title) ? $node->title : (isset($node->node_title) ? $node->node_title : (isset($field['widget']['thumbnail_link_title']) ? $field['widget']['thumbnail_link_title'] : variable_get('emvideo_default_thumbnail_link_title', t('See video')))));
+  $title = isset($options['title']) ? $options['title'] : (isset($item['title']) ? $item['title'] : (isset($node->title) ? $node->title : (isset($node->node_title) ? $node->node_title : (isset($field['widget']['thumbnail_link_title']) ? $field['widget']['thumbnail_link_title'] : variable_get('emvideo_default_thumbnail_link_title', t('See video'))))));
   $thumbnail = isset($options['thumbnail']) ? $options['thumbnail'] : theme('emvideo_video_thumbnail', $field, $item, 'video_thumbnail', $node, TRUE, $options);
   $width = ($formatter == 'video_replace_preview') ? $field['widget']['preview_width'] : $field['widget']['video_width'];
   $height = ($formatter == 'video_replace_preview') ? $field['widget']['preview_height'] : $field['widget']['video_height'];
   $destination = 'emvideo/modal/'. $node->nid .'/'. $width .'/'. $height .'/'. $field['field_name'] .'/'. $item['provider'] .'/'. $item['value'];
   $link_class = 'emvideo-thumbnail-replacement emvideo-modal-' . $options['modal'] .' '. $options['modal'];
   $attributes = array(
@@ -255,21 +256,36 @@
     $added_js = TRUE;
   }
   $class = 'emvideo-modal emvideo-'. $options['modal'];
   if ($options['wrapper-class']) {
     $class .= ' '. $options['wrapper-class'];
   }
-  $output = '<div class="'. $class .'">'. l($thumbnail, $destination, $attributes) .'</div>';
+	$display_title = '';
+	// Create "title" container
+	if (isset($options['title'])) {
+		$display_title = '<div class="item-title">'. $options['title'] ."</div>";
+	} else if (isset($item['title'])) {
+		$display_title = '<div class="item-title">'. $item['title']. "</div>";
+	}
+  $output = '<div class="'. $class .'">'. l($thumbnail, $destination, $attributes) . $display_title .'</div>';
   return $output;
 }
