/**
 * jQuery Shuffle (http://mktgdept.com/jquery-shuffle)
 * A jQuery plugin for shuffling a set of elements
 *
 * v0.0.1 - 13 November 2009
 *
 * Copyright (c) 2009 Chad Smith (http://twitter.com/chadsmith)
 * Dual licensed under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 *
 * Shuffle elements using: $(selector).shuffle() or $.shuffle(selector)
 *
 **/
(function($){  

  $.fn.shuffle = function() {  

    return this.each(function(){  

      var items = $(this).children();  

      return (items.length)  

        ? $(this).html($.shuffle(items))  

        : this;  

    });  

  }  

   

  $.shuffle = function(arr) {  

    for(  

      var j, x, i = arr.length; i;  

      j = parseInt(Math.random() * i),  

      x = arr[--i], arr[i] = arr[j], arr[j] = x  

    );  

    return arr;  

  }  

})(jQuery); 

