Index: css/media-format-form.css
=========================================================
--- css/media-format-form.css	(revision 1.5)
+++ css/media-format-form.css	Thu Jul 08 16:56:00 EDT 2010
@@ -20,4 +20,21 @@
 
 #media-format-form .label-wrapper {
   margin-left: 0;
+}
+
+body.page-media-format-form {
+  background: none;
+}
+
+#media-browser-page {
+  background: #FFF;
+  padding: 1px 0;
+  -moz-border-radius: 4px;
+  -webkit-border-radius: 4px;
+  border-radius: 4px;
+}
+
+a.button {
+  display: inline-block;
+  margin: 10px 5px 0 0;
 }
\ No newline at end of file
Index: css/media.browser.css
=========================================================
--- css/media.browser.css	(revision 1.4)
+++ css/media.browser.css	Thu Jul 08 16:43:29 EDT 2010
@@ -1,7 +1,7 @@
 /* $Id: media.browser.css,v 1.4 2010/06/23 21:42:46 jameselliott Exp $ */
 
 body.page-media-browser {
-  background-color: #fff;
+  background: none;
 }
 
 div#media-browser-tabs {
@@ -11,11 +11,6 @@
   border: 0;
 }
 
-body.page-media-browser {
-  background-color: #fff;
-}
-
-
 /* show the throbber on the page */
 div#media-browser .throbber {
   height:100%;
@@ -35,4 +30,28 @@
 
 #media-browser-library-list .label-wrapper {
   margin-left: 0;
+}
+
+#mediaBrowser body {
+  background: none;
+}
+
+#media-browser-tabset .media-browser-tab {
+  background: #fff;
+  border: 1px solid #aaa;
+}
+
+#media-browser-tabset .ui-tabs-nav {
+  border-left: 1px solid #aaa;
+  border-right: 1px solid #aaa;
+  border-top: 1px solid #aaa;
+}
+
+.fake-ok {
+  margin-right: 5px;
+}
+
+a.button {
+  display: inline-block;
+  line-height: 21px;
 }
\ No newline at end of file
Index: css/media.css
=========================================================
--- css/media.css	(revision 1.9)
+++ css/media.css	Thu Jul 08 16:10:05 EDT 2010
@@ -200,4 +200,13 @@
   border: none;
   margin: 0 0 -5px;
   width: auto;
+}
+
+.ui-dialog .ui-dialog-buttonpane {
+  display: none;
+}
+
+.ui-widget.ui-widget-content {
+  background: none;
+  border: none;
 }
\ No newline at end of file
Index: javascript/media-browser.js
=========================================================
--- javascript/media-browser.js	(revision 1.3)
+++ javascript/media-browser.js	Thu Jul 08 17:04:56 EDT 2010
@@ -19,6 +19,9 @@
       Drupal.media.browser.finalizeSelection();
     }
     $('#media-browser-tabset').tabs();
+
+    $('.media-browser-tab').each( Drupal.media.browser.validateButtons );
+
   }
   // Wait for additional params to be passed in.
 };
@@ -27,6 +30,26 @@
 
 };
 
+Drupal.media.browser.validateButtons = function() {
+  if (!($('.form-submit', this).length > 0)) {
+    $('<a class="button fake-ok">Submit</a>').appendTo(this).bind('click', Drupal.media.browser.submit);
+    if (!($('.fake-cancel', this).length > 0)) {
+      $('<a class="button fake-cancel">Cancel</a>').appendTo(this).bind('click', Drupal.media.browser.submit);
+    }
+  } else if (!($('.fake-cancel', this).length > 0)) {
+    $('<a class="button fake-cancel">Cancel</a>').appendTo('form > div', this).bind('click', Drupal.media.browser.submit);
+  }
+};
+
+Drupal.media.browser.submit = function () {
+  var buttons = $(parent.window.document.body).find('#mediaBrowser').parent('.ui-dialog').find('.ui-dialog-buttonpane button');
+  if ($(this).hasClass('fake-cancel')) {
+    buttons[1].click();
+  } else {
+    buttons[0].click();
+  }
+}
+
 Drupal.media.browser.selectMedia = function (selectedMedia) {
   Drupal.media.browser.selectedMedia = selectedMedia;
 };
Index: javascript/media-format-form.js
=========================================================
--- javascript/media-format-form.js	(revision 1.4)
+++ javascript/media-format-form.js	Thu Jul 08 17:05:04 EDT 2010
@@ -13,7 +13,8 @@
 
 Drupal.behaviors.mediaFormatForm = {
   attach: function (context, settings) {
-    
+    $('<a class="button fake-ok">Submit</a>').appendTo($('#media-format-form')).bind('click', Drupal.media.formatForm.submit);
+    $('<a class="button fake-cancel">Cancel</a>').appendTo($('#media-format-form')).bind('click', Drupal.media.formatForm.submit);
   }
 };
 
@@ -28,4 +29,13 @@
   return { type: formatType, options: Drupal.media.formatForm.getOptions(), html: Drupal.settings.media.formatFormFormats[formatType] };
 };
 
+Drupal.media.formatForm.submit = function () {
+  var buttons = $(parent.window.document.body).find('#mediaStyleSelector').parent('.ui-dialog').find('.ui-dialog-buttonpane button');
+  if ($(this).hasClass('fake-cancel')) {
+    buttons[1].click();
+  } else {
+    buttons[0].click();
+  }
+}
+
 })(jQuery);
Index: javascript/media.popups.js
=========================================================
--- javascript/media.popups.js	(revision 1.4)
+++ javascript/media.popups.js	Thu Jul 08 17:11:25 EDT 2010
@@ -80,16 +80,18 @@
       return;
     }
     onSelect(selected);
-    $(this).dialog("close");
+    $(this).dialog("destroy");
+    $(this).remove();
   };
 
   dialogOptions.buttons[cancel] = function () {
-    $(this).dialog("close");
+    $(this).dialog("destroy");
+    $(this).remove();
   };
 
   Drupal.media.popups.setDialogPadding(mediaIframe.dialog(dialogOptions));
   // Remove the title bar.
-  //mediaIframe.parents(".ui-dialog").find(".ui-dialog-titlebar").remove();
+  mediaIframe.parents(".ui-dialog").find(".ui-dialog-titlebar").remove();
   return mediaIframe;
 };
 
@@ -116,6 +118,17 @@
   };
 };
 
+Drupal.media.popups.mediaBrowser.finalizeSelection = function () {
+  var selected = this.contentWindow.Drupal.media.browser.selectedMedia;
+  if (selected.length < 1) {
+    alert(notSelected);
+    return;
+  }
+  onSelect(selected);
+  $(this).dialog("destroy");
+  $(this).remove();
+}
+
 /**
  * Style chooser Popup. Creates a dialog for a user to choose a media style.
  *
@@ -164,11 +177,13 @@
       return;
     }
     onSelect(formattedMedia);
-    $(this).dialog("close");
+    $(this).dialog("destroy");
+    $(this).remove();
   };
 
   dialogOptions.buttons[cancel] = function () {
-    $(this).dialog("close");
+    $(this).dialog("destroy");
+    $(this).remove();
   };
 
   Drupal.media.popups.setDialogPadding(mediaIframe.dialog(dialogOptions));
@@ -188,7 +203,6 @@
 };
 
 
-
 /**
  * Style chooser Popup. Creates a dialog for a user to choose a media style.
  *
@@ -239,16 +253,18 @@
       return;
     }
     onSelect(formattedMedia);
-    $(this).dialog("close");
+    $(this).dialog("destroy");
+    $(this).remove();
   };
 
   dialogOptions.buttons[cancel] = function () {
-    $(this).dialog("close");
+    $(this).dialog("destroy");
+    $(this).remove();
   };
 
   Drupal.media.popups.setDialogPadding(mediaIframe.dialog(dialogOptions));
   // Remove the title bar.
-  mediaIframe.parents(".ui-dialog").find(".ui-dialog-titlebar").remove();
+  //mediaIframe.parents(".ui-dialog").find(".ui-dialog-titlebar").remove();
   return mediaIframe;
 };
 
@@ -276,12 +292,12 @@
   return {
     buttons: {},
     modal: true,
-    draggable: true,
-    resizable: true,
+    draggable: false,
+    resizable: false,
     minWidth: 600,
     width: 800,
-    height:500,
-    position: 'top',
+    height: 500,
+    position: 'center',
     overlay: {
       backgroundColor: '#000000',
       opacity: 0.4
Index: javascript/plugins/media.library.css
=========================================================
--- javascript/plugins/media.library.css	(revision 1.3)
+++ javascript/plugins/media.library.css	Thu Jul 08 16:10:05 EDT 2010
@@ -1,7 +1,7 @@
 
 ul#media-browser-library-list {
 	list-style: none;
-	margin: 0;
+	margin: -10px 0 0 0;
 	padding: 0px;
 	background-color: white;
 }
Index: media.module
=========================================================
--- media.module	(revision 1.37)
+++ media.module	Thu Jul 08 16:37:55 EDT 2010
