Index: image_pub.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/image_pub/image_pub.module,v
retrieving revision 1.11
diff -u -r1.11 image_pub.module
--- image_pub.module	20 May 2006 12:14:37 -0000	1.11
+++ image_pub.module	16 Feb 2007 11:32:54 -0000
@@ -141,7 +141,7 @@
       $options[$term->tid] = $dashes . $term->name;
     }
   }
-  $body[] = '<select name="'.$fname.'">';
+  $body[] = '<select onChange="change(\''.$fname.'\')" name="'.$fname.'">';
   foreach ($options as $aid => $term) {
     $sel = '';
     if ($aid == $albumid) {
@@ -220,11 +220,11 @@
       }
     }
   }
-  
+
   // move the file into the drupal filesystem
   $filelocation = $_FILES[$srcfield]['tmp_name'];
   $filename = basename($_FILES[$srcfield]['name']);
-  
+
   if (file_exists(file_directory_temp() . '/' . $filename)) {
   	// FIXME either rename or throw an error;
   }
@@ -582,7 +582,7 @@
   $album->parent = array($dtid);
   $term = (array)$album;
   $status = taxonomy_save_term( $term );
-  
+
   _image_pub_gr_finish(GR_STAT_SUCCESS, $body, 'Album reparented');
 }
 
@@ -781,6 +781,22 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?>">
 <head>
+  <script>
+    function change(select_box) {
+      var radio_id = '';
+      if (select_box == 'edit[albumid]')
+        radio_id = 'publish-now';
+      else
+        radio_id = 'create-new';
+
+      radio = document.getElementById(radio_id);
+      radio.checked = true;
+    }
+    function text_got_focus() {
+      radio = document.getElementById('create-new');
+      radio.checked = true;
+    }
+  </script>
 </head>
 <body bgcolor="threedface">
 <?php echo $body; ?>
@@ -852,8 +868,8 @@
   $body[] = '<tr><td>Within:</td><td>';
   $body[] = _image_pub_album_selector('edit[create_parentid]', TRUE, $select_album);
   $body[] = '</td></tr>';
-  $body[] = '<tr><td>Name:</td><td><input type="text" name="edit[create_name]" value="" /></td></tr>';
-  $body[] = '<tr><td>Description:</td><td><input type="text" name="edit[create_descr]" value="" /></td></tr>';
+  $body[] = '<tr><td>Name:</td><td><input type="text" name="edit[create_name]" value="" onfocus="text_got_focus();" /></td></tr>';
+  $body[] = '<tr><td>Description:</td><td><input type="text" name="edit[create_descr]" value="" onfocus="text_got_focus();" /></td></tr>';
   $body[] = '</table>';
   $body[] = '</div></td></tr>';
   $body[] = '<tr><td>&nbsp;</td></tr>';
