<html>
<body>
Клик.
<table id='music'>
<tr id="play1"><td>1</td></tr>
<tr><td>1k</td></tr>
<tr id="play2"><td>play</td></tr>
<tr><td>play2k</td></tr>
<tr id="play3"><td>3</td></tr>
<tr><td>3k</td></tr>
<tr id="play4"><td>4</td></tr>
<tr><td>4k</td></tr>
<tr id="play5"><td>5</td></tr>
<tr><td>5k</td></tr>
</table>
<script>
NOWplaying=2;
window.onclick = function(){
var table = document.getElementById('music'),
tr = table.rows,
i=tr.length, j=i/2,
arr = [];
table=tr[0].parentNode; //ибо tbody итп
while(i--) arr.push([tr[i],tr[--i]]);
return function(){
i=j; arr.sort(function(){return .5-Math.random()});
while(i--) {
if(arr[i][1].id==='play'+NOWplaying){
table.insertBefore( arr[i][0], tr[0] );
table.insertBefore( arr[i][1], tr[0] );
}else{
table.appendChild( arr[i][1] );
table.appendChild( arr[i][0] );
}
}
}
}();
</script>
</body>
</html>
Ток количество tr должно быть четным иначе плохо будет.))