<div class="wrap <?php if( !current_user_can('manage_options') ){ echo " fg-disable-links"; } ?>">
  <div class="icon32" id="icon-upload"><br/></div>
  <h2>Upload media</h2>
  <br />
  <div style="width: 750px;">
    <h3 style="float: left; margin: 6px 10px 25px 0px;">Upload media into album: </h3>
    <form action="" method="post">
      <select name="albums" id="albumSelecter">
        <?php 
        
		$galleries = $this->wpdb->get_results("SELECT * FROM " . $this->gallery_table_name . "");
		foreach($galleries as $gallery) {
			echo '<optgroup label="' . $gallery->slug . '">';
			
			 $album_results = $this->wpdb->get_results("SELECT * FROM " . $this->album_table_name . " WHERE gallery='" . sanitize_file_name(sanitize_title(trim($gallery->title))) . "' ORDER BY sort ASC");
			 foreach($album_results as $album_result) {
				 echo '<option value="' . $album_result->slug . '" style="padding-left: 10px;">' . stripslashes($album_result->title) . '</option>';
			 }
			
			echo "</option>";
        }
	      
        ?>
      </select>
    </form>
    <div class="clear"></div>
    <h4 class="mediaHeadline">Upload images</h4>
    <div class="mediaSection">        
      <span id="flashUploader"></span>
      <span class="description" style="line-height: 30px; margin-left: 5px;">Use CTRL or SHIFT for selecting multiple images. You can only upload images with a maximum size of 1 MB!</span>
    </div>
    <br />
    
    <h4 class="mediaHeadline">Add other media</h4>
    <div id="mediaUpload" class="mediaSection" >        
      <span class="description">
        You can only add one media after another. This could be a Video(Quicktime, Youtube, Vimeo or Flash), an external site and more.<br />
        Just check out the <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/" target="_blank">demos of prettyphoto</a>, which explain how the URLs need to look like.
      </span>
      <br />
      <br />
      <form action="" method="post">
        <div>
          <span class="description">1. Upload a thumbnail by clicking the image...</span>
          <br />
          <img src="<?php echo plugins_url('/images/image_add_48.png', __FILE__);?>" alt="Media thumbnail" width="48" height="48" style="cursor: pointer; border: 1px solid #DFDFDF; float: left; margin: 5px 0px 15px; " />
          <input type="text" name="file_thumb" value="...or enter the URL of the thumbnail here" style="width: 90%; margin: 20px 0px 0px 5px; float: left;" />
          <div class="clear"></div>
          <span class="description">2. Set the URL of the media(video, image, website etc.):</span>
          <input type="text" name="media_file" value="Enter here the URL of the media" style="width: 100%;" />
          <br />
          <span class="description" style="margin-left: 10px;">e.g. http://www.youtube.com/watch?v=xTSE3bohck8&feature=player_embedded </span>
          <br />
          <a href="#" id="addMedia" class="button-secondary" title="Add media" style="margin: 5px 15px 0px 5px; float: right;">Add media</a>
          <div class="clear"></div>
        </div>
      </form>
      
    </div>
    <br />
    <br />
  </div>
  <!-- Begin media list with album selector -->
  <div>
    <h3>Media list</h3>
      <a href="#" id="selectAll" class="button-secondary" title="Select all media" >Select all</a>
      <a href="#" id="deselectAll" class="button-secondary" title="Deselect all media" >Deselect all</a>
      <a href="#" id="deleteFiles" class="button-secondary" title="Delete selected media">Delete</a>
      <div class="clear"></div>
      <br />
      <p class="description">Drag the elements to sort them.</p>
      <ol id="mediaList" class="clearfix">
      
      </ol>
      <a href="#" id="updateMedia" class="button-primary" title="Save changes">Save Changes</a>
  </div>
  <!-- End media list -->
</div>