diff -urpN add_n_reference/add_n_reference.info add_n_reference.bmwclean/add_n_reference.info
--- add_n_reference/add_n_reference.info	1969-12-31 16:00:00.000000000 -0800
+++ add_n_reference.bmwclean/add_n_reference.info	2007-09-13 20:02:53.000000000 -0700
@@ -0,0 +1,4 @@
+; $Id$
+name = Add and Reference
+description = Adds a buttons to create and reference new node with nodereference field
+dependencies = content nodereference form_restore
diff -urpN add_n_reference/add_n_reference.install add_n_reference.bmwclean/add_n_reference.install
--- add_n_reference/add_n_reference.install	1969-12-31 16:00:00.000000000 -0800
+++ add_n_reference.bmwclean/add_n_reference.install	2007-09-13 20:02:53.000000000 -0700
@@ -0,0 +1,13 @@
+<?php
+
+function add_n_reference_install() {
+  // Get the weight of content, nodereference and make our weight
+  // greater than both so that we can use hook_form_alter() change up
+  // their styles.
+  $cck_weight = db_result(db_query("SELECT weight FROM {system} WHERE name='content'"));
+  $noderef_weight = db_result(db_query("SELECT weight FROM {system} WHERE name='nodereference'"));
+  $weight = max($cck_weight, $noderef_weight) + 1;
+  db_query("UPDATE {system} SET weight=%d WHERE name='add_n_reference'", $weight);
+}
+
+?>
\ No newline at end of file
diff -urpN add_n_reference/add_n_reference.module add_n_reference.bmwclean/add_n_reference.module
--- add_n_reference/add_n_reference.module	2007-09-13 20:01:04.000000000 -0700
+++ add_n_reference.bmwclean/add_n_reference.module	2007-09-13 20:02:53.000000000 -0700
@@ -10,32 +10,23 @@
  */
 
 /**
- * Implementation of hook_help().
- */
-function add_n_reference_help($section) {
-  switch ($section) {
-    case 'admin/modules#description':
-      return t('Creates and references new nodes with nodereference field.
-      <em>Note: Requires content.module nodereference.module and form_restore.module</em>');
-  }
-}
-
-/**
  * Implementation of hook_form_alter().
  */
 function add_n_reference_form_alter($form_id, &$form) {
   if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
-    theme_add_style(drupal_get_path('module', 'add_n_reference') .'/add-n-reference.css');
+    drupal_add_css(drupal_get_path('module', 'add_n_reference') .'/add-n-reference.css');
     $fields = content_fields();
     foreach ($form as $key => $item) {
       $field_name = strstr($key, 'field_');
+
       if (isset($fields[$field_name]) && $fields[$field_name]['type'] == 'nodereference') {
         $field = content_fields($field_name, $form['type']['#value']);
         $form[$key]['#prefix'] = '<div class="add-n-reference">';
         $form[$key]['#suffix'] = "</div>\n";
 
         if ($field['widget']['type'] == 'nodereference_select') {
-          $buttons = _add_buttons($field, count($item['nids']['#default_value']));
+          //$buttons = _add_buttons($field, count($item['nids']['#default_value']));
+          $buttons = _add_links($field, count($item['nids']['#default_value']));
           if (!empty($buttons)) {
             $form[$key]['add_n_reference_buttons'] = $buttons + array(
               '#prefix' => '<div class="form-item field-select add-n-reference-buttons">',
@@ -75,13 +66,36 @@ function _add_buttons($field, $delta) {
         '#type' => 'button',
         '#name' => 'op[add_n_reference]['. $field['field_name'] .']['
         . $field['widget']['type'] .']['. $delta .']['. $type .']',
-        '#value' => t('Add new') .' '. $all_types[$type],
+        '#value' => t('Add new') .' '. $all_types[$type]->name,
+        '#submit' => FALSE
+      );
+    }
+  }
+  return $buttons;
+}
+
+/**
+ * Generates 'Add new...' button
+ * for each allowed content type
+ */
+function _add_links($field, $delta) {
+  $links = array();
+  $all_types = node_get_types();
+  foreach ($field['referenceable_types'] as $type => $value) {
+    if (!empty($value) && user_access("create $type content")) {
+      $buttons["add_$type"] = array(
+        '#type' => 'button',
+        '#name' => 'op[add_n_reference]['. $field['field_name'] .']['
+        . $field['widget']['type'] .']['. $delta .']['. $type .']',
+        '#value' => t('Add new') .' '. $all_types[$type]->name,
+        '#submit' => FALSE
       );
     }
   }
   return $buttons;
 }
 
+
 /**
  * Determines witch button is pressed
  */
