title: Create function for Order Button: identify which thumbnail was selected and capture image number?
body: <p>I have a series of thumbnails on a page. The function listed below sets a thumbnail's state to "Selected" once clicked on.  I want my  Order Button to capture this image's thumbnail style number.(see Example 2.) but I need help writing a function to capture the selected thumbnail's information. Help please!</p>
  
  <pre><code>function updateThumbnails(){
  $('.gallery_thumbnails a').each(function(index){
  
      if ( $('.gallery_preview a').attr('href') == $(this).attr('href') ){
          $(this).addClass('selected');
          $(this).children().fadeTo(250, .6);
      }else {
          $(this).removeClass('selected');
          $(this).children().css('opacity', '1');
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>Example 2: I need this images style number ( 634_RC.jpg. )which is a "child" of the "parent" 
  
  <pre><code>&lt;div class="gallery_thumbnails"&gt;
      &lt;a href="gallery/634-azalea-branch_fullsize.jpg" title="634-azalea-branch"&gt;&lt;img src="gallery-thumbnail/634_RC.jpg" alt="634-azalea-branch"/&gt;&lt;/a&gt;
  </code></pre>