/*!
 * Custom CSS for select fields on cart drop-down.
 *
 * Ripped forceably from:
 *   http://cssglobe.com/post/8802/custom-styling-of-the-select-elements
 *
 */

$(document).ready(function(){  

  if (!$.browser.opera) {
  
    // select element styling
    $('select.qtychg').each(function(){
      var title = $(this).attr('title');
      if( $('option:selected', this).val() != ''  ) title = $('option:selected',this).text();
      $(this)
        .css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
        .after('<span class="qtychg">' + title + '</span>')
        .change(function(){
          val = $('option:selected',this).text();
          $(this).next().text(val);
          })
    });

  };
  
});

/*!
 * The rest of the cart-specific code (only used on the view cart page)
 */
 
function updateQty (cr,baseurl) {
  location.href=baseurl+$('#'+cr).val();
}
