  $(document).ready(function() {
    $('#recommend_overlay').jqm({modal:true}); 
    
    $('#recommand').bind('click', function() {
      $('#recommend_overlay').jqmShow(); 
    });
    
    $('#recommend_overlay .close').bind('click', function() {
      $('#recommend_overlay').jqmHide(); 
    });
    
    var ratingClicked = false;
    
    $('#shop_rating .stars div').bind('mouseover', function() {
      if (!ratingClicked) {
        $(this).removeClass('star_empty');
        $(this).addClass('star_full');
        
        $(this).prevAll().removeClass('star_empty');
        $(this).prevAll().addClass('star_full');
      }
    });
    
    $('#shop_rating .stars div').bind('mouseout', function() {
      if (!ratingClicked) {
        $('#shop_rating .stars div').removeClass('star_full');
        $('#shop_rating .stars div').addClass('star_empty');
      }
    });
    
    $('#shop_rating .stars div').bind('click', function() {
      $('#user_shop_rating').val($(this).attr('title'));
      ratingClicked = true;
    });
    
    $('#show_comments').bind('click', function() {
      var newSrc = $('#show_comments img:first').attr('src') == '/images/shop_rating_showcomments.png' ? '/images/shop_rating_hidecomments.png' : '/images/shop_rating_showcomments.png';
      
      $('#show_comments img:first').attr('src', newSrc);
      
      $('#shop_rating_comments').slideToggle('fast');
    });
  });
