code: function randomize( array ) {
    var tmp, current;
    var top = array.length;
  
    if ( !top ) {
      return array;
    }
  
    while ( --top ) {
      current = Math.floor( Math.random() * (top + 1) );
      tmp = array[ current ];
      array[ current ] = array[ top ];
      array[ top ] = tmp;
    }
  
    return array;
  }
docs: http://stackoverflow.com/a/962890/373422